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:
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.
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.
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
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.
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?
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.
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?:
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.