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

RFXTRX Changes in 0.113.0 - Migration Process Issues & Light type devices no longer seem supported #38191

Closed HarmlessSaucer closed 3 years ago

HarmlessSaucer commented 4 years ago

The problem

Previously, RFXTRX devices were added to the configuration like this example from a lights.yaml file:

platform: rfxtrx
automatic_add: True
devices:
  0a14000101f20302010080:
    name: Dining Room Light
  0a14000000f20302010080:
    name: Livingroom Light
  0a14000202f20302010080:
    name: Bedroom Light
  0a14000104f20302010080:
    name: "Isabellas Bedroom Light"

This meant that you could name RFXTRX devices in the yaml, which I can understand changing to the UI. However, with the changes to RFXTRX in 0.113.0, the required 'migration', that users have to follow is to:

The other problem is that this brings in all of the devices as switch.<entity_id>.
Previously you could have RFXTRX lights. Them now only being switches means that obviously you can't have dimming which is a big part of the use case for RFXTRX lights for me.

I tried to add this using device_class: but 'light' isn't a valid option for this:

rfxtrx:
  device: !secret rfxtrx_device
  debug: True
  automatic_add: True
  devices:
    #Lights
    #Dining Room Light
    0a14000101f20302010080:
    device_class: light

Environment

Problem-relevant configuration.yaml

rfxtrx:
  device: !secret rfxtrx_device
  debug: True
  automatic_add: True
  devices:
    #Lights
    #Dining Room Light
    0a14000101f20302010080:

    #Livingroom Light
    0a14000000f20302010080:

    #Bedroom Light
    0a14000202f20302010080:

Traceback/Error logs

Additional information

I feel that the documentation on: https://www.home-assistant.io/integrations/rfxtrx/ could do with a re-write to reflect the changes in 0.113.0 I'll happily submit some changes for this seperately.

repiuk commented 4 years ago

I think I tried that, will give it another try. I have restored my old 112 on another NUC and luckily I had another rfxtrx around. If I toggle that AMP device in 0.112 I see in 0.113 two devices: AC 03f4c36:11 AC 03f4c36:12 one for off and one for on I guess

elupus commented 4 years ago

No. Only one device for each switch. If you see two, you pressed two different buttons.

repiuk commented 4 years ago

I can only use a second 0.112 setup and toggle the switch in lovelace. That results in two devices in 0.113. Other AC switches have the same problem

elupus commented 4 years ago

Just grab the config from your old instance instead. Just move the config from the platforms to the rfxtrx: devices:

repiuk commented 4 years ago

This is what I have:

rfxtrx:
  device: /dev/serial/by-id/usb-RFXCOM_RFXtrx433_A13DTNG-if00-port0
  automatic_add: true
  devices:
    # Amp
    "0710017544030170":
repiuk commented 4 years ago

In 0.112 it was:

switch:

elupus commented 4 years ago

Looks correct. That should give you a switch entity. I'd turn off automatic add since you already have your device codes.

repiuk commented 4 years ago

Yes indeed It's called ARC D3. I overlooked that. Thanks

elupus commented 4 years ago

Now just rename the device to something your remeber, and change the entity id to whatever it was named before so your GUI and automations work.

repiuk commented 4 years ago

Yes that works. I see the logic now! In the doc page the log files are mentioned to spot activity when automatic add enabled. Which log? I don't see any similar activity like mentioned in the doc page in my logs.

elupus commented 4 years ago

You'd have to turn on debug logs to see it there. But you don't really need to. The event code is available on the entities as an attribute. Probably should remove that from docs.

Just realised we should add a notification for added devices when automatic add is turned on. But all this will get easier once we got the GUI config in place.

repiuk commented 4 years ago

Enabled debug log for rfxtrx. That's handy. I wouldn't remove it from docs yet, for now I can see something. If I'm correct: I must change the entity id if I want to use the device with automatic add disabled. Slowly recovering app 30 devices, thanks for your help

elupus commented 4 years ago

You don't need to change entity id or name to use it. But it's better to do, to mach your old name since then you don't need to change anything else.

You need it in your configuration file for it to be available without automatic add.

repiuk commented 4 years ago

Ok that explains what I found. That would be the event code displayed in the GUI?

KaVo194 commented 4 years ago

My Somfy shutters stopped working after upgrading from 0.112.4 to 0.113.3, Config is simple: - platform: rfxtrx automatic_add: False devices: 071a000001020502: # RFY name: Haus 071a000001020500: # RFY name: Oben 071a000001020501: # RFY name: Unten Logfile shows Logger: homeassistant.components.cover Source: helpers/entity_platform.py:110 Integration: Abdeckung (documentation, issues) First occurred: 15:13:04 (1 occurrences) Last logged: 15:13:04 The rfxtrx platform for the cover integration does not support platform setup. Please remove it from your config.

Not sure if this is related to this issue but it was the only RFXTRX issue which I found.

elupus commented 4 years ago

@KaVo194 just move the config to rfxtrx: devices: and skip the name.

MartinHjelmare commented 4 years ago

Before posting here, please read the documentation for rfxtrx and look at your current configuration yaml and compare that with the examples in the docs. If you have a platform entry for rfxtrx in your configuration yaml, you need to update the configuration according to the docs.

