reading relay state via WebSocket
-
I have everything working now from my custom software and I love it. There is one thing I can't figure out yet, and that is how do I read the current state of a relay? I see it is possible via REST for instance, but not via WebSockets?
ws.send('{"cmd":"get","dev":"relay","circuit":"2_14"}')doesn't seem to workAnd is there maybe a way to get all current states of inputs and relays? I need to know what the state is at startup, not when it changes. Otherwise I cannot check if the input value has changed
edit: if no one has a better idea, I'm going to call the rest API at start of the application and keep the state in my app:
-
@Boy-Lenssen Please try using cmd "get_state". Haven't tried but might work :)
Also see: https://github.com/UniPiTechnology/evok/pull/9 which is adding a support to get state of all devices. In the release, it will be done in similar way or maybe different command.
-
@tomas_hora Awesome! When I have time again for this project, I'll try it!
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login