RFXtrx 868

Hi Daniel,

I wonder if you have any idea why this solution is not working anymore? I noticed this at 0.54, but could have happened before. running 56.2 now.

Only one of the two compontents works now if I reload hassio. The copy of rfxtrx (called rfxtrx2) in custom components does still work, but only one of the two rfxcom devices will load. Most of the times is actually is the rfxtrx2 component, I guess this hass something to do in the order the components are started.

This copied component solution worked for 1,5 years without any issues, but suddenly it stopped.

Any ideas? I really would appriciate some help, because I am not able to use all of my motion sensors and door/window contacts anymore…

Kind regards,

Oliver

Are both components using the same version of the pyRFXtrx library?

Yes, they are, 0.20.1. The custom one was running an old version at first but after updating it, same issues.

Any idea why loading a copy of the rfxtrx component is causing issues? At this point im considering just buying new doorsensors in addition to th 868 ones.

Still not able to see anything in the logs unfortunally, just one componennt will load. Which one varies per restart.

I think I’m almost there, but no luck yet to receive visonic 868 data:

I’ve copied the required files to the location of the config files:
~/.homeassistant/custom_components/rfxtrx2.py
~/.homeassistant/custom_components/sensor/rfxtrx2.py
~/.homeassistant/custom_components/switch/rfxtrx2.py

custom_components/rfxtrx2.py
I’ve changed DOMAIN = ‘rfxtrx2

custom_components/sensor/rfxtrx2.py
custom_components/switch/rfxtrx2.py
I’ve changed the imports to: custom_components.rfxtrx2

As for the sensor config:

  • platform: rfxtrx2
    automatic_add: True

Now I don’t have any error messages on start, but also no learned sensors
Any ideas?

I think I can answer my own question.
I was expecting log messages in .homeassistant/home-assistant.log, but there are none.
Check the states < > menu in the web-gui, that’s where I saw sensors popping up.

A log message on a new sensor would be a nice to have.

I only can’t seem to find a way to add the visonic sensors to the configuration.
I’ve tried the following in the sensor config file:

- platform: rfxtrx2
  automatic_add: True
  devices:
    0820050334f34g35g4:
      name: PIR1
    0820050334f6543523:
      name: PIR2

You should also change the import in the pyhton files to:
import custom_components.rfxtrx2 as rfxtrx on the switch and sensor part. This way there should be not dependency to the original component.

I’m pretty sure it works, only problem is they cannot work together.

Set logging for the custom component to debug:

logger:
default: info
logs:
homeassistant.custom_components.rfxtrx2: debug

If I use it this way only one of the 2 is loading. There doesn’t seem to be anything wrong with the copied component, but I think there is something loading that cannot work with two USB rfx devices, I havent got the skills to fix this :(.

I do have sensors auto discovered as I mentioned before.
Now I want to add them manually, but don’t know in which syntax.

Hass discovered for example:
08200404245g4e0099_sensor_status
08200406g345re0049_sensor_status
082005002y56re0559_sensor_status

How should I add these sensors in which config part?
Or can I re-use the ID’s I’ve discovered the sensors with from Domoticz?

Should be something like this:

  - platform: rfxtrx2
    automatic_add: True
    devices:
      082004093b9fae0055:
        name: Slaapkamerraam
      0820040b5b9fae0456:
        name: keukendeur

The automatic add feature, makes HASS auto-add the sensors (with a unique device_id). Once you see them popping up in the user interface, you can add them with the correct device Id as above. If you have a lit of sensors,

Good luck finfdng out which one is which :slight_smile:

Edit:

I just re-read your post:

If you added sensors in your config with a device id like my example above, even if the device_ids are not correct, they will pop-up in the states menu. I also have this. All the sensors are in there, but all status unknown. Your config will create them if you specified sensors, but the states will only be populated if it actually recieves data from a sensor with that device_id on the rfrtrx2 component.

But do you mean you have this working with 2 rfxtrx devices??? If so, please show me how :).
The frustrating part is, both components load without any errors in the log. But only one is working, or getting data. It also changes with every reboot. One of the 2 always shows every sensor as “Unknown”, so it is not getting any data. Sometimes the rfxtrx sensors work, sometimes only the rfrtrx2 sensors work.

So I notice that I actually followed the same configuration syntax as you have.
Still, I haven’t seen any sensor which I manually added.

I’m not sure if I also have an issue with using both sensors at the same time.
Sometimes I can control the somfy blinds with the rfxtrx, and see visonic sensors in the states page. Other times it’s not so stable and after a few hours the serial connection is disconnected.

I try to connect manually with another python script to see if I can access the serial port.
If I can connect I guess hass has lost it.

Another thing I noticed:
Each time hass finds new visonic sensors on the rfxtrx868 it gives them new friendly id’s when I look them up in the states page.
example: friendly_name: 08200500626cab0499 Sensor Status

The rfxtrx support from hass is the only thing bugging me from using it.

I’m going to take another route as I see you mentioning this issue on a date from waaaayyyy back.
Therefor, I don’t see a native hass solution for the next months.

The hass rfxtrx “lowlevel.py” code is very organised and re-usable to build a stand-alone mqtt service.
Hopefully it is usable within the different home automation mqtt interfaces for domoticz and home assistant.

The first test is ok: I can send the complete decoded package:
Security1 [subtype=Visonic Powercode Door/Window Sensor Auxilary Contact, seqnbr=0, id=cef26f:32, status=Normal, battery=9, rssi=5]

Next step is to send for example only the id and status in a MQTT instance ‘rfxtrx868’
Or even the MQTT instance is based on the different subtypes.

Ok sounds promising…about native hass support for the rxtrx868: it works for me, all sensors are popping up and responding like they should. I’ve had the 868 and 433 working togheter without any issues until release 0.51 (at least thats when I noticed). They work fine seperatly now, even when using the custom component part. They just don’t work together anymore, only one of the 2 gets information from the sensors. I still have too many 433 devices to just disable the 433 one. Maybe after I upgrade those to zwave or zigbee devices I can use the 868 again.

I,m still hoping for a component based on a rs232 serial connection, as I guess that’s the most reliable control and it would allow to not only see sensor status, but also alarm panel status and allow you to arm and disarm the alarm.

But since I haven’t got the experience or time to create this myself I guess I’ll have to wait for someone to make time for this. I’m still a happy Hass user though :grin:

See the following git for a working python script that:

  • connects to the rfxcom rfxtrx 868
  • connects to a mqtt broker
  • posts all visonic packets from rfxtrx to mqtt

Thats fast :slight_smile:

How do I run this in hass io?

An example to run the python code on background:
Ofcourse, the user you run this with needs access to the serial, which you probably already have.

$ nohup /home/homeassistant/.homeassistant/mqtt/rfxtrx868_visonic.py &

Configuration examples for mqtt in hass is included in the git

I got 868 Mhz working with just a Raspberry Pi: