for the time being, I am having a bunch of D1mini and NodeMCU devices, reporting Temp/Hum/Pres values to my home automation System through UDP as follows:
Sensors ----> UDP Controller in ESPEasy --> Backend ( smarthomeNG ) ---> Frontend ( smartVISU ).
In general, this is working fine and smooth. However, I am having issues with some of the ESP's (hourly reboots, sometimes an ESP hangs without being noticed, etc). Just this week I had one device offline for 3 days, and didn't notice it.
Besides the sensor values, my backend also stores date/time for 'value last updated' and 'value last changed' for each submitted item. So I am thinking about introducing a new 'alive' dummy value for each of the ESP's, that is frequently sending an update to the backend. If the dummy value hasn't been updated for like 30 minutes or so, I know the device is offline and needs a reboot. This status could easily be displayed in the frontend by a separate bool item next to the temp/hum/pres values as a 'traffic light' red/green.
So far all is clear, I am just not sure what would be the best / most reliable way to configure ESP Easy (I am still pretty much a noob on rules etc). Also, I read somewhere that ESP Easy Controllers only send protocols once a value has changed (so: no sending for unchanged values). The following two rule sets came into my mind, but before bringing this 'live' I wanted to ask if someone else has some hints or a better solution for this, or if maybe someone has done something similar before:
Code: Select all
//?on System#Boot do?//
on Time#Initialized do
TaskValueSet 3,2,1 // set dummy 'alive' item to 1
timerSet,1,900 // wait for 15 mins
endon
on Rules#Timer=1 do
TaskValueSet 3,2,0 // set dummy 'alive' item to 0
timerSet,2,900 // wait for 15 mins
endon
on Rules#Timer=2 do
TaskValueSet 3,2,1 // set dummy 'alive' item to 1
timerSet,1,900 // wait for 15 mins
endon
on Clock#Time=All,03:00 do // every day at 03:00
Reboot
endon
Code: Select all
//?on System#Boot do?//
on Time#Initialized do
TaskValueSet 3,2,%unixtime% // write seconds into dummy item
timerSet,1,900 // wait for 15 mins
endon
on Rules#Timer=1 do
TaskValueSet 3,2,%unixtime% // write seconds into dummy item
timerSet,1,900 // wait for 15 mins
endon
on Clock#Time=All,03:00 do // every day at 03:00
Reboot
endon
/tom