#MQTT publish payload_template no longer exists
15 messages · Page 1 of 1 (latest)
payload takes a template
Ok, but was there a deprecation notice for this change?
Deprecation notices are generally 6 months ahead of the deprecation itself
my bad then, thanks
However, it's not working. I have a template on the payload attribute and it doesn't evaluate it, it just publishes the template without procesing
Share what you've done
tap_action:
action: perform-action
target: {}
perform_action: mqtt.publish
data:
payload: >
{% set segments = [ "16" if states('input_boolean.vacuum_bathroom')
== 'on' else -1, "17" if states('input_boolean.vacuum_hallway') ==
'on' else -1, "18" if states('input_boolean.vacuum_living_room') ==
'on' else -1, "19" if states('input_boolean.vacuum_kitchen') == 'on'
else -1, "20" if states('input_boolean.vacuum_office') == 'on' else
-1, "21" if states('input_boolean.vacuum_laundry') == 'on' else -1,
] | select("string") | list %} {% set iterations =
states('input_number.vacuum_passes') | int %} {{ {"segment_ids":
segments, "iterations": iterations} | to_json }}
topic: valetudo/jervas/MapSegmentationCapability/clean/set
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.
the only thing I changed was "payload_template" to "payload"
Not that the frontend doesn't support templates, that's your problem
Move the action to a script and it'll work
alright, thank you