homebridge-http-switch
homebridge-http-switch copied to clipboard
Can't get status…
I try to get the audio source status of my amp for the stateful http-switch. Switching the state already works, but I can't get the status right. The status response is:
{"type":"0","ch":"0","mode":"43","loop":"4","eq":"0","vendor":"","status":"stop","curpos":"0","offset_pts":"0","totlen":"0","Title":"556E6B6E6F776E","Artist":"556E6B6E6F776E","Album":"556E6B6E6F776E","alarmflag":"0","plicount":"0","plicurr":"0","vol":"50","mute":"0"}
Where "mode", when set to 43, should reflect as "true" for the switch. When "mode" is another value, it should be seen as "false".
My config for the switch is:
{ "accessory": "HTTP-SWITCH", "name": "TV Audio Test", "switchType": "stateful", "onUrl": "https://10.0.1.23/httpapi.asp?command=setPlayerCmd:switchmode:optical", "offUrl": "https://10.0.1.23/httpapi.asp?command=setPlayerCmd:switchmode:wifi", "statusUrl": "https://10.0.1.23/httpapi.asp?command=getPlayerStatus", "statusPattern": "/\"mode\":\"43\"/g" }