I'm trying to use MQTT import with deep sleep and retain flag to send commands/data from OpenHAB to ESPEasy. I have compiled my own version using v2.0-20180130 and P155 (HeatpumpIR).
I have setup some items in OpenHAB that, when changed, send their values with retain flag to MQTT broker on specific topics. I have setup MQTT Import to subscribe to those topics to get the values. Up to this point everything works as expected: I can change the items values in OpenHAB and the values are sent to ESPEasy and can trigger events/rules. If I turn ESPEasy off and then on, it gets the last posted values (retain flag works).
However as soon as I enable deep sleep, it no longer gets any values. I would expect that upon wakeup MQTT Import would subscribe to the configured topics, get the last posted values and then go to sleep again. However it does not - it merely subscribes to the topics and then immediately gos to sleep without getting any values. I have attached serial monitor through USB and enabled debug logging on serial and I can see that is actualy subscribes to the topics but does not get any values. I also notice that rules processing time varies betqeen 600 and 1500 ms
Is this setup supposed to work the way I expect? Am I doing something wrong? Is the long rules processing time possibly preventing MQTT Import from getting the values in time (before it goes to sleep)?
Thanks in advance for any help.
Edit:
Here is the relevant log:
Code: Select all
...
EVENT: Clock#Time=Tue,00:04
EVENT: Processing time:575 milliSeconds
IMPT : MQTT 037 Connection lost
IMPT : Connected to MQTT broker with Client ID=espeasy-Import
IMPT : [heatpump#temp] subscribed to /espeasy/imp/LivingRoomAC/Temp
EVENT: System#Sleep
EVENT: Processing time:559 milliSeconds
SLEEP: Powering down to deepsleep...
state: 5 -> 0 (0)
...