Did anybody already create something so that it is easy to disable a AppDaemon automation? I know I could create an input_boolean and check that but I wonder if there are perhaps better solutions.
Using the set_state I can create the relevant automations programmatically (using this) but when I then enable multiple automations at once, it fails (due to entity_id being a list instead of a string)
Like @ReneTode said, friendly_name is something I set on almost any entity created in AppDaemon, but, there’s hardly any programming involved with that. Most of my apps allow for a “friendly_name” configuration element, and that is simply passed on in the attributes of the sensor that I publish to Home Assistant.
For last_triggered, In the rare cases where I feel the need to publish an “automation” entity to Home Assistant, then I’ll make sure last_triggered is set so that it looks and acts like any other automation entity in Home Assistant. And, while I’ve done this in the past, currently, none of my 150+ AppDaemon apps publish a “automation” entity. For me, it’s just extra work with no reward.
If I need an AppDaemon app that can be triggered in a Home Assistant automation, I generally use an “event” for that. There’s less setup involved and the Home Assistant YAML isn’t any more difficult to write.
I also only publish entities or attributes that I need to use in a Home Assistant automation. For instance, I have an AppDaemon app that monitors alarms set on Alexa devices, and, when the alarm time comes, the AppDaemon app triggers specific scripts in Home Assistant (I use this for multi-room notification of a kitchen alarm, as well as sunrise style wakeups in bedrooms). There’s nothing about that particular app that I need to see in Home Assistant. It watches the alarms and calls the scripts at the appropriate times. So I don’t publish an entity at all to Home Assistant.