I’m trying to configure my 3 somfy blinds using rfxtrx, I’ve gotten it to kind-of work, but I don’t understand it fully yet. When I do, I want to update the documentation to make it easier for others too. There seems to have been a change in how this should be configured (the “platforms”-way of configuring no longer works), so many other posts on the forum have outdated info, which complicates it even further.
I used RFXmngr on my desktop (with the RFXtrx433XL module connected over USB) to configure my brand new RFXtrx433XL so it has 3 remote entries (defined by an ID + unit code), one for each blind. After linking the RFXtrx433XL device to my blinds, I attached the RFXtrx433XL to my Raspberry PI 3 running Home Assistant so it can control the blinds by knowing the ID’s + unit code.
The 3 blinds all have the ID “010101”, unit code 1 through 3:
blind 1: 071a000001010101
blind 2: 071a000001010102
blind 3: 071a000001010103
Let’s see how we can get this working according to the docs.
device
The docs about setting up the serial connection with the device config variable are clear:
It’s working (I can control the blinds using the RFXtrx433XL module), but (Question 1) I don’t understand why I can’t see that /dev/ttyUSB0 entry, nor a entry in /dev/serial (I guess that ttyUSB0 is hard-linked to the 1 of the 4 USB ports on the RBPI, and that linking to the device by ID is more robust):
➜ config ls -al /dev/tty*
crw-rw-rw- 1 root root 5, 0 Sep 5 16:59 /dev/tty
crw-rw---- 1 root audio 204, 64 Sep 5 16:59 /dev/ttyAMA0
➜ config ls -al /dev/serial/
ls: /dev/serial/: No such file or directory
devices
According to the devices section, it should contain an EVENT_CODE, which can contain a device_class:
But in the RFY section under covers (h_ttps://www.home-assistant.io/integrations/rfxtrx#covers), the EVENT_CODE
is not mentioned anymore, instead, it says
add a device to the configuration with the following id 071a0000[id][unit_code]
Question 2: I guess that EVENT_CODE
and device id
refer to the same concept, right?
Either way, this makes me think this config should work:
rfxtrx:
device: /dev/ttyUSB0
devices:
# blind 1
"071a000001010101":
# blind 2
"071a000001010102":
# blind 3
"071a000001010103":
Great success, I get some “covers” in the (default) dashboard for the blinds, and the controls are working, so far so good. However, I seem to get 3 device types by default for each blind: a binary_sensor, a switch, and a blind:
Creating a quick lovelace dashboard for the first blind, this is what I get:
It’s not clear to me why I get these 3 by default, since (I think) only the “cover” type makes sense.
Looking at the docs again, I think I need the device_class
:
However, the docs confuse me. The first link goes to a page about customizing device classes, but the second link goes to a specific page about customizing the binary_sensor.
The first link makes more sense, which says:
Since I’m interested in the cover, I click on the cover link. It looks like this:
This makes me conclude that “blind” should be supported for covers, I adapt my config to this:
rfxtrx:
device: /dev/ttyUSB0
devices:
# blind 1
"071a000001010101":
device_class: blind
# blind 2
"071a000001010102":
friendly_name: friendly blind 2
# blind 3
"071a000001010103":
But when I check the config, it says:
Invalid config for [rfxtrx]: extra keys not allowed @ data['rfxtrx']['devices']['071a000001010102']['friendly_name']. Got 'friendly blind 2'
value is not allowed for dictionary value @ data['rfxtrx']['devices']['071a000001010101']['device_class']. Got 'blind'. (See /config/configuration.yaml, line 39).
So:
- question 3: how can I get rid of the (by default) added switch and binary_sensor? I want the cover only
- question 4: how can I specify that this cover is a blind (as per https://www.home-assistant.io/integrations/cover/)
Thanks!