mycontroller-org / mycontroller-v1-legacy

The Open Source Controller
http://www.MyController.org
Apache License 2.0
148 stars 90 forks source link

smartSleep for mysensors 2.2.0 #453

Closed mczerski closed 6 years ago

mczerski commented 6 years ago

Hi,

I can't get smartSleep to work properly with mycontroller. first it seems that mysensors 2.2.0 sends different message type from smartSleep before going to sleep. I_PRE_SLEEP_NOTIFICATION instead of I_HEARTBEAT_RESPONSE. As I understand, for mycontroller to handle properly sleeping nodes the message must be I_HEARTBEAT_RESPONSE ? So I added seandHeartbeat(); before smartSleep(); But this is not working as expected. I can see in the gateway logs, that when sending raw message to the sleeping node, the message is sent immediately. And when the node wakes and send the heartbeat, I do not see any messages sent to this node from the mycontroller. What am I doing wrong ?

mczerski commented 6 years ago

Oh, and ofcourse I checked the "Smart sleep enabled" checkbox on this sleeping node

mczerski commented 6 years ago

hmm, as I debug the issue it seems that MyController actually supports mysensors 2.2.0 (it is aware of I_PRE_SLEEP_NOTIFICATION). The issue is that the messages are not put into the smartSleepQueue. I use MQTT and I'm afraid that it is the cause. I set the "Ack enabled' option in the gateway configuration but this is not helping.

mczerski commented 6 years ago

it seems like smartSleep is not taken into account when using "send raw message" tab. So how do I send a message to the node from the mycontroller ?

mczerski commented 6 years ago

OMG, I have to add a room, to which I add the sensor and only then I can send something to that node using smartSleep functionality ...

mczerski commented 6 years ago

after that it works

jkandasa commented 6 years ago

@mczerski great! Thank you for the updates!