How to integrate an RF window sensor (GS-WDS07) with broadlink RM4 Pro

Hi guys,

I’m desperately trying to integrate an RF 433mhz window sensor/switch (GS-WDS07) with home assistant and failing horribly. I’m not using MQTT but just plain RF as my server dosn’t have a WIFI card. I was hoping i wouldnt need a WIFI card and that my RM4 Pro could pickup these duties but there dosnt seem to be any broadlink->MQTT addons that are supported with home assistant?

I’ve found the on and off codes for the sensor but don’t know how to input them into home assistant. Do they go under switches.yaml or binary_switch.yaml or somewhere else? Does anyone have any working yaml they can share that i can modify with my RF codes to get the sensor to show up in home assistant and report it’s state?

Let me know if you need more from me.

I don’t understand this ? A GS-WDS07 is a 433Mhz device, what has Wifi to do with it ?
Second : as I understand it, a Broadlink RM4 Pro does not listen continues for 433 Mhz (I could be wrong) but only after you issue a broadlink.learn command. This seriously hinders the use for the RM4 for this kind of applications. A Sonoff Rf Bridge flashed with Tasmota or OpenMqttGateway is better for this.

@francisp - Thanks for the reply, apologies it was late. I understand the limitations of the RM4 Pro and also have an OpenMQTTGateway device that i have built that can indeed see and read the GS-WDS07 devices. Now that i can see them and capture there data do you have any example code to integrate them into home assistant? for example what are they technically classed as (binary sensor? sensor? template?) and what .yaml file should they exist in? Lastly what should an example config look like for an RF device like this to display it’s state on the home assist overview page?

Has anyone installed these sensors and can share some example code to get me going?

Post an example of what you receive on MQTT when you open and close the door. it depends on what RF library you used on OpenMQTTgateway.

@francisp - Thanks for your time, it’s appreciated. Below i’ve included my MQTT Explorer information (history cleared out) when using the GS-WDS07. When the GS-WDS07 is activated into the open position I see an entry under “433toMQTT” appear. And the topic "homassistant/switch/CC50E395BB2413722634"gets created with the info in the screen shot below:

In the next screenshot, again, i’ve cleared out the history and put the GS-WDS07 into the closed position and recieve the following:

Do you need anything else?

@francisp Any idea?

I think you can create a binary sensor like this :

  - platform: mqtt
    name: sensordoor
    state_topic: 'home/OpenMQTTGateway/433toMQTT'
    value_template: >- 
      {% if value == "13722638" %}   
        {{'ON'}}
      {% else %}
         {% if value == "13722634" %}   
        {{'OFF'}}
        {% endif %}
      {% endif %}
    device_class: 'door'

@francisp - I found the issue, your code works fine. It was the my Mosquitto Broker integration was a little broken. All shows up as expected, so thank you!