New to HA - struggles with Sensors

Hi all,
New to Home Assistant and automation - long time Alexa user which has sparked my interest and prompted the dipping of toes in the waters of HA, so I bought a couple of basic sensors along with a Sonoff RF Bridge which I’ve flashed with 14.1.0 (release-tasmota).

On to my problem…

I’ve been trying to get the flashed RF Bridge and two sensors working, the sensors are a Sonoff DW1, which only senses an “open”, the other being a Sonoff CT60 PIR2.

What I am trying to achieve is to have the sensors when either is triggered to send me either an SMS or Whatsapp - simple enough one would have thought.

I’ve been wrestling with this for many hours now so am hoping someone can set me off in the right direction - I’ve read many pages and watch hours of YouTube vids but
am still unable to get things to even the basics to work.

One thing that does seem to be functioning as expected is the RF Bridge which is receiving info from both sensors, this can be seen in the tasmota RF Bridge console as:-

PIR2:
10:46:10.708 MQT: tele/RF-Bridge/RESULT = {"Time":"2024-08-16T10:46:10","RfReceived":{"Sync":12410,"Low":420,"High":1210,"Data":"E60C4E","RfKey":"None"}}

DW1:
10:46:52.337 MQT: tele/RF-Bridge/RESULT = {"Time":"2024-08-16T10:46:52","RfReceived":{"Sync":12740,"Low":420,"High":1230,"Data":"A8BAB9","RfKey":"None"}}

I can also see via the MQTT integration broker the following when in listening mode:-

PIR2:
{
    "Time": "2024-08-16T10:50:03",
    "RfReceived": {
        "Sync": 12400,
        "Low": 410,
        "High": 1220,
        "Data": "E60C4E",
        "RfKey": "None"
    }
}

DW1:
Message 1 received on tele/RF-Bridge/RESULT at 10:48:

{
    "Time": "2024-08-16T10:48:54",
    "RfReceived": {
        "Sync": 12680,
        "Low": 410,
        "High": 1240,
        "Data": "A8BAB9",
        "RfKey": "None"
    }
}

I’m struggling with getting both the PIR & DW1 to be seen as entities in HA, I’ve tried so many combinations in /homeassistant/configuration.yaml that I’ve lost track - there
seem to be so many different ways to do this but I’m unable to get any of the ways I followed to work.

I know I’m getting ahead of mysel here but I found this post from “Taras” and like the look of the “Strategy 2: Demultiplexer” which I would like to implement if I can ever get the basics implemented.

Could someone assist me getting the basics sorted in /homeassistant/configuration.yaml just to get the sensors to the point where they can be seen and trigger an event - I would be very grateful for any guidance.

Here’s my current /homeassistant/configuration.yaml

# Loads default set of integrations. Do not remove.
default_config:

# Load frontend themes from the themes folder
frontend:
  themes: !include_dir_merge_named themes

automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
python_script:

binary_sensor:
  - platform: mqtt
    name: "Garage Door Sensor"
    payload_on: "A8BAB9"
    device_class: opening
    state_topic: "tele/RF-Bridge/RESULT"
    value_template: '{{ value_json.RfReceived.RfKey }}'
  - platform: mqtt
    name: "Garage PIR"
    payload_on: "E60C4E"
    device_class: motion
    state_topic: "tele/RF-Bridge/RESULT"
    value_template: '{{ value_json.RfReceived.RfKey }}'

I’m sure I’ve forgotten to add something so please if there’s additional info required just shout.

Thanks in advance, w7r

You are using mqtt binary_sensors, little different than plain binary_sensors.
You were very close

mqtt:
  binary_sensor:
    - name: "Garage Door Sensor"
      payload_on: "A8BAB9"
      device_class: opening
      state_topic: "tele/RF-Bridge/RESULT"
      value_template: '{{ value_json.RfReceived.RfKey }}'
    - name: "Garage PIR"
      payload_on: "E60C4E"
      device_class: motion
      state_topic: "tele/RF-Bridge/RESULT"
      value_template: '{{ value_json.RfReceived.RfKey }}'

Here’s the doc

1 Like

As shown above you are using the legacy MQTT sensor configuration style which was deprecated last year.

Is there a reason you are using RfKey as the source in value_template when, from the supplied examples, it appears the payload you want to use for payload_on is from Data?

Also, make sure to define an off_delay for the DW1 or it will turn “on” and just stay that way.

1 Like

Thanks for the quick replies, I shall take a look over the weekend and update as to my progress.

Thanks again, w7r

Hi ,
I’ve been using this for years. I’ve been using 123’s strategy 2 the entire time.
You can look at my configuration to see the pyrthon script, triggers that are generated by HA for the bridge, and triggers that come from the Btidge into HA. I don’t use any of the memory slots built into the bridge.

If you have questions, look at that stuff and I’ll watch this post as well.
Home-Assistant-Config/mqtt/switch/MQTT_switch_RF433.yaml at 939d14a3ca362ddbcb2c11bd5f6833af64c8814c · SirGoodenough/Home-Assistant-Config · GitHub,
Home-Assistant-Config/mqtt/binary_sensor/MQTT_bs_batteries.yaml at 939d14a3ca362ddbcb2c11bd5f6833af64c8814c · SirGoodenough/Home-Assistant-Config · GitHub
Home-Assistant-Config/python_scripts/rfbridge2_demux.py at 939d14a3ca362ddbcb2c11bd5f6833af64c8814c · SirGoodenough/Home-Assistant-Config · GitHub.

1 Like