I have created an automation that switches on the pump for the garden irrigation when the button ‘wasser_30_min’ is pressed, runs it for 30 minutes and then switches it off again.
I found out that the information whether the automation is running is in the attribute ‘current’.
The automation works so far. However, I would now like the button to show that the automation is running and how long it is still running. How would you go about it?
alias: Gartenbewaesserung_30min
description: ""
trigger:
- platform: state
entity_id:
- input_button.wasser_30_min
condition: []
action:
- type: turn_on
device_id: 81db6e7380ebf1d623bb57f6a88d4de3
entity_id: switch.gartenpumpe_einschalter
domain: switch
- delay:
hours: 0
minutes: 30
seconds: 5
milliseconds: 0
- type: turn_off
device_id: 81db6e7380ebf1d623bb57f6a88d4de3
entity_id: switch.gartenpumpe_einschalter
domain: switch
mode: single