home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.63k stars 30.78k forks source link

0.106: DSMR slimme meter sensor.power_tariff reports 'inverted' tariff (normal / low) #32225

Closed MaVeWeb closed 4 years ago

MaVeWeb commented 4 years ago

The problem

DSMR slimme meter sensor - sensor.power_tariff reports 'inverted' tariff (normal / low). In HA core version 0.105 it worked correctly. During the 'piek uren' sensor.power_tariff state was 'normal' During the 'dal uren' sensor.power_tariff state was 'low'

After the upgrade to 0.106 the states are inverted. During the 'piek uren' sensor.power_tariff state is 'low' During the 'dal uren' sensor.power_tariff state is 'normal'

Environment

Home Assistant core 0.106.0 Running in docker on Synology NAS Last working: 0.105.5

Problem-relevant configuration.yaml

Traceback/Error logs

Additional information

springstan commented 4 years ago

@dupondje could you please take a look at this issue, because it seems to be caused by your PR #30121? Thanks 👍

dupondje commented 4 years ago

Can you share me your dsmr config? I double checked the code, and it seems fine. But share your conf, and I'll look at it :)

MaVeWeb commented 4 years ago
- platform: dsmr
     port: /dev/ttyUSB0
     dsmr_version: 5

  - platform: template
    sensors: 

   tarief:
        value_template: '{%if states.sensor.power_tariff.state == "low"%}Dal{%else%}Piek{%endif%}'
        friendly_name: 'Elektriciteits tarief'

At 21.00 hour I also noticed that the state from sensor.power_tariff changed from LOW to NORMAL. In previous HA versions at 21.00 hour the state went from NORMAL to LOW (which is correct).

dupondje commented 4 years ago

Please test https://github.com/home-assistant/home-assistant/pull/32233 if you can :)

MaVeWeb commented 4 years ago

I really wouldn't mind testing it, however I'm running HA core in Docker on my Synology NAS and I have really no idea were to put the modified sensor.py file from the DSMR component?