qqaatw / JciHitachiHA

A home assistant integration for controlling Jci-Hitachi devices, using LibJciHitachi backend. 台灣日立雲端模組
Apache License 2.0
114 stars 31 forks source link

JciHitachiMonthlyPowerConsumptionSensorEntity is using wrong state class. #46

Closed RiANOl closed 1 year ago

RiANOl commented 1 year ago

Get the warning from logs.

(<class 'custom_components.jcihitachi_tw.sensor.JciHitachiMonthlyPowerConsumptionSensorEntity'>) is using state class 'measurement' which is impossible considering device class ('energy') it is using; expected None or one of 'total_increasing', 'total';

Wondering if there is suitable solution for monthly power comsumption? Maybe it could only return the current month value to avoid month selection?

qqaatw commented 1 year ago

One option is to not use energy device class as the monthly power consumption is not a real-time energy measurement. We accept a PR fixing it.

Edited: if None can be used for the state class then we just use None.

Maybe it could only return the current month value to avoid month selection?

The design for it is to let users check history power consumption like what you can do in the official app, so returning the current month’s value only departs from the design.

qqaatw commented 1 year ago

Hey, would you mind proposing a PR fixing this? otherwise this issue will end up be closed by the stale bot.

We can try specifying None to the state class as the first step.

RiANOl commented 1 year ago

Sounds great. Let me do it.