The only way is to select each entity and rename the entity id. The self configured entity id is as real as it gets.
The library cannot distinguish between the two as the code you have is shared among a number of devices. You can rename the entities to anything you like. In case of a doorbell, if you want to use it in an automation, the binary sensor will get you what you want. You can build your automation on the state event fires by it.
If you use the following config you can keep using the same names. I need this since I am using Node-Red and renaming is a lot of work.
rfxtrx:
device: /dev/serial/by-id/usb-RFXCOM_RFXtrx433_A12U574-if00-port0
debug: True
devices:
09130073238c06019d50:
# name: motion_binnen_woonkamer_10
device_class: motion
off_delay:
seconds: 5
binary_sensor:
- platform: template
sensors:
motion_binnen_woonkamer_10:
value_template: "{{ states['binary_sensor.pt2262_238c06'].state }}"
device_class: motion
You will find the 238c06 name in the log-file:
2020-09-27 22:00:21 DEBUG (MainThread) [homeassistant.components.rfxtrx] Receive RFXCOM event: {âpacket_typeâ: 19, âsub_typeâ: 0, âtype_stringâ: âPT2262â, âid_stringâ: â238c06â, âdataâ: â0913000e238c06019e50â, âvaluesâ: {
2020-09-27 22:00:21 DEBUG (MainThread) [homeassistant.components.rfxtrx.binary_sensor] Binary sensor update (Device ID: 238c06 Class: LightingDevice Sub: 0)
I wanted to share some hints after the the worst upgrade experience so far with my 165 rfxtrx entitites. Maybe it can help some others like me that downgraded at first and waited until having enough time to do the upgrade. Donât take this wrong; Iâm really happy with home assistant!
If you are still waiting to upgrade you could push your luck and wait for https://github.com/home-assistant/core/pull/38317 (apparently cancelled) to be merged. To avoid clicking through endless web dialogs mapping your entity names again.
Anyhow, after the update to 0.113+ you will need to move your rfxtrx configuration into configuration.yaml according to https://www.home-assistant.io/integrations/rfxtrx/ You can also do like I did and place the rfxtrx config in a separate file included using ârfxtrx: !include rfxtrx.yamlâ in configuration.yaml
If you have a lot of entities it can be useful to add them deactivated by turning off that setting in the system config found in the three dot menu of the rfxtrx integration. Then move your configuration for switches/lights/sensors into into the devices section of the rfxrtx section commenting names in the process. My included rfxtrx.yaml starts like this:
device: /dev/ttyUSB0
#debug: True
#automatic_add: True
devices:
# Temperature sensors
"0a52090ed70000d1370159":
# name: Sovrum
"08500706d800006159":
# name: Sovrum Ute
...
After restarting home assistant you can then use the rfxtrx integration to reach the devices. Then use the hex codes in the device name to find the matching entries in your device section and grab the old (now commented) name and use this when clicking the device to find the corresponding entities. Then open those entities that you actually want to see and rename, set id, enable entity and click update. There may be a simpler way, but this was what I did. (It would have been really nice if the the id was updated from the name to avoid having to fill in both.)
There can also be some fiddling with dimmable lights now being switches and vice versa. You will need to do some bitflipping in the id:s to solve this, for example I transformed the light â0b11002400055efa01020d60â to â0b11002400055efa01010f60â to get a switch instead. I looked at the similar switches I had and with guesswork I succeeded. I think you can also re-register you device again using the dimming possibilities instead of on/off to get a dimmable light. See Rfxtrx lights are recognized as switches in 0.113
I also had an issue with event âbutton_pressedâ not being triggered anymore for my rfxtrx remotes. I moved to the âstate_changedâ event which nowadays seems being triggered on pressed buttons even if they do not change states (thank you) so this regexp automation seems to work now (after also adding .new_state):
- alias: Belysning fjärrisar
initial_state: 'on'
trigger:
- platform: event
event_type: state_changed
condition:
condition: template
value_template: "{{ trigger.event.data.entity_id | regex_match('switch.fjarr') }}"
action:
- service_template: >
{% if trigger.event.data.new_state.state == "on" %}
homeassistant.turn_on
{% else %}
homeassistant.turn_off
{% endif %}
data_template:
entity_id: >
{% if trigger.event.data.entity_id | regex_match('switch.fjarr_._1_') %}
group.belysning_dag
{% elif trigger.event.data.entity_id | regex_match('switch.fjarr_._2_') %}
group.belysning_sovrum
{% else %}
group.belysning_ute
{% endif %}
Iâm a bit sad with the general home assistant movement towards clicking around in web interfaces as the only way to manage your configuration. The yaml files in a git repo was a very robust solution for configuration handling. And to be able to share your configuration with other home assistant users was extremely useful. I understand wanting to reach a broader audience but I just wished that it could be more compatible with the old solution.
The diff of my update can be found here if it can help anyone doing the upgrade:
(Excluding the renaming changes performed in the web interface dialogs of course.)
Your post was flagged as inappropriate : the community feels it is offensive, abusive, or a violation of our community guidelines.
Looks like I hurt someones feelings there, oh well
The good thing about open source is that you can take the source of, say an integration, rewrite it and remove all the dumbed down nonsense, turning it back into something viable for power users who like to have full control over their entities, rather than having some obscure automatic system decide for them. Yes, I will have to maintain it for coming HA changes, but hey, if thatâs the price I have to pay to not have half of my house break from some erratic update (RFXCom controlled devices play a very important role in my setup), then so be it.
The great thing about this, is that you get to discover how to develop for HA. The rfxtrx integration is actually a good candidate, as it is a pretty simple integration.
Sorry to say or ask, but Iâm still lost what to do, does anyone have a clear explanation how to get RFXtrx working again, last time I reverted back to 0.112 but now I really want to fix the few RFXtrx entries I have so I finally can stay on 0.116.
After updating to 0.116.3 I get the following error in HA:
This is what I have in configuration.yaml:
# RFXCOM (3)
rfxtrx:
device: /dev/serial/by-id/usb-RFXCOM_RFXtrx433_A11I6V7C-if00-port0
switch (3):
- platform: rfxtrx
automatic_add: True
devices:
0b1100000211a21a01010f80:
name: Scentsy TV
fire_event: True
0b1100010211a21a02010f70:
name: Scentsy Keuken
fire_event: True
0b1100020211a21a03010f70:
name: Scentsy Slaapkamer Ouders
fire_event: True
0b11000100a71a6a01010f70:
name: Vitrinekast
fire_event: True
0b11000200a71a6a02010f70:
name: Kerstboom
fire_event: True
0b11000300a71a6a03010f70:
name: ClickGrow
fire_event: True
This is what I have in automations.yaml:
- id: '1594719666151'
alias: Vitrinekastverlichting aan fri-sat-sun 10:00
description: ''
trigger:
- at: '10:00'
platform: time
condition:
- condition: time
weekday:
- fri
- sat
- sun
action:
- data: {}
entity_id: switch.vitrinekast
service: switch.turn_on
- id: '1594930264273'
alias: Vitrinekastverlichting uit fri-sat-sun 23:30
description: ''
trigger:
- at: '23:30'
platform: time
condition:
- condition: time
weekday:
- fri
- sat
- sun
action:
- data: {}
entity_id: switch.vitrinekast
service: switch.turn_off
- id: '1594931035164'
alias: Scentsy Slaapkamer Ouders aan dagelijks om 21:15
description: ''
trigger:
- at: '19:30:00'
platform: time
condition: []
action:
- data: {}
entity_id: switch.scentsy_slaapkamer_ouders
service: switch.turn_on
- id: '1594931228049'
alias: Scentsy Slaapkamer Ouders uit dagelijks om 22:30
description: ''
trigger:
- at: '22:30:00'
platform: time
condition: []
action:
- data: {}
entity_id: switch.scentsy_slaapkamer_ouders
service: switch.turn_off
Anyone? Thanks in advance =)
Br,
Melvin
Try the following. The name
key doesnât work anymore, you have to change the names in the UI.
rfxtrx:
device: /dev/serial/by-id/usb-RFXCOM_RFXtrx433_A11I6V7C-if00-port0
automatic_add: True
devices:
0b1100000211a21a01010f80:
#name: Scentsy TV
fire_event: True
0b1100010211a21a02010f70:
#name: Scentsy Keuken
fire_event: True
0b1100020211a21a03010f70:
#name: Scentsy Slaapkamer Ouders
fire_event: True
0b11000100a71a6a01010f70:
#name: Vitrinekast
fire_event: True
0b11000200a71a6a02010f70:
#name: Kerstboom
fire_event: True
0b11000300a71a6a03010f70:
#name: ClickGrow
fire_event: True
Perfect, thanks Rob! That did it for me and got it back working now =)
Steps taken:
- Changed the rfxtrx part in configuration.yaml as in your example.
- Under Entities find the RFXtrx devices ==> test to see what is what and add a friendly name.
- In LoveLace edit the Lights section and change the entity to the new switch.ac_0*****a_*
Et voilĂ ;
For the automations; changed the actions in YAML and edit to the new switch.ac_0*****a_1
Thanks again,
Br,
Melvin