Connecting the device to my raspberry pi 3 and have looked in the homeassistant log the show that the message is also received by the RFXCOM library within homeassistant.
But somehow homeassistant is not able to convert this to one of the following devices: Switch, Light or binary sensor
I have enable auto detection on all 3 rfx devices and no devices is added to homeassistant.
I have tried to add the device manually (082009018d20000660) to Switch and Binary sensor, also without any succes.
Compared the packet with lowlevel.py and should not be a problem
Lenght[0]: 08 (eight bytes)
Type [1]: 20 (security 1)
Subtype [2]:09
seq.nr [3] :0
ID [4,5,6]=8d200
Status[7]=06
Noise level [8]=60
I have some programming knowledge (C#,C++, VB) but not yet in python. After looking at the code i am aware that the binary sensor only support lightning 4 type sensors. The switch however should support it, i think?
Please some suggestions to put me on the right track.
I am looking at the debug messages and there it says Device ID=8d200032, while the real device ID=8d2000.
Where does the 32 come from? Could this be the problem?
After inserting extra debug messages in the code, the problem is not the device id. The registerd device id (read from config file) and the device id from the RFXCOM event are equal.
However i found out after receiving the event from the RFXCOM device, the event is not distributed and it seems that the statement <apply_received_command> (callback funtion?) is not executed!
I guess the code below is responsible for distributing the event further after receiving the event from the RFXCOM device?
# Callback to HA registered components.
for subscriber in RECEIVED_EVT_SUBSCRIBERS:
subscriber(event)
After some debugging and code exploration, it appears that the RFTRX switch component not supports devices from the Security1 class. The following statements, is responsible for this.
def switch_update(event):
"""Handle sensor updates from the RFXtrx gateway."""
if not isinstance(event.device, rfxtrxmod.LightingDevice) or \
event.device.known_to_be_dimmable or \
event.device.known_to_be_rollershutter:
return
new_device = rfxtrx.get_new_device(event, config, RfxtrxSwitch)
if new_device:
add_devices_callback([new_device])
rfxtrx.apply_received_command(event)
After digging some more in the RFTRX libaries and code, the Alecto SA-33 sensor is only supported by the RFtrx sensor.
The disadvantage of the SA-33 sensor is only sending a “Panic” signal when smoke is detected. It never does send “Normal” signal, so the sensor it self is not direct usable for a practical use.
I have 2 different solutions to solve this problems
1
I made a modification for the code for the RFTRX binary sensor, so that this device could be used as binary sensor.
This is only a modification for the SA-33. When i have some more time i wil make a commit, to support all security 2 devices.
2 (prefered solution until now)
I made a virtual Smoke sensor with the use of the binary_input component and the template binary sensor by using the event that is fired every time a new Panic Signal is fired. The Virtual sensor will be active for a defined time after turning back to the normal state.
Yes, i add it manually. Make sure you are using the RFXtrx sensor and not the switch or binary_sensor variant.
If this does not work, you could try the automatic_add propery for the sensor to look if it is discoverd
.
Make sure that you receive the package with RFXmngr, when you connect the rfxcom to you PC to make sure that the RFXCOM can receive it.