Button-card disable button and grey out icon

I am using custom button-card https://github.com/custom-cards/button-card and would like to achieve to call a service. While the service runs the button should be inactive and the icon should be greyed out. How could I achieve that?

type: custom:button-card
entity: switch.ac
icon: mdi:water
color: rgb(28, 128, 199)
size: 10%
name: Rasensprenkler und Microdrip
tap_action:
  action: call-service
  service: opensprinkler.run
  service_data:
    entity_id: switch.s02_rasensprenkler_und_microdrip_station_enabled
    run_seconds: 120

The inactivity of the button could be specified statically - with the same value as run_seconds.

Any ideas?

(An alternative would be to use the button as a toggle. Call the exact service from above and call another service to stop the running service. But how would I use toggle in combination with two different service calls?)

1 Like