Add RF doorbel as binary_sensor

I have a problem setting up an rflink doorbell.
The doorbeld push-button sends a “on” signal, but when I look at the log file, the doorbell sends a “ALLON”

what I did was:
sensors.yaml

 - platform: rflink
  devices:
    newkaku_00d4407a_0:
      name: "Deurbel"
      sensor_type: command

binary_sensor.yaml
- platform: template
  sensors:
    deurbel_on:
      friendly_name: "Deurbel gaat"
      delay_off:
        seconds: 2
      value_template: >-
        {{ is_state('sensor.deurbel', "ALLON") }} 

What am I doing wrong here.

Logfile
``` 2019-03-26 23:13:28 DEBUG (MainThread) [rflink.protocol] received data: 2
2019-03-26 23:13:28 DEBUG (MainThread) [rflink.protocol] received data: 0;CF;NewKaku;ID=00d4407a
2019-03-26 23:13:28 DEBUG (MainThread) [rflink.protocol] received data: ;SWITCH=0;CMD=ALLON;
2019-03-26 23:13:28 DEBUG (MainThread) [rflink.protocol] got packet: 20;CF;NewKaku;ID=00d4407a;SWITCH=0;CMD=ALLON;
2019-03-26 23:13:28 DEBUG (MainThread) [rflink.protocol] decoded packet: {'node': 'gateway', 'protocol': 'newkaku', 'id': '00d4407a', 'switch': '0', 'command': 'allon'}
2019-03-26 23:13:28 DEBUG (MainThread) [rflink.protocol] got event: {'id': 'newkaku_00d4407a_0', 'command': 'allon'} ```
  1. Go to the States page and find sensor.deurbel.
  2. Check if its state is allon or ALLON (or simply on).
  3. If it’s allon (or on) then change the value_template accordingly.
      value_template: >-
        {{ is_state('sensor.deurbel', "allon") }} # or "on" depending on what the States page shows

I checked the logs it sends ALLON when pressed.

2019-03-28 13:38:05 DEBUG (MainThread) [rflink.protocol] got packet: 20;0E;NewKaku;ID=00d4407a;SWITCH=0;CMD=ALLON;

I see in the frond-end that the sensor.deurbel is activated, but I can’t get the binary sensor triggerd.

It’s not posible to configure it with a RFLink binary sensor?

binary_sensor:
   - platform: rflink
     devices:
       newkaku_00d4407a_0: {}

Anyway, I think the doorbell state will be on. You can see it at States page (http://hassio.local:8123/dev-state or what you have configured in your installation), scroll to your sensor.deurbel, the second column will show the doorbell state. It will be probably on/off.

That’s exactly what I asked … but received a reply about the state sent by rflink (“ALLON”).

@egrootoonk

“ALLON” is the command state sent by rflink. sensor.deurbel will have Home Assistant’s valid states for a binary sensor (on/off).

Change the value_template:

      value_template: >-
        {{ is_state('sensor.deurbel', 'on') }} 

@egrootoonk: How did you manage to add the doorbell as a sensor? For me it only works if I make it a switch. And then once it’s pressed it stays on forever :slight_smile:
With your configuration above, the sensor isn’t triggered for me and stays ‘unknown’.

in binary_sensor.yaml I created the sensor using a template with delay_off function.

My Doorbell sends an “allon” when pressed. (so not an “on” signal).

- platform: template
  sensors:
    deurbel:
      friendly_name: "Deurbel"
      delay_off:
        seconds: 2
      value_template: >-
        {{ is_state('sensor.deurbel', "allon") }} 

I could not get this to work with a binary_sensor so i added it as an switch that i turn off with automation:

switch:
  - platform: rflink
    devices:
      newkaku_007fb4c6_0:
        name: doorbell
        fire_event: true
automation:
- alias: Doorbell
  trigger:
    - platform: state
      entity_id: switch.doorbell
      to: 'on'
  action:
    - service: notify.notify_pushover
      data_template:
        title: "Doorbell"
        message: "Someone is at the door!"
    - service: switch.turn_off
      entity_id: switch.doorbell
1 Like