Page 1 of 1

domoticz.devices('myflowrate').value => nil

Posted: Tuesday 05 August 2025 17:07
by MarsaultP
I read the value of a device that is displayed correctly in the interface. Its evolution is updated and visible on the graph.

The value is transmitted by MQTT and I check with MQTT Explorer that the update is normal.
{ "idx" : 19, "nvalue" : 0, "svalue" : "0.0" }

The value is also correctly recorded in the database.

In a script that has been running for a long time, I now discover an error in the logs caused by a reading problem.
I read the value with the instruction:
local debit1 = dz.devices(“Debit compteur Maison”).value
which returns nil

I get the same result using the Idx
local debit1 = dz.devices(19).value

However, with this test:
domoticz.log(domoticz.devices(19).rawData)
I get:
2025-08-05 16:40:00.460 dzVents: template: {‘0.0’}

Another test with Json:
http://192.168.2.50:8080/json.htm?type= ... ces&rid=19
I find:
‘Data’ : ‘0 l/min’,

How can I debug further or what could be the error?

Philippe

Re: domoticz.devices('myflowrate').value => nil  [SOLVED]

Posted: Tuesday 05 August 2025 19:11
by waltervl
In the dzvents wiki there is NO reference of the possibility that a device has the attribute .value!

When you look at the wiki here https://wiki.domoticz.com/DzVents:_next ... #Waterflow
you see that for a water flow device there is an attribute .flow
So use that.... Eg:
local debit1 = dz.devices(“Debit compteur Maison”).flow