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.38k stars 30.64k forks source link

RFlink integration is detecting RFX10METER value as an INT instead of a HEX value. #47434

Closed henkemannen closed 3 years ago

henkemannen commented 3 years ago

The problem

RFlink gateway firmware version 44 changed the representation detected value from INT to hex. R44: (27/10/2016) - Fixed: RFmeter values presented in hexadecimal

The integration in home assistant is still treating this value as an INT and that leads to wrong value is read. When reading is containing hex-characters the reading is discarded and warning messages appears in the log.

What needs to be changed? Integration: rflink gateway File: rflink/parser.py Line: 233 Function:

VALUE_TRANSLATION = cast(
    Dict[str, Callable[[str], str]],
    {
        ...

        "meter": int,  #Needs to be changed to =>  lambda hex: int(hex, 16),
        ...
    },
)

The "INT" need to be changed to "lambda hex: int(hex, 16)" otherwise the sensor-type meter will not receive correct values.

What is version of Home Assistant Core has the issue?

core-2021.2.3

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

Integration causing the issue

RFLink

Link to integration documentation on our website

https://www.home-assistant.io/integrations/sensor.rflink/

Example YAML snippet

# Put your YAML below this line

Anything in the logs that might be useful for us?

When error occurs for RFLink: 
Could not convert attr 'meter' value to expected type 'int'

I have verified that the propsed change is working fine in my environment

probot-home-assistant[bot] commented 3 years ago

rflink documentation rflink source (message by IssueLinks)

javicalle commented 3 years ago

Hi henkemannen, what you are proposing is a change in the RFLink library. Changes in the library must be requested in the repository which is:

To facilitate the analysis of the change, I recommend that you include the information of the device you are using and a complete trace of the signal. You can put logs to debug level for rflink:

logger:
  default: warning
  logs:
    rflink: debug
    homeassistant.components.rflink: debug

Be sure to raise the logs level after getting the logs because rflink can be very verbose.

javicalle commented 3 years ago

It seems that this bug has been already reported:

henkemannen commented 3 years ago

OK, seesm to be the same issue.

/Henrik

Den fre 5 mars 2021 kl 10:48 skrev javicalle notifications@github.com:

It seems that this bug has been already reported:

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/home-assistant/core/issues/47434#issuecomment-791305044, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALGSDPZXBAIUWWCPUGS5CY3TCCSG7ANCNFSM4YUVAQMA .

github-actions[bot] commented 3 years ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.