I hope I put it on the right place.
Code: Select all
dz.log(dz.data.lastExecutionTimes, dz.LOG_DEBUG)
if dz.data.lastExecutionTimes[item.name] == nil or ( dz.data.lastExecutionTimes[item.name] < ( dz.time.dDate - 1 ) ) then
pushToInfluxdb( item.idx, 0, item.rawData )
dz.data.lastExecutionTimes[item.name] = dz.time.dDate
else
dz.log('Too soon after last update; we don\'t want an endless loop', dz.LOG_DEBUG)
end
dz.log(dz.data.lastExecutionTimes, dz.LOG_DEBUG)
end
}
The logfile looks like this now:
Code: Select all
2020-04-22 22:45:03.444 Status: dzVents: Info: Push to Influx: ------ Start internal script: Push naar influx: Device: "WP Opgewekt (Dummy)", Index: 64
2020-04-22 22:45:03.445 Status: dzVents: Debug: Push to Influx: Device WP Opgewekt was changed 569.0
2020-04-22 22:45:03.446 Status: dzVents: Debug: Push to Influx: {["KWH Garage vandaag"]=1587580083, ["WP COP"]=1587588003, ["WP Opgewekt"]=1587588242, ["KWH totaal vandaag"]=1587585607, ["PV Vermogen Sauna"]=1587585604, ["KWH Garage"]=1587389343, ["PV Sauna vandaag"]=1587215107, ["PV Vermogen Garage"]=1587585604, ["KWH totaal"]=1587389108, ["PV Vermogen Totaal"]=1587585605, ["Vermogen Garage"]=1587580083, ["WP Backup Heater"]=1585326248}
2020-04-22 22:45:03.447 Status: dzVents: Debug: Push to Influx: OpenURL: url = http://127.0.0.1:8080/json.htm?type=command¶m=udevice&idx=64&nvalue=0&svalue=569.0;2355172.5667101
2020-04-22 22:45:03.447 Status: dzVents: Debug: Push to Influx: OpenURL: method = GET
2020-04-22 22:45:03.447 Status: dzVents: Debug: Push to Influx: OpenURL: post data = nil
2020-04-22 22:45:03.447 Status: dzVents: Debug: Push to Influx: OpenURL: headers = nil
2020-04-22 22:45:03.448 Status: dzVents: Debug: Push to Influx: OpenURL: callback = nil
2020-04-22 22:45:03.461 Status: dzVents: Debug: Push to Influx: {["KWH Garage vandaag"]=1587580083, ["WP COP"]=1587588003, ["WP Opgewekt"]=1587588303, ["KWH totaal vandaag"]=1587585607, ["PV Vermogen Sauna"]=1587585604, ["KWH Garage"]=1587389343, ["PV Sauna vandaag"]=1587215107, ["PV Vermogen Garage"]=1587585604, ["KWH totaal"]=1587389108, ["PV Vermogen Totaal"]=1587585605, ["Vermogen Garage"]=1587580083, ["WP Backup Heater"]=1585326248}
2020-04-22 22:45:03.468 Status: dzVents: Info: Push to Influx: ------ Finished Push naar influx
2020-04-22 22:45:03.489 Status: dzVents: Info: Push to Influx: ------ Start internal script: Push naar influx: Device: "WP COP (Dummy)", Index: 73
2020-04-22 22:45:03.491 Status: dzVents: Debug: Push to Influx: Device WP COP was changed 10.31
2020-04-22 22:45:03.491 Status: dzVents: Debug: Push to Influx: {["KWH Garage vandaag"]=1587580083, ["WP COP"]=1587588003, ["WP Opgewekt"]=1587588303, ["KWH totaal vandaag"]=1587585607, ["PV Vermogen Sauna"]=1587585604, ["KWH Garage"]=1587389343, ["PV Sauna vandaag"]=1587215107, ["WP Backup Heater"]=1585326248, ["KWH totaal"]=1587389108, ["Vermogen Garage"]=1587580083, ["PV Vermogen Totaal"]=1587585605, ["PV Vermogen Garage"]=1587585604}
2020-04-22 22:45:03.492 Status: dzVents: Debug: Push to Influx: OpenURL: url = http://127.0.0.1:8080/json.htm?type=command¶m=udevice&idx=73&nvalue=0&svalue=10.31
2020-04-22 22:45:03.492 Status: dzVents: Debug: Push to Influx: OpenURL: method = GET
2020-04-22 22:45:03.492 Status: dzVents: Debug: Push to Influx: OpenURL: post data = nil
2020-04-22 22:45:03.493 Status: dzVents: Debug: Push to Influx: OpenURL: headers = nil
2020-04-22 22:45:03.493 Status: dzVents: Debug: Push to Influx: OpenURL: callback = nil
2020-04-22 22:45:03.494 Status: dzVents: Debug: Push to Influx: {["KWH Garage vandaag"]=1587580083, ["WP COP"]=1587588303, ["WP Opgewekt"]=1587588303, ["KWH totaal vandaag"]=1587585607, ["PV Vermogen Sauna"]=1587585604, ["KWH Garage"]=1587389343, ["PV Sauna vandaag"]=1587215107, ["WP Backup Heater"]=1585326248, ["KWH totaal"]=1587389108, ["Vermogen Garage"]=1587580083, ["PV Vermogen Totaal"]=1587585605, ["PV Vermogen Garage"]=1587585604}
2020-04-22 22:45:03.502 Status: dzVents: Info: Push to Influx: ------ Finished Push naar influx
2020-04-22 22:45:03.509 Status: EventSystem: Script event triggered: /home/pi/domoticz/dzVents/runtime/dzVents.lua
2020-04-22 22:45:04.230 Status: dzVents: Info: Push to Influx: ------ Start internal script: Push naar influx: Device: "WP Opgewekt (Dummy)", Index: 64
2020-04-22 22:45:04.232 Status: dzVents: Debug: Push to Influx: Device WP Opgewekt was changed 569.0
2020-04-22 22:45:04.233 Status: dzVents: Debug: Push to Influx: {["PV Sauna vandaag"]=1587215107, ["PV Vermogen Sauna"]=1587585604, ["WP Backup Heater"]=1585326248, ["WP COP"]=1587588303, ["WP Opgewekt"]=1587588303, ["KWH totaal vandaag"]=1587585607, ["PV Vermogen Garage"]=1587585604, ["PV Vermogen Totaal"]=1587585605, ["KWH totaal"]=1587389108, ["KWH Garage"]=1587389343, ["KWH Garage vandaag"]=1587580083, ["Vermogen Garage"]=1587580083}
2020-04-22 22:45:04.233 Status: dzVents: Debug: Push to Influx: Too soon after last update; we don't want an endless loop
2020-04-22 22:45:04.234 Status: dzVents: Debug: Push to Influx: {["PV Sauna vandaag"]=1587215107, ["PV Vermogen Sauna"]=1587585604, ["WP Backup Heater"]=1585326248, ["WP COP"]=1587588303, ["WP Opgewekt"]=1587588303, ["KWH totaal vandaag"]=1587585607, ["PV Vermogen Garage"]=1587585604, ["PV Vermogen Totaal"]=1587585605, ["KWH totaal"]=1587389108, ["KWH Garage"]=1587389343, ["KWH Garage vandaag"]=1587580083, ["Vermogen Garage"]=1587580083}
2020-04-22 22:45:04.236 Status: dzVents: Info: Push to Influx: ------ Finished Push naar influx
2020-04-22 22:45:04.685 Status: dzVents: Info: Push to Influx: ------ Start internal script: Push naar influx: Device: "WP COP (Dummy)", Index: 73
Interesting to see it puts every value twice which explains the error message. But you can see that better.