Anyone knows how to use that “payload” option from MQTT trigger in an automation?
I use a tasmotized sonoff and this is what I receive through the mqtt
Message 1 received on tele/ZigBee_Bridge/AACC/SENSOR at 23:45:
{"ZbReceived":{"Bathroom_Ambient":{"Device":"0xAACC","Name":"Bathroom_Ambient","EF00/0213":492,"Endpoint":1,"LinkQuality":66}}}
I want to make an automation which triggers when the tele/ZigBee_Bridge/AACC/SENSOR topic is received with a payload which contains this EF00/0213, but I don’t want to achieve this through a condition, I want to know how to use this optional feature of the trigger, called “payload”.
This is what I done till now, but it is not working…
alias: test
description: ""
trigger:
- platform: mqtt
topic: tele/ZigBee_Bridge/59C2/SENSOR
payload: "['ZbReceived']['Bathroom_Ambient']['EF00/0213']"
condition: []
action:
- service: persistent_notification.create
data:
message: Test
mode: single
In the linkquality and that value which I need "EF00/0213":492, this is the humidity value which is changing all the time…
And, there is no way to talk with this “payload” option in order to tell him that is ok to receive only a part of the payload?
I need to use something from the trigger instead of condition because I can’t follow the traces anymore. The automation will trigger 20 times per minute, at least, and using a condition will make the “traces” option not usable, I need something to use it with trigger…
Well… For this case, I think an automation will fitt me more, or at least, I don’t know if I know how to achieve the same result through a mqtt sensor.
Look, this is my autiomation which gets the data from the Zigbee Temperature sensor.
This sensor, it is sending data to zigbee two times per second (if you can imagine)… so, my bridge it is full of data, but this is not the problem, it can handle it. This autiomation do some restrictions to the received data, like you can see already. Set the variable by one of two grand condition, if 30 minutes passed or if the temperature it is changed by 1%…
As I said, I don’t know if I know how to achieve the same result with a mqtt senor. I say this because I have not even tried or thinked to try
But… as I requested initally, I don’t want my autiomation trigger 100 times per minute, because a condition, will still run the automation, but it will not pass the condition. A payload instead, being as an option inside the trigger, I will help more, but if it is working like you said, this is no help… That payload option should have something like template, I don’t know…