Rfxtrx vs rfxtrx binary sensor

I am a bit confused.

I have a RFXtrx433E added to my server.
How to set it up properly in configuration.yaml?

rfxtrx:
  device: /dev/ttyUSB0

sensor:
  - platform: rfxtrx
    devices:
      0a520737770e00af320189:
        name: temp_badkamer
      0a520d01eb0200580a0269:
        name: temp_buren
      0a520701550e00ba2e0189:
        name: temp_tuin
 
switch:
  - platform: rfxtrx
    devices:
      0b110001013d14f60a000050:
        name: keuken_sensor
      0b11001c015754320a010f50:
        name: woonkamer_sensor

or use:

binary_sensor:
  platform: rfxtrx
  automatic_add: True
  devices:
     0b11001c015754320a010f50:
     name: woonkamer_sensor
     device_class: motion

What is the defference between a switch, sensor and a binary_sensor?

Hi @conradh

I would say that sensors get values or events from their environment and report them to home-assistant. Binary sensors can only report two events: “on” and “off”, whereas general-purpose sensors can report discrete values (temperature, humidity, etc.)

Switches are like binary sensors because they can only be “on” or “off” and they also can report their state to home-assistant. However, I see binary sensors as “read-only” (home-assistant can receive their values but cannot physically switch the devices on or off), whereas switches are read/write (you can switch a device on or off from home-assistant).

From your configuration, I’d say your “woonkamer_sensor” is a binary sensor.
I hope I could help you (very late, sorry).

1 Like