Script with event call & event data?

(I apologize for this being a question instead of a show-off project post, but since it’s script-related, I hope someone can help.)

How do I properly use the event tag in a script? It’s a script that’s called from a picture-entity card. It’s set this way in ui-lovelace.yaml:

- type: image
  image: /local/32px/001-power.png
  tap_action: call-service
  service: script.power

The “power” script in my scripts.yaml is just this:

power:
  sequence:
  - event: CONCORD
    event_data:
      entity_id: input_boolean.concord_power
      source: light.generic_light

I’m trying to use this in accordance with what’s posted here: https://www.home-assistant.io/docs/scripts/#fire-an-event

The event name, CONCORD, is arbitrary. The AppDaemon docs say I can listen for an “arbitrary” event, as it says here:

https://appdaemon.readthedocs.io/en/latest/APPGUIDE.html#use-of-events-for-signalling-between-home-assistant-and-appdaemon

When I click the image with the tap_event, AppDaemon catches it, but without any of the data in event_data.

I’m trying to piece this together for a couple hours, but my greybeard programmer vibe tells me I’m missing something - it may be major or minor, but I’m missing a piece or two.

Any help is appreciated!

This seems to be related to appdaemon, so perhaps https://community.home-assistant.io/c/third-party/appdaemon would be better?

Which event is it that appdaemon catches?
Is it the CONCORD event, or the call-service event?
Also, what does your event listener in appdaemon look like?

Hi Thomas.

It’s a prototype for a remote control card. The problem is that the script is switching an input_boolean and I can’t send any data with an input_boolean - data blocks are illegal for input_boolean types - all it accepts is an event like turn_on or turn_off.

I think I need a dummy service of some kind, where I can send arbitrary data. I just don’t know if I can make one.

My event listener properly catches the CONCORD event, but like I said - I can’t send any additional arguments.

It’s really simple:

self.listen_event(self.power_up, "CONCORD")

and then tries to look in self.args for more data.

I came across the event object, but I don’t know how to “activate” it. As it stands in my post above, the event_listener can hear when it gets touched, but it nothing gets processed and send through.

Also, action is illegal in scripts without action_data following it. But the action_data doesn’t get sent.

I’ve already bugged the heck out of the AppDaemon folks to get it up and running and listening. My goodwill over there might be running thin. :slight_smile:

Is there something “fake” I can create to pack with my data and have a script work on?