Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't get status… #130

Open
albi opened this issue Aug 19, 2024 · 2 comments
Open

Can't get status… #130

albi opened this issue Aug 19, 2024 · 2 comments

Comments

@albi
Copy link

albi commented Aug 19, 2024

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" }

@Supereg
Copy link
Owner

Supereg commented Sep 2, 2024

Hey, could you try the following for the status pattern:

{
  "statusPattern": "\"mode\":\"43\""
}

You do not need to need regex string literals /.../g

@albi
Copy link
Author

albi commented Sep 2, 2024

Currently my config 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", "http_method": "GET", "status_pattern": "\"mode\":\"43\"", "statusResponseType": "json", "pollingInterval": 10, "timeout": 5000 }

But it won't update the status.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants