#Visual feedback if all script actions were successful?

1 messages · Page 1 of 1 (latest)

copper dagger
#

Hi everyone,
I have a script that is supposed to turn on 3 devices. However, you cannot actually physically see if all three were turned on. But HA sees if they switched on.

Is there a way to see in the frontend by e.g. changing the script icon if all three were turned on?

I would like to achieve this with stock cards/features.

Thank you
Alex

frank cobalt
copper dagger
#

Well, I am unsure because I think my problem is in the script part, but you might be right.

My script is:

script:
  boiler_on:
    alias: 'Boiler On'
    icon: mdi:code-block-tags
    sequence:
      - action: switch.turn_on
        metadata: {}
        data: {}
        target:
          entity_id:
            - switch.boiler_1
            - switch.boiler_2
            - switch.boiler_3

and my template to change the icon is

template:
  - binary_sensor:
      - name: "boiler_all_on"
        state: >
          {{ is_state('switch.boiler_1', 'on')
             and is_state('switch.boiler_2', 'on')
             and is_state('switch.boiler_3', 'on') }}
        icon: >
          {% if is_state('switch.boiler_1', 'on')
             and is_state('switch.boiler_2', 'on')
             and is_state('switch.boiler_3', 'on') %}
            mdi:fire
          {% else %}
            mdi:code-block-tags
          {% endif %}

So for me the question is whether or not I can change the icon in the script based on that template binary sensor.
If I am wrong here, shall I ask an admin to move my question or should I copy it over?

copper dagger