Trying to run multiple services from custom button card on tap_action

I’ve created a button for my waterleak sensors, and it works rather well.
I want to expand the lovelace alert to send out via webpush also, and thus, if the alert is stopped in lovelace, I want it to disappear from the other devices, as it is no longer required.

So now the tap_action is going to do both a mqtt.publish and a html5.dismiss, and as I read the docs, that’s not doable.
So I will move that to a script with a sequence.

But the sequence complains about the html5.dismiss service.

resetwaterleakbath:
  alias: "Fjerner alarm på lovelace og html5 webpush"
  sequence:
    - service: html5.dismiss
      data: 
          tag: waterleakbathalert
    - service: mqtt.publish
      data:
        payload: '{"RfReceived":{"Sync":10140,"Low":320,"High":920,"Data":"33C112OFF","RfKey":"None"}}'
        qos: 1
        retain: false
        topic: 'tele/rfbridge/RESULT'

I also tried to format it like this:

resetwaterleakbath:
  alias: "Fjerner alarm på lovelace og html5 webpush"
  sequence:
    - service: html5.dismiss
      data: >-
        {
          "data": {
            "tag": "waterleakbathalert"
          }
        }
    - service: mqtt.publish
      data:
        payload: '{"RfReceived":{"Sync":10140,"Low":320,"High":920,"Data":"33C112OFF","RfKey":"None"}}'
        qos: 1
        retain: false
        topic: 'tele/rfbridge/RESULT'

But that didn’t work either. Any ideas?

remove >- or format it via yaml instead of json.

    - service: html5.dismiss
      data:
        {
          "data": {
            "tag": "waterleakbathalert"
          }
        }

or

    - service: html5.dismiss
      data:
        data:
          tag: waterleakbathalert
1 Like

Of course, thankyou @petro You are a gem!

1 Like