RFXtrx 868

HI all,

I’m still having a hard time figuring out how to setup devices and sensors in Home assistant.

Beside my RFXTRX433e I’m using a 2nd rfxcom device for 868Mhz devices. I’m using this device to see the status of my door/window contacts of my Visonic Powermax Alarm system.

I’ve got the rfxtrxhub setup as described in the section for the RFXcom devices.

So far so good: I can see that the device is working, and can see the sensors transmitting signals and showing op in the home-assistant.log:

16-08-11 11:58:51 homeassistant.components.rfxtrx: Receive RFXCOM event from <class ‘RFXtrx.RFXtrxDevice’> type=‘Visonic Powercode Door/Window Sensor Primary Contact’ id=‘539fae:32’

Now: setting up the sensors, how to do this. I’m not even sure this kind of sensor is even supported? The door contacts have 2 states: Normal and Alarm. The motion detectors have 2 states: No motion and Motion.

As a start I tried this:

#rfxtrx868sensor
sensor 2:
platform: rfxtrx
automatic_add: True
devices:
539fae:32:
name: Contact_Achterdeur
(indentations are lost in this post)

So this generates the following error:

16-08-11 11:56:04 homeassistant.bootstrap: Invalid config for [sensor.rfxtrx]: Rfxtrx device 0539fae:32 is invalid: Invalid device id for OrderedDict([(‘539fae:32’, OrderedDict([(‘name’, ‘Contact_Achterdeur’)]))]) for dictionary value @ data[‘devices’]

I’m a bit lost here. I kinda underestimated setting up this whole thing, coming from Domoticz.

Any help would be appreciated.

Tnx in advance,

Oliver

1 Like

Hmm, I am not sure if anyone have tested with 868MHz devices.
I have not seen a : in a device id before, so we might not handle it correctly.

If you only have this in your config:

sensor 2:
  platform: rfxtrx
  automatic_add: True

Then trigger your sensor.
Will the the sensor then show up in the web interface?
Any error or info in the log?

nope, but then again i Also have issues setting up autodiscovery:

16-08-11 11:56:05 homeassistant.util.package: Attempting install of netdisco==0.7.0
16-08-11 11:56:35 homeassistant.bootstrap: Not initializing discovery because could not install dependency netdisco==0.7.0

I read i should install a dev kit for python, but not sure how to do this on synology.

You do not need autodiscovery for the rfxtrx device. That is for autodiscovery of devices connected to your network.
If you remove discovery from your config file, you will disable that functionality.

So you say that there is nothing happening in the console or web interface when you trigger the sensor?
So where did you got your device id (539fae:32:) from?

Btw, it seems that you have copied the id from the log. That is not the correct way.
You should find the device_id in the web interface, as described here: https://home-assistant.io/components/sensor.rfxtrx/

Correct, But the device is not showing in the webinterface. I only see all the devices in the log. The send update signals every 5 minutes, so i see them all in the log.

16-08-11 13:14:14 homeassistant.components.rfxtrx: Receive RFXCOM event from <class ‘RFXtrx.RFXtrxDevice’> type=‘Visonic Powercode Door/Window Sensor Primary Contact’ id=‘6b9fae:32’
16-08-11 13:14:16 homeassistant.components.rfxtrx: Receive RFXCOM event from <class ‘RFXtrx.RFXtrxDevice’> type=‘Visonic Powercode Door/Window Sensor Primary Contact’ id=‘539fae:32’
16-08-11 13:14:19 homeassistant.components.rfxtrx: Receive RFXCOM event from <class ‘RFXtrx.RFXtrxDevice’> type=‘Visonic Powercode Door/Window Sensor Primary Contact’ id=‘3b9fae:32’
16-08-11 13:14:21 homeassistant.components.rfxtrx: Receive RFXCOM event from <class ‘RFXtrx.RFXtrxDevice’> type=‘Visonic Powercode Motion Detector’ id=‘9492c9:32’

Ok,

Try with this config:

sensor 2:
  platform: rfxtrx
  automatic_add: True

switch:
  platform: rfxtrx
  automatic_add: True

Nope…no result. Where am I supposed to see the sensor/switch in the GUI?

In a similar way as here: https://home-assistant.io/demo/
Where the sensors are shown in the top.

Do know where you homeassistant is installed on your computer?
If you can locate this file: https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/rfxtrx.py
Try to add this to line 135:
_LOGGER.info(“Device id %s”, slugify(event.device.id_string.lower()))

If it was being detected, shouldn’t he see it in the states dev panel, Daniel?

No, the logmessage only says that a package has been received from the rfxtrx library.
Then it have to be converted to a hass device before it will show up

Thanks for clarifying; I don’t have any experience with RFXTRX devices but am always trying to learn so I can help more people here.

1 Like

Mhh ok line 135, tried it, homeassistant is not starting anymore now. Guess it stops when loading that component.

Should it be part of the setup definition?
Any indentation needed?

This is the code right now:

def setup(hass, config):
    """Setup the RFXtrx component."""
    # Declare the Handle event
    def handle_receive(event):
        """Callback all subscribers for RFXtrx gateway."""
        # Log RFXCOM event
        if not event.device.id_string:
            return
        _LOGGER.info("Receive RFXCOM event from %s", event.device)

LOGGER.info("Device id %s", slugify(event.device.idstring.lower()))
        # Callback to HA registered components.
        for subscriber in RECEIVED_EVT_SUBSCRIBERS:
            subscriber(event)

removed the line, now its working again.

btw: Line135 is the comment: Callback to HA registered components.

Sorry, it should be _LOGGER.info… with an _ first
with same amount of spaces in front as the other _LOGGER line

BTW, you said you have both a 433mhz and a 868mhz transceiver. Is that two different units? Do you have link to the 866mhz devize? Is the 433mhz transceiver working?

The 868Mhz version of the RFXCOM can be found here.

Indeed that’s the one. It’s a prototype and not publicly available yet I guess. I will try the second log line today, but I think I already tried that yesterday without result. Let me check. As for the 433 unit: haven’t tried yet. That one is still connected to Domoticz. I wanted to be sure that the 868 version was able to work with home assistant before migrating everything. I assumed the 433 version would work anyway. I’ll check ifthat’s the case.

Ok, tested some things:

The logging code doesn’t work, seems to break the component: Even with the 433rfxtrx this causes issues. If this code is added, it loads the rfxtrx component, but does’nt see any devices (at least the dont appear in the log). Furthermore, it doesn’t autoadd anything. Same for the 868, with the added code, no log entries from sensors anymore.

Without the code, the 433 seems to work. Autoadd works.

So issue seems to be recognizing the 868 sensors.

How would I add 2 rfxcom devices anyway in the config?:

#RFXCOM
rfxtrx:
device: /dev/ttyUSB0
debug: True
dummy: False

I cant use any of the components twice without getting a duplicate key error.

I tried:

rfxtrx:
device: /dev/ttyUSB1

I get a duplicate key error for both rfxtrx and device. If i use different names, it doesn’t recongnize the components.

So with the 433 device, sensors and switches are showing up in the frontend?
Ok, I need the device_id to help you. If I get it, I will try add support for your sensor.

I have added more logging to the next version of HA.
So if you are not able to modify or debug the python file, I think you should wait for that version to release.

Ok seems that that is the best way to go. My programming skills are not on a debugging level, I’ll give it a try but don’the really expect anything.

Tnx for the effort though.

Grtz,

Oliver

Ps: any idea when the next release will be available?