Page 1 of 1

CounterDelivToday no return value?

Posted: Saturday 30 January 2021 23:20
by Kranendijk
Hi all,

Domoticz time lately :D

All counters are working - but one it seems. I have a simple script to get the “CounterDelivToday” from my smart meter which is called “verbruik” to transfer the value of “CounterDelivToday” to a custom sensor called “StroomPanelenVandaag” to be shown on my dashticz v3 dashboard. The wife really loves it!

However it seems not to be filled, what’s wrong as I use the exact same mechanism for gas and electricity consumption??
Spoiler: show
--Voor Dashticz overal custom sensor van maken
return {
on = { timer = {'every 5 minutes'}},
logging = {level = domoticz.LOG_DEBUG, -- LOG_DEBUG, set to LOG_ERROR when script works as expected
},
execute = function(domoticz)
local STROOMPANELEN = domoticz.devices('Verbruik').CounterDelivToday
domoticz.devices('StroomPanelenVandaag').updateCustomSensor(STROOMPANELEN)
end
}
And a part of the json result:
Spoiler: show
"AddjMulti" : 1.0,
"AddjMulti2" : 1.0,
"AddjValue" : 0.0,
"AddjValue2" : 0.0,
"BatteryLevel" : 255,
"Counter" : "6081.569",
"CounterDeliv" : "1738.629",
"CounterDelivToday" : "0.284 kWh",
"CounterToday" : "14.969 kWh",
"CustomImage" : 0,
"Data" : "3113308;2968261;522264;1216365;296;0",
"Description" : "",
"Favorite" : 0,
"HardwareID" : 2,
"HardwareName" : "Slimme meter",
"HardwareType" : "P1 Smart Meter USB",
"HardwareTypeVal" : 4,
"HaveTimeout" : false,
"ID" : "0001",
"LastUpdate" : "2021-01-30 23:17:08",
"Name" : "Verbruik",
"Notifications" : "false",

Re: CounterDelivToday no return value?

Posted: Saturday 30 January 2021 23:31
by waaren
Kranendijk wrote: Saturday 30 January 2021 23:20 local STROOMPANELEN = domoticz.devices('Verbruik').CounterDelivToday
The JSON key names do not have a one to one relation with dzVents attributes (names).
You can find the dzVents attribute names for a P1 type device in the dzVents wiki. For this value you will have to use the counterDeliveredToday attribute

Re: CounterDelivToday no return value?  [Solved]

Posted: Saturday 30 January 2021 23:43
by Kranendijk
Hahaha I used one of your dump scripts on the forum to check what is in the “Verbruik” device. I used CounterDeliveredToday which gave me no results... reading your post well, it should not be a capital C.

That was the trick. Easy peasy,

Getting the hang of it.