I want to calculate the usage of a heater .
The status of the heater status I can read and set, but the rekenTijdt will not work. What should I do or what do I do wrong?
MeAlbert wrote: Thursday 06 February 2020 19:47
I want to calculate the usage of a heater .
The status of the heater status I can read and set, but the rekenTijd will not work. What should I do or what do I do wrong?
this script does store your data as historical persistent data
Then I get this error message.
2020-02-07 00:24:01.374 Status: dzVents: Error (2.4.19): Heater: An error occured when calling event handler Script #1
2020-02-07 00:24:01.384 Status: dzVents: Error (2.4.19): Heater: ...domoticz/scripts/dzVents/generated_scripts/Script #1.lua:30: attempt to index field 'rekenTijd' (a nil value)
MeAlbert wrote: Friday 07 February 2020 0:26
Then I get this error message.
2020-02-07 00:24:01.374 Status: dzVents: Error (2.4.19): Heater: An error occured when calling event handler Script #1
2020-02-07 00:24:01.384 Status: dzVents: Error (2.4.19): Heater: ...domoticz/scripts/dzVents/generated_scripts/Script #1.lua:30: attempt to index field 'rekenTijd' (a nil value)
Could be another or modified script ? The script I posted does not have rekenTijd on line 30
Waaren your script has this line
domoticz.data.rekenTijd.add(domoticz.time.secondsSinceMidnight)
and there the fault is in. Wathever I try I always get the error message.
domoticz.data.status.add (device.state) or ('On') or ('Off') works fine.
domoticz.time.secondsSinceMidnight gives a number that works fine.
If I use local start = domoticz.time.secondsSinceMidnight
Then print (start) gives a number. putting start in domoticz.data.rekenTijd.add(start) gives an error message again.
Very frustratiing
MeAlbert wrote: Friday 07 February 2020 11:05
Waaren your script has this line
domoticz.data.rekenTijd.add(domoticz.time.secondsSinceMidnight)
and there the fault is in. Wathever I try I always get the error message.
Yes but not on line 30.
I tested the script I posted before and it does work without problems. If you encounter this error in line 30 you are not executing the same script.