Help needed for generic automation variants

Hello Community,

as all my posts till now, Newbee Questions :slight_smile:
as already written, I’m new to Home Assistant, but spent the last three days playing around and thinking if I should migrate my automations from OpenHAB to Home Assistant.

right now I’m playing with automations and I’m a little bit stuck.
what I want to achieve:
I have some homematic light switches, and I have some hue bulbs. On the HUe bridge I have grouped them, and have some scenes. The groups are associated to my rooms, but one room can have more than one hue group.
What I ultimately want to do: I want to press a button on my wall-mounted tablet and start a particular scene (like dinner, breakfast, TV, etc.). In order to achieve this I need to check the state of my homematic switches and perhaps turn them on. If i turn them on, i need to wait some seconds (3 are mostly enough) to push the desired hue scenes to the groups. so far so good.
What I also want to achieve is to keep my automation codebase pretty generic, so basically I want to use the same “module” for all my rooms. (Thats one of my current painpoints in openhab, since openhab is not really good in abstracting such things, and I have everything multiple times, for each room).
so back to home ASsistant:

  • I built above with an appdaemon app - that works, but I cannot really find a smooth way to start the app. The only way I found is with a Helper element that holds the data (light entities, and their hue group and scene key/value pairs). but as it seems there is no way to trigger a appdaemon app directly from e.g. a lovelace card?
  • I tried with a Home ASsistant Scene, but this cannot handle the delay I need between
  • I built a Home ASsistant Script, which can handle basically everything, but i’m not able to make it generic enough. I would need to hand over a variable amount of scene_name and group_name key/value pairs to the hue.hue_activate_scene. I tried it with a for loop around the service call, but it doesn’t really work. What could be cool here, is that I could at the script directly in a lovelace card, and perhaps it would also be possible to hand over some data via lovelace.
  • I built a python script in Home ASsistant. That was relatively easy, but I cannot add a delay.
  • I havn’t tried nodered. I did this already some months ago, but it’s not my tool :slight_smile:

so long story short, how are you guys doing things like that?
Are there any kind of design patterns which are working and proof?



I spent some further hours, but I’m not getting wiser.

On my above mentioned topic regarding my homematic switches I basically ended up with doing it in an AppDaemon App triggered by a selection_input field. I put my hue groups and ids and scenes in an attribute of the helper and so I can configure it without touching the code. so far so good.

Next topic was/is: Definition of a “Room Scene” - i called it like this in a past.
What I mean with it: Set correct light, enable/disable a couple of Devices (e…g picture frame), turn on music, etc.
I though it could be nice making a Scene in Home Assistant too, but I’m somehow not able to do.
for instance my Bose Soundtouch, does have some Presets, and i want to turn it on playing a specific radio. Adding the soundtouch entity doesn’t work (makes also sense it obviously doesn’t have the presets), so I made a Script (in Home ASsistant) to start it. The script itself is working, I can also add the script to the scene, but when running the scene nothing happens.

Perhaps someone may share his or here experiences with setting multiple devices (or entities) in one room at the same time?