ich bin komplette neu in OpenHAB und habe mir gerade zum Testen OpenHAB4 installiert.
In den ersten Schritten versuche ich gerade meine Heimkino-Vorstufe "Monoprice HTP1" einzubinden.
Diese bietet ein webinterface zum Steuern. Dazu können die IR-Codes via http gesendet werden:
https://downloads.monoprice.com/files/m ... 210127.pdf
--> Seite 94/95
Im ersten Schritt um das Prinzip zu verstehen versuche ich gerade einfach mal die "Mute"-Funktion mit einem "Switch" abzubilden.
Die Basis-URL ist immer die: "http://192.168.100.252/ircmd?code="
Will man Mute einschalten muss man den IR-Code 4bb4 senden und die URL wird zu "http://192.168.100.252/ircmd?code=4bb4"
Will man Mute ausschalten muss man den IR-Code 4cb3 senden und die URL wird zu "http://192.168.100.252/ircmd?code=4cb3"
Generell wirft das Webinterface immer bei jedem Befehl und auch beim Aufruf der Basis-URL ein json-zurück.
Das sieht so aus (hier mal mit Powerhsell aufgerufen):
Code: Alles auswählen
PS C:\Users\steffen> (Invoke-RestMethod "http://192.168.100.252/ircmd?code=")
volume : -53
status : @{raw=; DECSourceProgram=none}
cal : @{lipsync=0; vpl=-100; vph=0; ampsense=1,7; diracactive=on; currentdiracslot=0;
caltoolconnected=False}
unitname : HTP-1
bassenhance : off
eq : @{tc=False; treble=; bass=}
upmix : off
fastStart : off
fastStartPassThrough : off
night : off
loudness : off
dialogEnh : 0
input : h1
muted : True
hw : @{fpBright=8}
stat : @{TVSoundSrc= ; TVSoundSrcDefault=none; earcLinkStatus=TIMEOUT, mode:EARC; CECStatus=
Enable:Off, LastReq:, SysAud:0, Map:0x0000; displayVideoStat=True; displayAudioStat=True;
displayAdvancedSettings=True; newupdate=noupdate; gitbranch=master; devrespavail=False;
enableSupportTools=False; systemAudio=True; updateprogmsg=}
versions : @{apm100=258: APM 119 v258, May 20 2023; avController=4.89 Built Aug 3 2021, 14:46:17
; backplane=51; hardware=Backplane HW: 3. MIO HW: 2 DAC HW: 3; hdmiVer=73.50.34;
SerialNumber=305; GuiNodeRed=commit 3071dcc
Date: Mon Jun 5 23:31:49 2023 -0400
; rootfsVer=rootfs-20191215.xz
; swVer=V1.10.0}
videostat : @{VideoResolution=4k50Hz; VideoColorSpace=RGB; VideoMode=4:4:4; VideoBitDepth=8bpc; HDRstatus=;
Video3D=}
peq : @{currentpeqslot=13; peqsw=True}
Leider habe ich es noch nicht hinbekommen die Mute-Funktion abzubilden. Mein Code sieht aktuell so aus:
Code: Alles auswählen
UID: http:url:04e25424e6
label: HTP1 HTTP
thingTypeUID: http:url
configuration:
authMode: BASIC
ignoreSSLErrors: false
baseURL: http://192.168.100.252/ircmd?code=
delay: 0
stateMethod: GET
refresh: 30
commandMethod: GET
contentType: application/json
timeout: 3000
bufferSize: 2048
channels:
- id: Volume
channelTypeUID: http:string
label: Volume
description: Volume
configuration:
mode: READONLY
stateTransformation: JSONPATH:$.volume
- id: Mute
channelTypeUID: http:switch
label: Mute
description: null
configuration:
onValue: 4bb4
commandTransformation: MAP:HTP1Mute.map
offValue: 4cb3
stateTransformation: JSONPATH:$.muted
commandExtension: "%2$s"
Code: Alles auswählen
ON=true
OFF=false
true=ON
false=OFF