Skip to content

Fix aliases support for RFLink sensors#17190

Merged
balloob merged 1 commit intohome-assistant:devfrom
emontnemery:rflink_sensor_fix_alias
Oct 7, 2018
Merged

Fix aliases support for RFLink sensors#17190
balloob merged 1 commit intohome-assistant:devfrom
emontnemery:rflink_sensor_fix_alias

Conversation

@emontnemery
Copy link
Copy Markdown
Contributor

Description:

Fix aliases support for RFLink sensors

Related issue (if applicable): fixes #16790 and fixes #16703

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass

@ghost ghost added the in progress label Oct 6, 2018
@javicalle
Copy link
Copy Markdown
Contributor

Thanks for the PR.

@balloob balloob merged commit 1d7d82f into home-assistant:dev Oct 7, 2018
@ghost ghost removed the in progress label Oct 7, 2018
Copy link
Copy Markdown
Member

@MartinHjelmare MartinHjelmare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the tuya component for how to use our dispatch helper.

if aliases:
for _id in aliases:
hass.data[DATA_ENTITY_LOOKUP][
EVENT_KEY_SENSOR][_id].append(device)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be refactored to use our dispatch helper instead. We should not store entities in a shared dictionary in hass.data. Entities should only be accessed directly from within their own platform.

@emontnemery emontnemery deleted the rflink_sensor_fix_alias branch October 12, 2018 13:10
@balloob balloob mentioned this pull request Oct 26, 2018
@akasma74
Copy link
Copy Markdown
Contributor

@emontnemery & @javicalle Guys, as I can see you are more or less familiar with rflink component, and I' like to ask for some info/help. I run Hass.io 0.83.2 on RPi3 with Arduino Mega flashed with RFLink V1.1 R48

  1. I want to create automation that checks that all my key rflink temperature sensors send data at least once every 5 minutes.
    The problem is I cannot rely upon the sensors' last_updated/last_changed attributes as apparently they are changed only when a different data arrives.
    My question is how can get that information, how to listen to 'raw' messages from rflink component?
  2. When I recharge batteries and put them back in sensors, some of them remain Unknown in HA GUI. I can see that’s because rflink component picks them under a different name, for example oregonv1_000c_temp instead of oregonv1_0002_temp. So far I ended up adding alternative names as aliases, but it’s marked deprecated on the documentation and I don’t know another way to fix the issue.
  3. There is no "friendly_name" attributes for all rflink sensors, and it's a bit inconvenient - does it make sense to file a feature request, or there are any reasons against it?

Sorry for posting my questions here as was unable to get help [elsewhere](url
https://community.home-assistant.io/t/rflink-sensor-aliases-attribute-is-marked-as-deprecated-but-whats-alternative/92676/2)

@MartinHjelmare
Copy link
Copy Markdown
Member

Please open an issue if you suspect a bug. If you need help please use our help channels:
https://home-assistant.io/help/#communication-channels

Merged PRs should not be used for support or bug reports. Thanks!

@home-assistant home-assistant locked as resolved and limited conversation to collaborators Jan 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RFLink sensor not initializating aliases part Problem with RFLink sensors and aliases

6 participants