Triggering Remote Receiver on All Signals

I would like to set up a Remote Receiver to trigger a binary sensor when it detects any signal. Reading through the documentation, there only seems to be the option to trigger a binary sensor on an individual code from an individual manufacturer’s remote.

I’m trying to use my IR sensor to detect presence in front of the television, so for my purposes, if the sensor detects any IR code at all, from either my TV or soundbar remote, I would like it to trigger a binary sensor. Is it possible to do this?

If you know which type of codes the IR remotes send you could do dump_all and then (if you have, say, a nec remote and an lg remote)

on_nec:
  [set presence to true
on_lg:
  [set presence to true]

Where do you actually put the on_nec and on_lg?

At the moment, I have it set up like below, which is only intended to work with a single button on each remote.

remote_receiver:
  pin: 
    number: GPIO13
    inverted: True
    mode: INPUT_PULLUP
  dump: all

binary_sensor:
  - platform: remote_receiver
    name: "TV Remote Input Pwr On"
    jvc:
      data: 0x0000
  - platform: remote_receiver
    name: "Soundbar Remote Input Pwr On"
    samsung36:
      address: 0x0000
      command: 0x00000000

And this toggles each binary sensor to on, then off when the preset data code is received.

I’m just having trouble seeing where your code goes in the YAML file.

It is not my code, it is in the docs Remote Receiver — ESPHome

I think:

remote_receiver:
  pin: 
    number: GPIO13
    inverted: True
    mode: INPUT_PULLUP
  dump: all
  on_jvc:
     code to set presence true
  on_samsung36
     code to set presence to true

So I’ve made it work. Thanks for the tip, @nickrout.

Here is the YAML.

binary_sensor:  
  - platform: remote_receiver
    name: "Living Room Remote Detected"
    id: living_room_remote_detected
    jvc:
      data: 0x0000

remote_receiver:
  pin: 
    number: GPIO13
    inverted: True
    mode: INPUT_PULLUP
  dump: all
  on_samsung36:
    lambda: |-
      id(living_room_remote_detected).publish_state(true);
      id(living_room_remote_detected).publish_state(false);
  on_jvc:
    lambda: |-
      id(living_room_remote_detected).publish_state(true);
      id(living_room_remote_detected).publish_state(false);

The remote_receiver binary sensor is acting as, essentially, a dummy variable, since it’s not making use of the remote_receiver platform for the intended purpose (I’ve set the data hex value to some random value), it’s just acting as a variable that I can toggle manually using the lambda code. There is definitely some way to create a binary sensor variable without a specific platform, but I couldn’t find it.

I’ve made use of the automation part of the remote_receiver platform to run the lambda code, where I manually toggle the state of my living_room_remote_detected entity, essentially emulating the function of the remote_receiver platform, but it now works for any button on both of my remotes, and not for any specific data value, which is exactly what I was looking for.

1 Like