Hi,
I’m setting up an actionable notification. Everything works as expected, except that I want to show different action buttons depending on the trigger - Without having to set up a notification for each case. (The case here is: If phase 1 current is too high, only show buttons for switching to phase 2 and 3. If phase 2 is too high, only show buttons for 1+3. And so on.
Currently the action looks like this. It shows all three buttons regardless:
action: notify.my_device
data:
message: The charger is using too much power. How do you want to handle it?
data:
push:
sound:
name: default
critical: 1
volume: 1
actions:
- action: "{{ action_pause }}"
title: Pause
- action: "{{ action_switch_to_l1 }}"
title: Change to phase 1 ({{ states('sensor.current_l1') | round(1) }} A)
- action: "{{ action_switch_to_l2 }}"
title: Change to phase 2 ({{ states('sensor.current_l2') | round(1) }} A)
- action: "{{ action_switch_to_l3 }}"
title: Change to phase 3 ({{ states('sensor.current_l3') | round(1) }} A)
Based on the trigger id I want to do something like this (has a bit of pseudo code in it since I don’t know the syntax)
action: notify.my_device
data:
message: The charger is using too much power. How do you want to handle it?
data:
push:
sound:
name: default
critical: 1
volume: 1
actions:
- action: "{{ action_pause }}"
title: Pause
if (trigger != 'l1')
{
- action: "{{ action_switch_to_l1 }}"
title: Change to phase 1 ({{ states('sensor.current_l1') | round(1) }} A)
}
if (trigger != 'l2')
{
- action: "{{ action_switch_to_l2 }}"
title: Change to phase 2 ({{ states('sensor.current_l2') | round(1) }} A)
}
if (trigger != 'l3')
{
- action: "{{ action_switch_to_l3 }}"
title: Change to phase 3 ({{ states('sensor.current_l3') | round(1) }} A)
}
Is it possible? I know that I can create three different notification actions, but I want to avoid that.