#Anyone have an example for a mqtt
1 messages ยท Page 1 of 1 (latest)
That sounds like you want #templates-archived
service: mqtt.publish
data:
qos: 0
retain: false
payload: "blah blah blah blah {{ states('input_text.something') }}"
@fair rock did all the hard work ๐
lmao... copypasta ๐

service: mqtt.publish
metadata: {}
data:
qos: 0
retain: false
topic: yaleLock
payload_template: >-
'{"pin_code":{"pin_code":123456,"user":11,"user_enabled":false,"user_type":"unrestricted"}}'
I'm missing something?
Where's the template? That's just a string that isn't being parsed right.
If you just want to send a string, just send it in payload:.
YEah, i'm just testing it first
service: mqtt.publish
metadata: {}
data:
qos: 0
retain: false
topic: yaleLock
payload: >-
{"pin_code":{"pin_code":992991,"user":11,"user_enabled":false,"user_type":"unrestricted"}}
Ah, ok. So, payload_template requires a template. That string should work though.
in payload:
I don't see that publish on z2m log after i run the action, but I dont see any errors running it
You wouldn't see that on Z2M unless yaleLock is your Z2M topic.
Ok, let's start over... it looks like you are trying to set a pin code for a yale zigbee lock through z2m, right?
Ok ๐ Awesome.
I can't check the lock itself but I can see the publish correctly on log
Thanks very much!
yeah, i was missing both zigbee2mqtt and set
Let me try to put the input_text now
service: mqtt.publish
metadata: {}
data:
qos: 0
retain: false
topic: zigbee2mqtt/yaleLock/set
payload: >-
{"pin_code":{"pin_code":{{ states('input_text.yalepinuser11') }},"user":11,"user_enabled":false,"user_type":"unrestricted"}}
Perfect
Thanks!!!
Anytime ๐ Happy to help!