return {
on = { timer = { "every 1 minutes" }}, -- Change to your liking to 1,2,3,4,5,6,10,12,15 or 20
logging =
{
level = domoticz.LOG_DEBUG, -- Change to LOG_DEBUG to debug / Change to LOG_ERROR if script is running properly
marker = scriptVar,
},
execute = function(dz, item)
local StroomOpname = dz.devices(2524)
local VermogenL1 = dz.devices(423)
local VoltageL1 = dz.devices(422)
local Predicted_Maxrange = ((VermogenL1 / VoltageL1))
domoticz.log('--- Stroom opnamee------------------')
domoticz.log(StroomOpname)
domoticz.log('----------------------')
end
}
I would like to calculate the amperage on group L1 but I get the following error message:
2021-01-01 20:07:00.552 Status: dzVents: Info: ------ Start internal script: Script #1:, trigger: "every 1 minutes"
2021-01-01 20:07:00.571 Status: dzVents: Debug: Processing device-adapter for Stroom L1: 1-phase Ampere device adapter
2021-01-01 20:07:00.572 Status: dzVents: Debug: Processing device-adapter for Electriciteits verbruik L1: Electric usage device adapter
2021-01-01 20:07:00.574 Status: dzVents: Debug: Processing device-adapter for Voltage: Voltage device adapter
2021-01-01 20:07:00.574 Status: dzVents: Info: ------ Finished Script #1
2021-01-01 20:07:00.574 Error: dzVents: Error: (3.0.2) An error occurred when calling event handler Script #1
2021-01-01 20:07:00.574 Error: dzVents: Error: (3.0.2) ...domoticz/scripts/dzVents/generated_scripts/Script #1.lua:17: attempt to perform arithmetic on a table value (local 'VermogenL1')
return {
on = { timer = { "every 1 minutes" }}, -- Change to your liking to 1,2,3,4,5,6,10,12,15 or 20
logging =
{
level = domoticz.LOG_DEBUG, -- Change to LOG_DEBUG to debug / Change to LOG_ERROR if script is running properly
marker = 'Amperage',
},
execute = function(dz)
local StroomOpname = dz.devices(2524)
local VermogenL1 = dz.devices(423).actualWatt
local VoltageL1 = dz.devices(422).voltage
local Predicted_Maxrange = ((VermogenL1 / VoltageL1))
dz.log('--- Stroom opname------------------')
dz.log(StroomOpname)
dz.log('----------------------')
end
}
list] 2021-01-02 13:59:00.168 Status: dzVents: Info: Amperage: ------ Start internal script: Script #1:, trigger: "every 1 minutes"
2021-01-02 13:59:00.188 Status: dzVents: Debug: Amperage: Processing device-adapter for Stroom L1: 1-phase Ampere device adapter
2021-01-02 13:59:00.189 Status: dzVents: Debug: Amperage: Processing device-adapter for Electriciteits verbruik L1: Electric usage device adapter
2021-01-02 13:59:00.190 Status: dzVents: Debug: Amperage: Processing device-adapter for Voltage: Voltage device adapter
2021-01-02 13:59:00.190 Status: dzVents: Info: Amperage: --- Stroom opname------------------
2021-01-02 13:59:00.191 Status: dzVents: Debug: Amperage: OpenURL: url = http://127.0.0.1:8088/json.htm?type=command¶m=udevice&idx=2524&nvalue=0&svalue=
2021-01-02 13:59:00.191 Status: dzVents: Debug: Amperage: OpenURL: method = GET
2021-01-02 13:59:00.191 Status: dzVents: Debug: Amperage: OpenURL: post data = nil
2021-01-02 13:59:00.191 Status: dzVents: Debug: Amperage: OpenURL: headers = nil
2021-01-02 13:59:00.191 Status: dzVents: Debug: Amperage: OpenURL: callback = nil
2021-01-02 13:59:00.192 Status: dzVents: Info: Amperage: ------ Finished Script #1
2021-01-02 13:59:00.193 Status: EventSystem: Script event triggered: /home/pi/domoticz/dzVents/runtime/dzVents.lua
2021-01-02 13:59:00.191 Error: dzVents: Error: (3.0.2) Amperage: Method setKelvin is not available for device "Stroom L1" (deviceType=General, deviceSubType=Current). If you believe this is not correct, please report.
2021-01-02 13:59:00.191 Error: dzVents: Error: (3.0.2) Amperage: Method play is not available for device "Stroom L1" (deviceType=General, deviceSubType=Current). If you believe this is not correct, please report.
2021-01-02 13:59:00.191 Error: dzVents: Error: (3.0.2) Amperage: Method kodiPlayPlaylist is not available for device "Stroom L1" (deviceType=General, deviceSubType=Current). If you believe this is not correct, please report.
2021-01-02 13:59:00.191 Error: dzVents: Error: (3.0.2) Amperage: Method kodiPause is not available for device "Stroom L1" (deviceType=General, deviceSubType=Current). If you believe this is not correct, please report.
2021-01-02 13:59:00.191 Error: dzVents: Error: (3.0.2) Amperage: Method updateTempBaro is not available for device "Stroom L1" (deviceType=General, deviceSubType=Current). If you believe this is not correct, please report.
2021-01-02 13:59:00.191 Error: dzVents: Error: (3.0.2) Amperage: Method updateAlertSensor is not available for device "Stroom L1" (deviceType=General, deviceSubType=Current). If you believe this is not correct, please report.
2021-01-02 13:59:00.191 Error: dzVents: Error: (3.0.2) Amperage: Method updateDistance is not available for device "Stroom L1" (deviceType=General, deviceSubType=Current). If you believe this is not correct, please report.
2021-01-02 13:59:00.191 Error: dzVents: Error: (3.0.2) Amperage: Method onkyoEISCPCommand is not available for device "Stroom L1" (deviceType=General, deviceSubType=Current). If you believe this is not correct, please report.
2021-01-02 13:59:00.191 Error: dzVents: Error: (3.0.2) Amperage: No value given for 'withinXXX' command
2021-01-02 13:59:00.191 Error: dzVents: Error: (3.0.2) Amperage: An error occurred when calling event handler Script #1
2021-01-02 13:59:00.191 Error: dzVents: Error: (3.0.2) Amperage: /home/pi/domoticz/dzVents/runtime/TimedCommand.lua:195: attempt to perform arithmetic on a nil value (local 'value') [/list]