alarmo icon indicating copy to clipboard operation
alarmo copied to clipboard

Configure actions on labels

Open jftanner opened this issue 8 months ago • 11 comments

Checklist

  • [x] I checked for similar existing requests (both open and closed) before posting.
  • [x] My request is generic, other users may benefit from it too.

Proposal

I would like to be able to select labels (or areas, etc) when configuring actions, rather than only entities. Ideally, the actions should support any of the targeting modes for services.

Additional info

This works in an action to trigger a single light to turn on full red, then flash for a while:

# Turn on one light to full red.
- service: light.turn_on
  entity_id: light.back_downlight
  data:
    rgb_color:
      - 255
      - 0
      - 0
    brightness_pct: 100
    transition: 1

# Make it flash for a while
- service: light.turn_on
  entity_id: light.back_downlight
  data:
    flash: long

However, to do the same for multiple lights, I would need to a) create two more service calls for each one, or b) create a script and trigger that. Either option is excessively complicated.

Instead, it would be preferable to use something this:

# Turn all the lights to full red.
- service: light.turn_on
  target: # Note the target field.
    label_id: loft_alarm_lights # Note that this is label_id instead of entity_id (though that could be used as well)
  data:
    rgb_color:
      - 255
      - 0
      - 0
    brightness_pct: 100
    transition: 1

# Flash the two downlights for a while
- service: light.turn_on
  target:
    entity_id: # Note that entity_id can also be a list (as can the others)
      - light.front_downlight
      - light.back_downlight
  data:
    flash: long

These list items work as expected in the service dev tool, so presumably it's just a matter of having Alarmo pass along the target field (and not breaking the yaml when loading the UI view, which happens now.)

This would make Alarmo actions a lot easier to set up without making a bunch of extra scripts.

jftanner avatar May 25 '24 05:05 jftanner