codmpm / node-red-contrib-loxone

Connect the Loxone Miniserver to node-red via the Websocket API
MIT License
74 stars 24 forks source link

State for Virtual Up/Down button required #62

Closed mvandenabeele closed 3 years ago

mvandenabeele commented 3 years ago

Hi

Thanks for creating this module. It will make the transition from LoxOne to Homeassistant a lot easier!

In LoxOne, I have a virtual input configured as Up/Down buttons. If I try to use this with a "control in" node, I can navigate to the control, but the combobox state is empty: image

The node indicates not being configured properly because state is required. Did I do something wrong?

Kind regards, Merijn

codmpm commented 3 years ago

Hey Merijn,

thank you. Please see the third example in the README.md: https://github.com/codmpm/node-red-contrib-loxone

As the UpDownDigital (etc.) virtual input has no state where the control-out node can put it's data, I've switched it as an example via the webservice-node.

mvandenabeele commented 3 years ago

Hi

I'm sorry I've missed your example. I'm sure I'll get it to work with this extra info. However, from an UX point of view, this is a lot more difficult, as now I have to know how the Loxone API works to determine the "path" to the virtual input. If the "control in" had an option to output its messages ("output/publish events", maybe on a second output?), this would be a lot easier.

Merijn

codmpm commented 3 years ago

Hey,

there's nothing I can do about it as node-red-contrib-loxone has to work with what the websocket offers. There simply is nothing that control-out could work with in loxones websocket.

The "messages" you are talking about, is what you provide in msg.payload. Again, see the README.md:

You will get the data from Loxone's websocket as is. There is and will be no abstraction layer! So please know how to handle the data according to the structure file or the webservice documenation.

node-red-contrib-loxone "just" subsribes to events and sends messages... in theory it's nothing more. :-)

Best, Patrik

mvandenabeele commented 3 years ago

Don't know if I should start a new conversation or continue here. I've picked up were I left off last month. Now I want to get the current state of a switch. If I use a stream-all-node I get this message when the switch state changes: image

Is there a way I can request that state when needed? It would be nice if there was a current-state-node like there is in Home Assistant. If not, I guess I can cache the state when a change happens, but that might get out of sync on a restart.

From the LoxOne API documentation, I got links like http://miniserver/jdev/sps/io/{uuid}/state to get the current state, but this doesn't seem to work with any uuid from the screenshot.