Hello Users,
I have a bug which I am unable to fix in domoticz.
In the virtual sensor department I have created a standard counter.
Under the report functionality it is showing NaN and a question mark instead of the units.
I have tried to update the counter using DsVents and Lua, but in both options the result is the same.
The log functionality itself is operating without any troubles.
DSVents commando's to update the counter with a user variable:
local CounterToUpdate = domoticz.devices('TestCounter')
vDeviceWaarde = tonumber(domoticz.variables('Stiebel_Bedrijfsuren').value)
CounterToUpdate.updateCounter(vDeviceWaarde)
What should I do to repair this issue? Hope you guy's could help me.
Br,
Virtual Counter missing Units and showing NaN (Not a number) at count value
Moderator: leecollings
- waltervl
- Posts: 5907
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2024.7
- Location: NL
- Contact:
Re: Virtual Counter missing Units and showing NaN (Not a number) at count value
What do you expected to see?
You have to sent every day or hour or 5 minutes or pick your time schedule the value vDeviceWaarde to the counter. Than you get a overview of counter values per day/week/month/year etc.
The vDeviceWaarde (bedrijfsuren) should rise during time. Unless the device is not used
Now you have only send 1 time a value. That is not what this counter is designed for that is why it behaves differently.
And the first time you start with a big value because you start with 4206 hrs. That will show differently as time will go by.
So next time you send for example
day 2 value 4207
day 3 value 4210
day 4 value 4220
day 5 value 4224
etc
And you will see in Domoticz usage
day 1 usage 1
day 2 usage 3
day 4 usage 10
day 5 usage 4
etc
You have to sent every day or hour or 5 minutes or pick your time schedule the value vDeviceWaarde to the counter. Than you get a overview of counter values per day/week/month/year etc.
The vDeviceWaarde (bedrijfsuren) should rise during time. Unless the device is not used

Now you have only send 1 time a value. That is not what this counter is designed for that is why it behaves differently.
And the first time you start with a big value because you start with 4206 hrs. That will show differently as time will go by.
So next time you send for example
day 2 value 4207
day 3 value 4210
day 4 value 4220
day 5 value 4224
etc
And you will see in Domoticz usage
day 1 usage 1
day 2 usage 3
day 4 usage 10
day 5 usage 4
etc
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
- waltervl
- Posts: 5907
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2024.7
- Location: NL
- Contact:
Re: Virtual Counter missing Units and showing NaN (Not a number) at count value
Additional:
Make a screenshot of your device when clicked on Edit button.
You have to fill in something with Value Units, eg "hours".
https://www.domoticz.com/wiki/Dummy_for ... es#Counter
Make a screenshot of your device when clicked on Edit button.
You have to fill in something with Value Units, eg "hours".
https://www.domoticz.com/wiki/Dummy_for ... es#Counter
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
-
- Posts: 2
- Joined: Thursday 25 November 2021 13:06
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Virtual Counter missing Units and showing NaN (Not a number) at count value
Hi Waltervl,
The counter itself is working fine. Under the log functionality you can see them updating every hour/day etc etc. No problem at all.
The problem is visible when you press the report button and see monthly/yearly values. Then the counter value suddenly has 3 decimals, NaN (Not a number) values, and a ? (Question mark), instead of the units you have defined in the edit menu.
It seems not to recognise the total counter value, cause total usage is yearly summed up.
The counter itself is working fine. Under the log functionality you can see them updating every hour/day etc etc. No problem at all.
The problem is visible when you press the report button and see monthly/yearly values. Then the counter value suddenly has 3 decimals, NaN (Not a number) values, and a ? (Question mark), instead of the units you have defined in the edit menu.
It seems not to recognise the total counter value, cause total usage is yearly summed up.
- waltervl
- Posts: 5907
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2024.7
- Location: NL
- Contact:
Re: Virtual Counter missing Units and showing NaN (Not a number) at count value
Yes, I can reproduce that behavior on my test system.
The question marks also show up on when setting the counter to energy, gas or water. So its seems a bug.
The question marks also show up on when setting the counter to energy, gas or water. So its seems a bug.
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
- waltervl
- Posts: 5907
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2024.7
- Location: NL
- Contact:
Re: Virtual Counter missing Units and showing NaN (Not a number) at count value
mentioned it in an already running github issue https://github.com/domoticz/domoticz/is ... -979329160
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
- waltervl
- Posts: 5907
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2024.7
- Location: NL
- Contact:
Re: Virtual Counter missing Units and showing NaN (Not a number) at count value
New issue created so it can be better tracked: https://github.com/domoticz/domoticz/issues/5101
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
- waltervl
- Posts: 5907
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2024.7
- Location: NL
- Contact:
Re: Virtual Counter missing Units and showing NaN (Not a number) at count value
Issue is solved, a proper report for this Counter type is available in beta build 14188 (after clearing your cache!)
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