Our issue tracker is not meant as a help message board. It's for tracking issues with the current code or documentation. If you need help, please use our help channels: https://www.home-assistant.io/help/#communication-channels

KaVo194 commented 4 years ago

@MartinHjelmare Sorry. It would have been much easier if skipping -platform configs for RFXTRX devices was documented as a breaking change.

repiuk commented 4 years ago

The docs mention: To convert a switch to a dimmable light, make sure the event contain a dimming command. You can usually convert a command by changing one byte.

ARC: 0b11000248bc0cfe09 01 0f70 0b11000248bc0cfe09 02 0f70

It doesn't mention where to change this byte. I added my dimmer with a remote dim command and it was added as a device with a light and switch property. After a restart only the switch part works. The light is unavailable (grey)

repiuk commented 4 years ago

Ok solved: I moved the event code (0b11000a00553ff208000070:) in configuration and added the dimmer with a dimming command. That worked until a restart. Changed the event code to 0b11000a00553ff208020070: and the dimmer function was back. Simply moving the event codes isn't enough for bad readers like myself :)

repiuk commented 4 years ago

After spending many hours migrating all my devices I start to understand how it works and I kinda like it so far. A few (wild) ideas for a future GUI:

dkroiss38 commented 4 years ago

I successfully migrated to the new rfxtrx implementation, and have now my controls back. I do have several X10 shutters and dimmable lamps and searching through the web I understood that the rfxtrx interface does not allow preset dims to these devices. But the interface allows specific dim and bright commands that I can launch from the rfxmgn. Unfortunately I can't figure out if this is supported by home assistant. Tried to replace the 00 or 01 (off or on) with 02 or 03 (dim or bright) but nothing changes in the interface? Is this supported? And how should I define this in the configuration.yaml file? Thanks

Cardy165 commented 4 years ago

I have also been trying to migrate all my rfx devices and as others have pointed out if you know the code for your device trying to match that to which device it is in the UI is a royal pain.

I did wonder if you could add the code added in the config file as an attribute of the device or one of its entities something like "configuration_code: " where is the code in the yaml file. This would at least easily let you find and match up devices you know.

Xa4-J commented 4 years ago

I still don't see the point in why this had to be changed. Had started to change it but already ran into the problem that I could not store platform: template anywhere. This takes me weeks to adjust and figure it all out. So I will not go beyond version 0.112.

matlimatli commented 4 years ago

I rewrote my config file and included all the devices. I know which device-hex-string corresponds to which thermometer. But I don't see this hex-string anywhere in the configuration UI. I just have a ton of "Viking 02811 nn:00" devices. After some digging around I realised that the nn was position 9-10 of the device string. It would be quite helpful if the low-level device-ID was visible somewhere in the configuration UI.

spawnrider commented 4 years ago

I rewrote my config file and included all the devices. I know which device-hex-string corresponds to which thermometer. But I don't see this hex-string anywhere in the configuration UI. I just have a ton of "Viking 02811 nn:00" devices. After some digging around I realised that the nn was position 9-10 of the device string. It would be quite helpful if the low-level device-ID was visible somewhere in the configuration UI.

Same issue. My smoke detector (Nemaxx KD 101) is not firing event since the upgrade because the ID has changed....

RobBie1221 commented 4 years ago

Please post only comments here that are related to the issue (the issue is light being detected as switch). If you need support or have a new issue, please use the proper communication channels:

https://www.home-assistant.io/help/#communication-channels

repiuk commented 4 years ago

please use the proper communication channels: https://www.home-assistant.io/help/#communication-channels

I'm kinda lost in all the channels to choose from. Which one is the preferred channel for this rfxtrx integration?

RobBie1221 commented 4 years ago

It does not depend on the integration but what kind of question/issue you have.

For support questions, you can use the community forums. This also contains a section feature request to request new features. Issues or bug reports can be done here via the issue tracker, but either post information relevant to an already existing issue or open a new issue with all the relevant information.

matlimatli commented 4 years ago

Please post only comments here that are related to the issue (the issue is light being detected as switch). If you need support or have a new issue, please use the proper communication channels:

To be fair, this issue primarily mentions issues with the migration process, and only listing the light switch issue as “the other issue”. If the migration process should not be handled here, maybe the title and description should be changed?

RobBie1221 commented 4 years ago

The main issue is that this should not become a sandbox for ideas on how to improve migration. In the description, aside from struggles with migration, only one real issue is clearly described which is the lights detected as switch issue and this is also what is being picked up in the linked PR.

For traceability, it's better to create new issues or feature requests. You are on to something when you say it's difficult/impossible to link devices to event codes in the config, especially after renaming devices. I would propose to make a new issue for that.

driek12 commented 4 years ago

I recently updated to 0.115 and also got the surpise of the bix change in the protocol. I managed to get my switches up and running again but i cannot get my doorbell up and running.

In the configuration i have rfxtrx: device: /dev/ttyUSB0 automatic_add: true #true
debug: True devices: 0b1100000127868201010f50: #kaku 3 - achterdeur - 1278682:1 device_class: light 0b11000101f6758601040f50: #deurbel - 1f67586:1 fire_event: true

and in my automation i changed the trigger to trigger:

But the automation isnt triggered. I tested with all kinds of settings but nothing works.

Can anybody send me in the correct direction?

RobBie1221 commented 4 years ago

Could you post your support question on the community forum?

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.