REST API for smart sleep enabled nodes
-
Hi,
@jkandasa First of all great work! I really like this project and its simplicity. I'm sorry if I double post this but I have one simple question - when doing REST API calls to send messages to a specific node/sensor id does this work for sleeping nodes?
I'm asking this because I tried yesterday to perform a REST API call using the sendRawMessage endpoint for a smart sleep enabled node and I noticed that it doesn't work all the time (I used your example from here). I mean sometimes it got the message but most of the times it didn't. I also have a custom widget on the dashboard for controlling it which was creating using this tutorial and it works all the time. Now I don't know how much the two are related behind the scenes but by using the REST API it seems not so reliable for me.Is there another way of accomplish this or am I missing something here?
Or in another words is the sendRawMessage endpoint aware of smart sleep enabled sensors (if this makes sense) ?Forgot to mention - I'm using the MySensors back-end with a serial gateway and MyController version: 1.4.0.
Thank you for your help.
-
@mtiutiu Seems sendRawMessage not using/sensing sleeping node(need to confirm by checking the code.)
The following API using sleeping node logic,
PUT: https://enveedu.mycontroller.org/mc/rest/sensors/updateVariable
You can get the sensor variable id by editing the sensor variable.
Payload:
{ "id":1186, "value":1 }
-
That's what I did in the end as a "workaround" and it works. I don't like this approach very much because I have to inspect what id I need to use as it seems to be different from the real node sensor id.
It would be nice to have that working using the sendRawMessage endpoint also. I can open an issue on Github if needed.Thanks.
-
@mtiutiu said in REST API for smart sleep enabled nodes:
It would be nice to have that working using the sendRawMessage endpoint also. I can open an issue on Github if needed.
Yes, please open a ticket. I will check and update you. Thanks!