@martinhjelmare How cool! That solves my problem! You developed the component for HASS? Great work dude! Really, thanks for it.
I hope to be able to contribute more in the future, for now I've only done some small PRs.
@martinhjelmare How cool! That solves my problem! You developed the component for HASS? Great work dude! Really, thanks for it.
I hope to be able to contribute more in the future, for now I've only done some small PRs.
@mfalkvidd Thank you! The sketch on that thread should work
@exxamalte The sensor appears correctly after sending values. Also, the .json file is correctly filled with the sensor data.
@martinhjelmare Well, I'm using 0.33.4! I'll try updating and report back Thanks.
Thanks for the help and explanation.
I suggest the following:
if(!isTransportOK()){
wait(5000); // transport is not operational, allow the transport layer to fix this
}
sleep(30000); // transport is OK, node can sleep
That way, if it still can't connect during those 5 seconds it will sleep, and try again the next time.
@martinhjelmare I just updated to the latest version and now they appear correctly after rebooting! Thank you very much.
@martinhjelmare great idea! Thank you.
@martinhjelmare No problem, I'll try to get some more data. Regarding HA version, I'm always on the latest version (with one or two days delay).
@martinhjelmare Have you looked into this? I've been noticing delays very frequently
I don't have those delays with other components, and also had not had them when using Pimatic instead of HA.
@martinhjelmare How cool! That solves my problem! You developed the component for HASS? Great work dude! Really, thanks for it.
I hope to be able to contribute more in the future, for now I've only done some small PRs.
@martinhjelmare that is great!
So if I have, say, a switch and turn it ON on HA, when the node sends an heartbeat HA will send the ON command to the node?
I want to make a relay/switch which needs to be battery powered. Because of that it can't be constantly listening for messages. Since it is not critical for it to be instant, I was thinking that the node could be sleeping for like 60 seconds, and the send and heartbeat (or other message) to the gateway and wait for a reply. When receiving that, the gateway would send the current state to the node, and the node would then return to sleep. It would be similar to the option that exists in MYSController, that waits for a node to speak to send it a message.
Is this possible to do using Home Assistant?
Thanks. I've been debugging it, and it seems that sometimes "self.handle_queue()" in run() takes one or two seconds. It is not very frequent, but it seems to be the cause of my issues.
Also, my node is sending the message twice sometimes (I have yet to check why), and that increases the time also.
@martinhjelmare have you found anything? I've had a quick look at the code and found nothing relevant. The 1 second timeout you're referring to is just a connection timeout, right? It shouldn't affect communication after connecting I guess.
I'll try to add some debug prints to see if I find anything.
@martinhjelmare yes, I'm using the serial gateway. It should be possible to make it better, since I had no issues with the same gateway on Pimatic. I'll try to have a look at the code and let you know if I also find anything
Sometimes I notice that there is some delay in Home Assistant processing or receiving MySensors messages.
For example, I have a node with two switches. I press switch A and right after switch B. Looking at the debug logs from HA's MySensors component, switch B state is updated about a second after switch A.
I have never noticed this delay when using Pimatic instead of HA.
@martinhjelmare great idea! Thank you.