Virtual Counter missing Units and showing NaN (Not a number) at count value

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

Post Reply
jasjuh
Posts: 2
Joined: Thursday 25 November 2021 13:06
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Virtual Counter missing Units and showing NaN (Not a number) at count value

Post by jasjuh »

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.
img1.JPG
img1.JPG (53.76 KiB) Viewed 1048 times
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.
img2.JPG
img2.JPG (83.81 KiB) Viewed 1048 times
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,
User avatar
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

Post by waltervl »

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
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
User avatar
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

Post by waltervl »

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
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
jasjuh
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

Post by jasjuh »

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.
img3.JPG
img3.JPG (66.53 KiB) Viewed 1038 times
img4.JPG
img4.JPG (44.17 KiB) Viewed 1038 times
User avatar
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

Post by waltervl »

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.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
User avatar
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

Post by waltervl »

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
User avatar
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

Post by waltervl »

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
User avatar
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

Post by waltervl »

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
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest