ich würde gerne die Lautstärke meines Denon-Receivers x3000 über OH per Post-Aufruf in einem Skript (Kodi/CinemaVision) an einer bestimmten Stelle jeweils hoch- und runterstellen auf einen bestimmten Wert. Leider wird der Befehl nicht ausgeführt. Das Denon Binding 2.5 habe ich installiert. In OH lässt sich der Player über die PaperUI ganz normal steuern, auch die Lautstärke.
Folgendes habe ich gemeinsam mit einem Kollegen, der programmieren kann, gemacht:
1) Item angelegt für eine spätere Status-Abfrage:
Code: Alles auswählen
String PlayState "Playstatus"
Code: Alles auswählen
rule "Change current playing"
when
Item PlayState changed
then
logInfo("cinemavision.rules", "Current playing changed to " + PlayState.state.toString())
if (PlayState.state.toString().toLowerCase() == 'intro') {
logInfo("cinemavision.rules", "Changed to intro, setting volume up to 10.")
// 10 is the volume the denon has to reach - change this value to increase the volume
denonmarantz_avr_0005cda4583d_mainZone_volume.sendCommand(10)
}
if (PlayState.state.toString().toLowerCase() == 'movie') {
logInfo("cinemavision.rules", "Changed to movie, setting volume up to 15.")
// 15 is the volume the denon has to reach - change this value to increase the volume
denonmarantz_avr_0005cda4583d_mainZone_volume.sendCommand(15)
}
PlayState.sendCommand('')
end
Code: Alles auswählen
# This is the intro script for cinemavision triggering OpenHAB over it's REST-API via POST-Request
# The following line defines the OpenHAB REST interface and the item
http://xxx.xxx.xxx.xx:8080/rest/items/PlayState
# This line is setting the correct content type accepted by the OpenHAB server instance
HEADERS: {"Content-Type": "text/plain"}
# The following is the Data Line
POST: Intro
Aber beim AVR tut sich nichts, im Logfile ist auch nichts protokolliert.
Sieht jemand den Fehler oder hat eine Idee?
Gruß, Helge