nordpool icon indicating copy to clipboard operation
nordpool copied to clipboard

precision does not work as expected

Open mct370770 opened this issue 4 years ago • 6 comments

I thought that I could set the precision to "2" to get a more easy readable cost. But setting the precision value to 2 just gets me an "unvailable" for the data.

Do I misunderstand the meaning behind "precision"?

mct370770 avatar Sep 08 '22 16:09 mct370770

Same problem here.

And sometimes the cost is rounded to 1 value after comma, sometimes is displayed with 2 or 3.

Screenshot 2022-09-10 at 11 26 32

vahem2lu avatar Sep 10 '22 09:09 vahem2lu

This uses Python round function. Does any logs show errors? What can you take a screenshot of the State and attributes?

Hellowlol avatar Sep 10 '22 20:09 Hellowlol

If I change the number after “precision:” to anything other than 3 it becomes unavailable like shown in the attached screen shots.

4E5B077D-9D34-450F-8C20-C2B97A738944 B03BB21B-D1EA-44A2-B6BF-95EFF9AF46B1 1DBF4B05-D9BD-4116-AEFD-50DFD70345D0 C6100244-9FEE-4914-8795-0B985BCADA6B D2295C81-760B-48E0-8F62-034C247A2188 F684A3DE-1622-4FEF-A85D-BF0FD6AF2A80

mct370770 avatar Sep 11 '22 08:09 mct370770

I've found error.

When you edit configuration (including precision) your sensor will get a new name. So you will have to edit your dashboard etc accordingly. NB! This means even when you save "low_price_cutoff" to new value, you will get new sensor name!

Please check http://homeassistant.local:8123/config/entities URL to see your new sensor name.

vahem2lu avatar Sep 12 '22 06:09 vahem2lu

Nice work @vahem2lu , thanks for sharing the solution.

mfalkvidd avatar Sep 12 '22 06:09 mfalkvidd

I will make new issue due to rounding errors: https://github.com/custom-components/nordpool/issues/193

The question what comes up is that should the configuration change sensor name when editing configuration?

vahem2lu avatar Sep 12 '22 06:09 vahem2lu