I’m quitte new with home assistant (comming from pimatic). First of all great platform!!
I have a question about my door/window sensor. When I open my door I receive an on command (see below) and when I close the door I also receive an on commando (different ID). Now how can I make this into an device open/close?
I see the switch and it does switch on when I open the door.
In the log I see:
2018-01-02 23:14:12 DEBUG (MainThread) [homeassistant.components.rflink] passing event to []
2018-01-02 23:14:12 DEBUG (MainThread) [homeassistant.components.rflink] Fired bus event for switch.switchxx: on
But how can I merge the two on commands to an open/closed sensor?
@Gratizzz
I’m not very familiar with RFlink platform but I would say create two automations (one for the open signal from the first sensor and the other from the close signal) that have the payloads “on” and “off” sent in a single topic named “home/open_door_sensor_xxx” or similar, and a MQTT binary sensor setup with “on” and “off” payloads above.
Setup is much easier than RFLink as the topic for the messages is unique, however the payloads are different. The integration is through MQTT (which is the greatest thing since the invention of hot water )
Hi all,
i dont know if is just for me, but every door sensor ev1527 that i have, send always SWITCH=0e when off and SWITCH=0a when on.
Since RFLink Signal Learning isnt stable for me, i tried to fix by adding on parser.py after the line 265 and before “return data” this:
correct ev1527 device ON/OFF command
if data.get('protocol', '') == 'ev1527' and data.get('switch', '') == '0e':
data['command'] = 'off'
if data.get('protocol', '') == 'ev1527' and data.get('switch', '') == '0a':
data['command'] = 'on'
Hi @jackdalma, this would be really cool and very helpful for me!
I just gave it a try but I end up with the following error:
2018-08-22 19:24:42 ERROR (MainThread) [homeassistant.setup] Error during setup of component rflink
Traceback (most recent call last):
File “/usr/local/lib/python3.6/site-packages/homeassistant/setup.py”, line 145, in _async_setup_component
hass, processed_config)
File “/usr/local/lib/python3.6/asyncio/coroutines.py”, line 212, in coro
res = func(*args, **kw)
File “/usr/local/lib/python3.6/site-packages/homeassistant/components/rflink.py”, line 111, in async_setup
from rflink.protocol import create_rflink_connection
File “/home/pi/.homeassistant/deps/lib/python3.6/site-packages/rflink/protocol.py”, line 11, in
from .parser import (
File “/home/pi/.homeassistant/deps/lib/python3.6/site-packages/rflink/parser.py”, line 267
if data.get(‘protocol’, ‘’) == ‘ev1527’ and data.get(‘switch’, ‘’) == ‘0e’:
^
TabError: inconsistent use of tabs and spaces in indentation
2018-08-22 19:24:43 ERROR (MainThread) [homeassistant.setup] Unable to setup dependencies of sensor.rflink. Setup failed for dependencies: rflink
2018-08-22 19:24:43 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform sensor.rflink: Could not setup all dependencies.
Hi @jackdalma, I just did a new install on my second hass platform (hassio image on raspberry pi 3). But now where can I find the file to edit? Do you know if it is even possible?
2 @parfour & all:
I don’t think changing rflink source files is a particularly good idea to achieve what you want and offer a different approach.
You need:
Define two rflink binary sensors:
binary_sensor:
- platform: rflink
devices:
# on command
ev1527_08ebb0_0a:
off_delay: 1
# off command
ev1527_08ebb0_0e:
off_delay: 1
These 2 sensors will be internal ones to receive those on and off commands. To enable it work as planned we need them to go back to off state as soon as possible (1 second here).
Define a input_boolean that will represent state of your door sensor:
input_boolean:
my_door_sensor:
Create automations that will trigger that my_door_sensor as a reaction to any of our binary_sensors changing their states to on (meaning on or off command received):
automation:
- alias: update_my_door_sensor
trigger:
- platform: state
entity_id: binary_sensor.ev1527_08ebb0_0a
from: 'off'
to: 'on'
- platform: state
entity_id: binary_sensor.ev1527_08ebb0_0e
from: 'off'
to: 'on'
action:
service_template: input_boolean_turn{% if trigger.to_state.object_id.split('_')[2] == '0a'}on{%else%}off{%endif%}
data:
entity_id: input_boolean.my_door_sensor
You can use this input_boolean as internal one if you don’t need to expose it to GUI.
For GUI it’s better to show a sensor rather than input_boolean so you’ll need to define a template binary sensor for that:
binary_sensor:
platform: template
sensors:
my_door:
friendly_name: my door
device_class: 'door'
value_template: "{{ is_state('input_boolean. my_door_sensor', 'on') }}"
Hope it helps. I could’t check indentation and if it works at the moment but it should.
And ideally it requires some additional safety checks in templates like none/unknown etc.
service_template: input_boolean_turn{% if trigger.to_state.object_id.split('_')[2] == '0a'}on{%else%}off{%endif%}
data:
entity_id: input_boolean.my_door_sensor
I hate to bump an old post but I need help. I managed to get everything set up but since “service_template” has been removed from HA and “service” has taken over, I am unable to figure this out.
What would the action portion look like if I were to use “service” instead. No matter what I try, I get a “Does not match format”