Action Filter - To Include or Exclude

It would be really nice to have action filters.

  filter:
    include_entities:
      - light.living_room_light
      - light.bedroom_light
      - switch.desk_light
      # all entities
    exclude_entities:
      - light.living_room_light
      - light.bedroom_light
      - switch.desk_light
     # all entities
    include_domains:
      - switch
      - light
    exclude_domains:
      - script
      - scene
      - automation

You could use it in a lot of places but one place that would be nice is when we use

      - alias: "Whatever you are turning on"
        service: homeassistant.turn_on
        target: !input whatever_you_like
        filter:
          exclude_domains:
            - automation
# and
      - alias: "Whatever you are turning off" #can't turn off a scene and will stop error logs
        service: homeassistant.turn_off
        target: !input whatever_you_like
        filter:
          exclude_domains:
            - scene
            - automation

This would be nice, easy and clean if we had this option.

You can use a template in the target to be as selective as you like.

Hi Tom, yes we could do that but the problem I have is when using a target as a selector someone selects an area for ease of selecting and then it turns on or off all the automations in that area (not good), and when someone selects a scene in the target we can turn it on with homeassistant.turn_on but because we cant turn off a scene, then when we use homeassistant.turn_off it will throw a log. So really homeassistant.turn_off doesn’t support scene as a domain to turn off as you can’t turn off a scene. If I have the filter I can exclude the domain scene (this will stop the logs) and we could also exclude the domain automation.

Then when and if someone tries to use homeassistant.turn_off for a scene it will throw a log and they can fix it because they can see the log, but if you know homeassistant.turn_off can’t turn off a scene then you just add the filter and you don’t get the logs.

My main concern is trying to use homeassistant.turn_off with a scene in the target along side with lights, switches, areas and devices and not get the logs. I can’t just input the scene entity in because it can change and or have multiple scenes. So I need it to filter out the domain scene in homeassistant.turn_off.

any ideas?

So for blueprints?

Yes thanks Tom :smiley: