claudegel / sinope-130

Neviweb130 custom component for Home Assistant to manage devices connected via a GT130 and wifi devices from Sinopé
GNU General Public License v3.0
73 stars 15 forks source link

TH1124WF Missing Power/Energy #184

Closed rj45jack closed 11 months ago

rj45jack commented 11 months ago

I'm unable to find or see the power/energy usage of the TH1124WF within HA. This worked last winter AFAIK. The climate function works as intended, I am able to utilize the heat and set temps.

Using dev-tools template editor:

template:
  - sensor:
      - name: "Basement energy usage"
        unit_of_measurement: "kWh"
        device_class: energy
        state_class: total
        state: >-
          {{ state_attr("climate.neviweb130_climate_thermostat","hourly_kwh") }}

Reports nothing. Not sure what happened. I reinstalled, double checked the above code and read the documentation.

Here is my config yaml snippet:

neviweb130:
  username: "x"
  password: "x"
  scan_interval: 360
  homekit_mode: False  
claudegel commented 11 months ago

can you edit neviweb130 locally ? We need to activate the logging for energy stat In conffiguration.yaml add this

logger:
  default: warning
  logs:
    homeassistant.custom_components: debug
    custom_components.neviweb130: debug

then if you can, edit custom_components/neviweb130/climate.py on line 1102 just remove the # at the biginning and restart HA. This will show what we receive from neviweb for energy stats. Please also check in home-assistant.log for any line with [custom_components.neviweb130.climate]... that contain an error message like {'error': {'code':... Post what you find here

claudegel commented 11 months ago

I think that Sinopé is shaking there code and it prevent energy stat to be received by HA. In my log I have this [custom_components.neviweb130.climate] Got None for device_daily_stats [custom_components.neviweb130.climate] Got None for device_monthly_stats statistic are not available or they change the way to get them. I'll dig a little

rj45jack commented 11 months ago

I'm away right now. But I just checked my HA and the stats are back now...very odd. I'm unable to see any errors either.

claudegel commented 11 months ago

I've check on Neviweb and energy stat is provided correctly. I don't have a TH1124ZB but I've checked for TH1300ZB and TH1124ZB-G2 everything look good so I suspect that Sinopé was making changes in Neviweb and stop the stats reporting. Feel free to reopen this issue if it happen again. I'm adding better logging on my neviweb130 so if it happen again I'll try to catch it and send a persistent notification on the UI.