Digoo DG-HOSA PIR Detector HA intergration Configuration.yaml

Hallo all,
Did anyone know the settings in HA configuration.yaml for this PIR Sensor.
What I found on the Github Page under DOCS Intergration HA for a PIR Sensor is this.

But this does not work.
Any Clue what to write in the configuration.yaml of HA. I’m getting a Error when I checking my Config
in HA… I changed the Topic to “home/OpenMQTTGateway/commands/MQTTto433”
and also the value_template: ‘{{ value_json[“9612550”] }}’ I think that, instead off Presense I have to put in the code that comes from my PIR Sensor … Right ?

I’m using HA version 0.115.1

Thanks in advance

I’m not using HA, but I see you changed the state topic to an OMG command topic. Shouldn’t it be


if you want to receive the state from the sensor?

Command topics are only for if you want to send some payload to a sensor/actor.

The correct JSON really depends on what the PIR sends when triggered. Do you have a full JSON message, from MQTT.fx maybe?

Thanks for your answer.

Yes in Mqtt.fx I’m receiving a full json format like this !


But this does not help. It also not working with the following configuration.

- platform: mqtt
name: “Pir Sensor”
# device_class: motion
state_topic: “home/OpenMQTTGateway/MQTTto433”
value_template: ‘{{ value_json [“9612550”] }}’
payload_on: “true”
payload_off: “false”


Still the wrong direction :wink: you want …/433toMQTT at the end.

433 info received by OMG from the PIR, with OMG transferring it to MQTT.

Can you show a screenshot of MQTT.fx when receiving a triggering message? There we can exactly see the correct topic you need to use.

And while still not knowing anything about the HA configuration.yaml definitions, from your full JSON I would assume that you want to catch the ON and OFF state with somethinbg like this:

value_template: ‘{{ value_json [“value”] }}’
payload_on: “9612550”
payload_off: “whatever_gets_sent_when_the_pir_goes_in_motion_off_state”

but someone with better HA .yaml knowledge might be more suited for this part.

Hallo DigiH
Yes you did a great job. You found the right way. I did a mistake in the state topic.

  1. I change the state_topic to “home/OpenMQTTGateway/433MQTT” (Sorry my mistake !)
    I checked it with MQTT.fx

  2. Because the PIR Sensor does not send a off Code only a on code.
    but in Home Assistant we have the possibility to change the state from ON to Off with this line
    off_delay: 5
    So now it is up and running with you cratefull help. Many thanks…

It is now like this in the configuration.yaml


  • platform: mqtt
    name: “pir”
    device_class: motion
    state_topic: “home/OpenMQTTGateway/433toMQTT”
    value_template: ‘{{ value_json[“value”] }}’
    payload_on: “9612550”
    off_delay: 5

Best Regards

Great! Glad to hear you got it all working now, Jürgen :slight_smile:

All the best.