Seite 1 von 2

[Gelöst] Denon AVR Remote Binding

Verfasst: 30. Dez 2019 22:13
von PeterA
Hallo zusammen,

meinen DENON AVR X2000 Heimkino Receiver habe ich über das Denon/Marantz Binding eingebunden.
Das funktioniert auch Einwandfrei. Aber ich wollte noch einige Tasten der IR Remote über OpenHab laufen lassen.
Nach etwas Recherche bin ich zum einen auf die Denon Befehlsliste gestossen:
http://m.us.marantz.com/DocumentMaster/ ... otocol.xls
Und zum anderen auch auf den Http Aufruf:
https://blue-pc.net/2013/12/28/denon-av ... p-steuern/
Nämlich:

Code: Alles auswählen

http://<AV IP-Adresse>/goform/formiPhoneAppDirect.xml?MNCUP
für Cursor UP z.B.

Also habe ich mir zunächst ein Stringitem erstellt:

Code: Alles auswählen

String DenonCommand { http=">[*:POST:http://denonIP/goform/formiPhoneAppDirect.xml?%2$s]" }
Und dann über die Sitemap die Mappings gebaut:

Code: Alles auswählen

Switch item=DenonCommand         label="Denon Remote"        icon="movecontrol"   mappings=['MNMEN ON'="SETUP ON",'MNMEN OFF'="SETUP OFF",MNENT="ENTER",MNRTN="BACK"]
Switch item=DenonCommand         label="Denon Remote"        icon="movecontrol"   mappings=[MNCLT="⬅️",MNCUP="⬆️",MNCDN="⬇️",MNCRT="➡️"]
Switch item=DenonCommand         label="Denon Remote"        icon="movecontrol"   mappings=[MNINF="INFO",MNOPT="OPTION",MNCHL="CH. Level"]
Nun zu folgendem Problem:
Um ins "Setup" Menü zu kommen muss der Befehl "MNEN ON" gesendet werden. Dieser Befehl beinhaltet ein Leerzeichen.
Das "schmeckt" dem Sitemap Parser so nicht.
Also habe ich diesen String in der Sitemap mit zwei Anführungszeichen "maskiert" (Danke an Winni und Udo aus einem anderen Post).
Wenn ich aber nun den Button in der Sitemap Betätige kommt folgendes im Log:

Code: Alles auswählen

2019-12-30 21:57:20.355 [ome.event.ItemCommandEvent] - Item 'DenonCommand' received command MNMEN ON

2019-12-30 21:57:20.365 [vent.ItemStateChangedEvent] - DenonCommand changed from MNRTN to MNMEN ON

==> /var/log/openhab2/openhab.log <==

