Hey guys,
It would be good to be able to use templates in actionable notifications, so that only one action is sent depending on the state of a device.
For example, I can create a notification with a message that sends me the state of a temperature sensor and the state of the heating switch. It would be good to only send the action that is relevant, so if the heating is currently on, send a “heating off” action and vice versa.
The message attribute supports templates, it would be good if the action and title also supported it.
I tried this for example:
data:
actions:
- action: "heating_{{states.switch.heating.state}}"
title: "Heating {{states.switch.heating.state}}"
message: >-
The temp is {{ states.sensor.living_room_temperature.state }} and the heating
is {{ "on" if is_state("switch.heating", "on") else "off" }}
But this just sends the notification literally i.e heating_{{states.switch.heating.state}} appears in the button.
I tried also using {% if states… %} also which gives the same result.
Hope that makes sense!