danielperna84 / hahomematic

Python 3 Interface for Home Assistant to interact with HomeMatic devices
MIT License
130 stars 22 forks source link

HMIP SWO PL sunshineduration overflow and negative duration #1494

Closed l-mb closed 5 months ago

l-mb commented 5 months ago

I agree to the following

The problem

Hi, I have a HMIP SWO PL weather station, and that also exposes sensor.hmip_swo_pl_XXXXXX_sunshineduration_2 which counts the daily minutes of sunshine.

That wraps around at apparently 16xxx (my guess would 16384, a 14 bit field), and then drops to zero.

When using this together with a "rate of change" statistic in HA, there's a day with months of darkness :-)

state_class: total
interface_id: ccu3-webui-HmIP-RF
address: 00xxxxxxxxxx:1
model: HmIP-SWO-PL
entity_type: generic
parameter: SUNSHINEDURATION
function: null
value_state: valid
unit_of_measurement: min
friendly_name: Sunshine Duration

Graph of sunshine duration

Change history graph

I am uncertain whether the right fix is to have a total_increasing instead, or whether the integration should hide this wrap internally to keep going?

What version of HomematicIP (local) has the issue?

1.58.0

What was the last working version of HomematicIP (local)?

n/a

What type of installation are you running?

Home Assistant Container

What type of installation are you running for your homematic backend?

RaspberryMatic Standalone

Which version of your homematic backend are you running?

No response

What hardware are you running for your system?

AMD 64bit

Which config details do you use

Which interfaces do you use?

Diagnostics information (no logs here)

config_entry-homematicip_local-3be70f23a73bd5697928db10f144d573.json

Log file extract. Anything in the logs that might be useful for us? The log (Setting/System/Logs -> load full log) is the best source to support trouble shooting!

No response

Additional information

No response

Baxxy13 commented 5 months ago

I had a similar issue with all ENERGY_COUNTER's (PSM/FSM/BSM) since Version 1.55.0 (2024-02-02). (related change: "Use state_class total instead of total_increasing for sensors")

Discussed here: https://github.com/danielperna84/hahomematic/discussions/1470

As a result i customized all my "COUNTER's" back to "total_increasing" and it's working now without problems like before 1.55.0.

SukramJ commented 5 months ago

Please use HA customize to change the state_class to total_increasing, and report back if it works.