Why does lovelace complain about this tap_action?

I’m not sure if this is still just the case of the Lovelace UI editor not being complete, or if I’ve really done something wrong?

The idea is that the sensor is a waterleak sensor, but it only has an ‘alert’ state, and doesn’t send an ‘dry’ message.
So when it alerts it will stay alerted, and then I could just click the icon in the UI to reset it.

I have a glance card with an entity like this:


  - entity: binary_sensor.waterleak_bathroom
    tap_action:
      action: call-service
      service: mqtt.publish
      service_data:
        payload: '33C112OFF'
        qos: 1
        topic: tele/rfbridge/RESULT

But then the UI editor gives me this:

Expected a value of type `{entity,name,icon} | entity-id` for `entities.5.tap_action` but received {"action":"call-service","service":"mqtt.publish","service_data":{"payload":"33C112OFF","qos":1,"topic":"tele/rfbridge/RESULT"}}`.

Is it just the UI, or did I write it wrong?

Besides the code, isn’t there an option to ‘reset’ the alart/dry state? Do you have a sensor there?

fyi: I have a doorbell with only one state, ring. So when the doorbell is pressed, the state changes and after 3 seconds the status is ‘empty’

I use this:

  - platform: mqtt
    name: "Doorbell"
    state_topic: "tele/sonoffrf/RESULT"
    value_template: '{{ value_json["RfRaw"]["Data"].split()[8] }}'
    expire_after: 3

The expire after does the trick

Yes, I’ve used that elsewhere, but as this is flood alert I don’t want it to ‘go away’ until I acknowledge it.

Ok, I understand :slight_smile:

I am not in the code, hope someone else can help you there :blush:

Other people have reported this same issue in the past:

Perhaps the Lovelace UI editor continues to be unable to handle this configuration because, based on comparisons with other examples, it appears to be correct.

You may have reached a level of complexity that requires you to change to Lovelace YAML mode whereupon you will be editing the configuration using a text editor and not via Home Assistant’s GUI.

Does the same thing works when you call mqtt service from development?

I just monitored with mqttbox, and it sends the command as it should, both from the tap_action and from the service, it doesn’t work however that I send out an mqtt.publish, because I need HA to pick it up itself, to translate it, and it won’t do that as far as I can see.