#MQTT sensor configuration

7 messages · Page 1 of 1 (latest)

tardy harness
#

I have configured a server and gateway in my house to make the LORA-MQTT-HA communication and everything works properly , my problem comes as I try to install a Door Binary sensor which appears to me with the status of “unknown” I sure have an error in the configuration.yaml, I leave the payload that emits in sensor as well as the current configuration I need help

#

mqtt:
binary_sensor:
- name: "État de la porte du garage"
state_topic: "xyz"
value_template: "{{ 'on' if value_json['decoded']['payload']['DOOR_OPEN_STATUS'] == 1 else 'off' }}"
device_class: door
payload_on: "on"
payload_off: "off"
device:
identifiers: "lorawan_door"
manufacturer: "Dragino"
name: "LDS02"

limber smelt
#

hard to say without proper formatting and without knowing what the MQTT payload really is

half wrenBOT
#

To format your text as code, enter three backticks on the first line, press Enter for a new line, paste your code, press Enter again for another new line, and lastly three more backticks.
```yaml
example: here
```
Don't forget you can edit your post rather than repeatedly posting the same thing.

tardy harness
#

...mqtt:
binary_sensor:
- name: "État de la porte du garage"
state_topic: "helium/xyz/rx"
value_template: "{{ 'on' if value_json.decoded.payload.DOOR_OPEN_STATUS == 1 else 'off' }}"
device_class: door
payload_on: "on"
payload_off: "off"
device:
identifiers: "lorawan_door"
manufacturer: "Dragino"
name: "LDS02"...

#

In MQTT EXPLORER :