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
domoticz.devices('myflowrate').value => nil [SOLVED]
Moderator: leecollings
- waltervl
- Posts: 6028
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2025.1
- Location: NL
- Contact:
Re: domoticz.devices('myflowrate').value => nil [SOLVED]
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
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
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Who is online
Users browsing this forum: No registered users and 1 guest