2019-12-30 21:57:20.357 [WARN ] [org.apache.karaf.services.eventadmin] - EventAdmin: Exception during event dispatch [org.osgi.service.event.Event [topic=openhab/command/DenonCommand] {item=DenonCommand, bridgemarker=true, command=MNMEN ON, timestamp=1577739440355} | {org.osgi.service.cm.ManagedService, org.osgi.service.event.EventHandler}={service.id=409, service.bundleid=278, service.scope=bundle, event.topics=openhab/*, service.pid=org.openhab.http, component.name=org.openhab.binding.http, component.id=44} | Bundle(org.openhab.binding.http_1.13.0 [278])]

java.lang.IllegalArgumentException: Invalid uri 'http://192.168.2.115/goform/formiPhoneAppDirect.xml?MNMEN ON': Invalid query

	at org.apache.commons.httpclient.HttpMethodBase.<init>(HttpMethodBase.java:222) ~[?:?]

	at org.apache.commons.httpclient.methods.ExpectContinueMethod.<init>(ExpectContinueMethod.java:93) ~[?:?]

	at org.apache.commons.httpclient.methods.EntityEnclosingMethod.<init>(EntityEnclosingMethod.java:119) ~[?:?]

	at org.apache.commons.httpclient.methods.PostMethod.<init>(PostMethod.java:106) ~[?:?]

	at org.openhab.io.net.http.HttpUtil.createHttpMethod(HttpUtil.java:318) ~[?:?]

	at org.openhab.io.net.http.HttpUtil.executeUrl(HttpUtil.java:167) ~[?:?]

	at org.openhab.io.net.http.HttpUtil.executeUrl(HttpUtil.java:130) ~[?:?]

	at org.openhab.binding.http.internal.HttpBinding.formatAndExecute(HttpBinding.java:291) ~[?:?]

	at org.openhab.binding.http.internal.HttpBinding.internalReceiveCommand(HttpBinding.java:130) ~[?:?]

	at org.openhab.core.binding.AbstractBinding.receiveCommand(AbstractBinding.java:94) ~[?:?]

	at org.openhab.core.events.AbstractEventSubscriber.handleEvent(AbstractEventSubscriber.java:45) ~[?:?]

	at org.apache.felix.eventadmin.impl.handler.EventHandlerProxy.sendEvent(EventHandlerProxy.java:415) [3:org.apache.karaf.services.eventadmin:4.2.1]

	at org.apache.felix.eventadmin.impl.tasks.HandlerTask.runWithoutBlacklistTiming(HandlerTask.java:82) [3:org.apache.karaf.services.eventadmin:4.2.1]

	at org.apache.felix.eventadmin.impl.tasks.SyncDeliverTasks.execute(SyncDeliverTasks.java:104) [3:org.apache.karaf.services.eventadmin:4.2.1]

	at org.apache.felix.eventadmin.impl.tasks.AsyncDeliverTasks$TaskExecuter.run(AsyncDeliverTasks.java:166) [3:org.apache.karaf.services.eventadmin:4.2.1]

	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]

	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]

	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]

	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]

	at java.lang.Thread.run(Thread.java:748) [?:?]
Wo liegt denn hier der Fehler ?

Des weiteren ist mir aufgefallen, wenn ich andere Befehle sende z.B. MNINF (hier ohne Leerzeichen)
funktioniert das Senden aber der Denon reagiert sehr verzögert auf den Befehl und im Log sehe ich das hier:

Code: Alles auswählen

2019-12-30 22:09:55.122 [ome.event.ItemCommandEvent] - Item 'DenonCommand' received command MNINF

2019-12-30 22:09:55.144 [vent.ItemStateChangedEvent] - DenonCommand changed from MNMEN ON to MNINF

2019-12-30 22:09:59.850 [vent.ItemStateChangedEvent] - CoolstreamTime changed from 22:08:59 to 22:09:59

==> /var/log/openhab2/openhab.log <==

2019-12-30 22:10:00.144 [ERROR] [org.openhab.io.net.http.HttpUtil    ] - Fatal transport error: java.net.SocketTimeoutException: Read timed out
Für sachdienliche Hinweise wäre ich sehr Dankbar :)

Vielen Dank

und #GUDE2020

Re: Denon AVR Remote mit Http

Verfasst: 30. Dez 2019 22:50
von PeterA
So... Kommando zurück!

Im Denon Binding in der PaperUI gibts den Button "Show More"
Hier taucht dann der channel für custom command auf.
Also muss das item nun so aussehen:

Code: Alles auswählen

String DenonCommand { channel="denonmarantz:avr:0005cd3a0e8e:general#command" }
Und der Rest über die Sitemap.

Funktioniert.

#GUDE2020

Re: Denon AVR Remote mit Http

Verfasst: 31. Dez 2019 01:05
von PeterA
Jetzt ist mir in der Sitemap etwas aufgefallen:
Der aktuelle Status des items wird auch in der Sitemap vor den Buttons angezeigt.
Hier mein Post aus dem englischen Forum:
https://community.openhab.org/t/denon- ... aschinger
Bild

Bild
Woran liegt das und kann ich das verbergen?

Gruß Peter

Re: Denon AVR Remote mit Http

Verfasst: 31. Dez 2019 01:18
von udo1toni
Du musst vermutlich den Status-Teil des Labels explizit auf nichts setzen:

Code: Alles auswählen

Switch item=DenonCommand         label="Denon Remote []"        icon="movecontrol"   mappings=['MNMEN ON'="SETUP ON",'MNMEN OFF'="SETUP OFF",MNENT="ENTER",MNRTN="BACK"]
Switch item=DenonCommand         label="Denon Remote []"        icon="movecontrol"   mappings=[MNCLT="⬅️",MNCUP="⬆️",MNCDN="⬇️",MNCRT="➡️"]
Switch item=DenonCommand         label="Denon Remote []"        icon="movecontrol"   mappings=[MNINF="INFO",MNOPT="OPTION",MNCHL="CH. Level"]
Bei Things und Channels werden Standard Formatierungen für den Status mitgegeben, wenn Du dann nicht explizit eine Formatierung vorschreibst, wird das von openHAB reingemogelt.

Re: Denon AVR Remote mit Http

Verfasst: 31. Dez 2019 09:54
von PeterA
Hi Udo,

Hat wie immer funktioniert!

Vielen Dank

Re: Denon AVR Remote mit Http

Verfasst: 6. Jan 2020 09:35
von PeterA
Habe nun noch mehr "Custom" Commands eingebaut:

denon item:

Code: Alles auswählen

String DenonCommand "[]" { channel="denonmarantz:avr:<mydenonuniqeid>:general#command" }
Das ist das String Item das die Befehle der Sitemap bekommt und über das Binding an den AVR sendet.

Sitemap Auszug:

Code: Alles auswählen

Switch item=DenonCommand         icon=""              mappings=['MNMEN ON'="SETUP ON",'MNMEN OFF'="SETUP OFF"] //Setup Menue On Off
Switch item=DenonCommand         icon="movecontrol"   mappings=[MNCLT="⬅️",MNCUP="⬆️",MNCDN="⬇️",MNCRT="➡️"] //The Arrowkeys 
Switch item=DenonCommand         icon=""              mappings=[MNENT="ENTER",MNRTN="BACK",MNINF="INFO",MNOPT="OPTION"] //Enter Back Info and Option Keys
Switch item=DenonCommand         icon="soundvolume-0" mappings=['CVSW UP'="SUBW +",'CVSW DOWN'="SUBW -",'CVC UP'="CENTER +",'CVC DOWN'="CENTER -"] //Subwoofer and Center Volume
Switch item=DenonCommand         icon="soundvolume-0" mappings=['CVFL UP'="FRONT L +",'CVFL DOWN'="FRONT L -",'CVFR UP'="FRONT R +",'CVFR DOWN'="FRONT R -"] //Frontspeaker Volume
Switch item=DenonCommand         icon="soundvolume-0" mappings=['CVSL UP'="SURR L +",'CVSL DOWN'="SURR L -",'CVSR UP'="SURR R +",'CVSR DOWN'="SURR R -"] //Sourroundspeaker Volume
Selection item=DenonCommand         icon="soundvolume-0"   label="Sourround Mode" mappings=[MSMOVIE="Movie",MSMUSIC="Music",MSGAME="Game",'MSPURE DIRECT'="Pure Direct",MSDIRECT="Direct",MSSTEREO="Stereo",MSSTANDARD="Standard",'MSDOLBY DIGITAL'="Dolby Digital",'MSDTS SURROUND'="Dts Surround",'MSMCH STEREO'="Multi Ch Stereo",'MSROCK ARENA'="Rock Arena",'MSJAZZ CLUB'="Jazz Club",'MSMONO MOVIE'="Mono Movie",MSMATRIX="Matrix",'MSVIDEO GAME'="Video Game",MSVIRTUAL="Virtual"] // Select SURROUND mode
Viel Spass damit!

Re: [Gelöst] Denon AVR Remote Binding

Verfasst: 24. Jan 2020 21:33
von PeterA
Hallo zusammen,

wenn ich meinen Denon über eine geschaltete Steckdose komplett vom Netz trenne, geht das Binding in OpenHab
nach einiger Zeit OFFLINE.

Kann ich das in einer Rule Auswerten und mein Denon ON/OFF Item auf OFF setzen ?

Vielen dank für sachdienliche Hinweise :)

Edit:

So gehts:

Code: Alles auswählen

rule "Denon OFFLINE/ONLINE"
	when 
		Thing "denonmarantz:avr:0005cd3a0e8e" changed
	then
		var status = getThingStatusInfo("denonmarantz:avr:0005cd3a0e8e").getStatus()
        logInfo("Denon AVR X2000","Status: "+status.toString())
        if (status.toString() == 'OFFLINE')
		{
			DenonAVRX2000_MainZone_Power.postUpdate(OFF)
		}
		else {
			DenonAVRX2000_MainZone_Power.postUpdate(ON)
		}
end

Re: [Gelöst] Denon AVR Remote Binding

Verfasst: 25. Jan 2020 01:33
von udo1toni
Schau mal hier: https://www.openhab.org/docs/configurat ... d-triggers
Du brauchst also den Trigger
Thing <thingUID> changed to OFFLINE. Vorsicht mit from und to, denn es gibt viel mehr als nur OFFLINE und ONLINE (ist aber alles in der Doku erklärt)

Re: [Gelöst] Denon AVR Remote Binding

Verfasst: 2. Feb 2021 21:34
von AndreM77
Hi,
PeterA hat geschrieben: 24. Jan 2020 21:33 wenn ich meinen Denon über eine geschaltete Steckdose komplett vom Netz trenne, geht das Binding in OpenHab
nach einiger Zeit OFFLINE.
ich hab die gleiche Konstellation. Hat sich Dein Rule bei Dir bewährt?

Danke & Grüße
André

Re: [Gelöst] Denon AVR Remote Binding

Verfasst: 2. Feb 2021 21:38
von PeterA
Klaro, läuft einwandfrei.

Gruß