Hello,
first time poster here.
I’m kind of new new to mqtt and yaml, please excuse.
I created a trigger with the payload of a Shelly 2 Motion Sensor via the yaml config.
My config looks like this:
platform: mqtt
topic: shellies/shellymotion2-8CF681C1B5D2/info
payload: true
value_template: "{{ value_json.sensor.motion }}"
encoding: utf-8
The code is not triggering every time a motion is detected. It works 1 - 2 times, maybe saving the automation triggers it? is my automation incorrect?
Home Automation suggest using this "{{ value_json.binary_sensor.shellymotion2_8cf681c1b5d2_motion }}"
, as this is an entity. But i don’t know which value is pushed in this variable.
{
"wifi_sta": {
"connected": true,
"ssid": "MyWLAN",
"ip": "192.168.8.185",
"rssi": -64
},
"cloud": {
"enabled": false,
"connected": false
},
"mqtt": {
"connected": true
},
"time": "20:18",
"unixtime": 1716488287,
"serial": 0,
"has_update": false,
"mac": "8CF681C1B5D2",
"cfg_changed_cnt": 3,
"actions_stats": {
"skipped": 0
},
"sleep_time": 0,
"lux": {
"value": 782,
"illumination": "bright",
"is_valid": true
},
"tmp": {
"value": 27.3,
"units": "C",
"is_valid": true
},
"sensor": {
"vibration": false,
"motion": false,
"timestamp": 1716488262,
"active": true,
"is_valid": true
},
This is an excerpt from the mqtt json of the motion sensor.
Is there an error in my configuration.yaml?