Custom button card tap action

I thought this would be easy but can’t find find it.
When the value of a sensor on my buttoncard is true (in my case == Woensdag) then the card starts blinking.
When i press the buttoncard i want it to stop blinking and change the card in the state where the value was not true.
I can’t find a tap action to do this.

type: custom:button-card
show_entity_picture: true
name: HUISVUIL
entity: sensor.huisvuil
show_icon: false
styles:
  card:
    - height: 120px
    - background: '#3b4049'
  name:
    - color: White
    - font: 25px/20px Arial
state:
  - operator: '=='
    value: Woensdag
    color: red
    show_icon: false
    styles:
      card:
        - background: grey
        - animation: blink 2s ease infinite
      name:
        - color: black
        - font: 25px/20px Arial
tap_action:
  action: ???????

You can’t change the state of a sensor (permanently) as its state is dictated by the thing it is sensing.

You can change the state of a helper eg: input_boolean. You could have an automation that changes the input_boolean to ‘on’ when sensor.huisvuil changes to Woensdag

You then set the button to flash when that input_boolean is on. Your tap_action would then be to turn that input_boolean to off.

tap_action:
  action: call-service
  service: input_boolean.turn_off
  data:
    entity_id: input_boolean.your_booolean_name
1 Like

That did the trick.
Thank you so much !!! :smile:

Glad it worked!

Please consider marking my post with the solution tag which lets others know your question has been answered and can help if they have a similar issue.

I always do that but can’t see it now ??? :thinking::thinking: