@anand There was vastly more time wasted trying to get the original concept to work, than it look to learn basics of Domoticz scripting after finding a solution used by others.
The sketch complexity and size is dramarically reduced for the Node, it still responds to changes in boiler or PSU condition within a second, and reports temperatures and power condition regularly.
Domoticz reconciles everything to default 5 minute time slots, this method provides boiler run times to an accuracy of a minute which is quite adequate.
@zboblamont OK, so experiments concluded that the return data from the latest version of Domoticz is a String whether it be V_VARx or V_TEXT.
I tried the dual declaration using the same CHILD_ID as intended and as VAR_X (using an RF24 - not sure of the relevance) and the actual value sent but failed to make any sense of abstracting the Ulong conversion or the string.
Only by presenting a fresh CHILD_ID and duplicating the send of data (water meter) as a V_VAR1 could I recover the last sent reading as a V_VAR1 from that fresh CHILD_ID, thence eventually arriving at 'strtoul' as a solution to restoring the last known value.
For clarity my Gateway and Controller run on a UPS, and I hope shortly to add the spare router to that UPS so I'm not left in the dark on what is happening in the dark on a battery powered laptop...
Hope this helps others trying to keep track of meters between relentless power cuts and reboots...
@goblin feel free to share concrete error messages or questions. We might be able to help on well-described problems. Otherwise - hope ChatGPT can help you
the problem is "if (switch.state == 'On') then" that not works, write:
if (switch.active) then
or
if (switch.inActive) then
Device attributes and methods for all devices