Turning off all house lights with automation

I noticed recently that my presence based automation for turning off all the lights and switches in my house wasn’t working. A quick search revealed that it may be to do with the depreciation of groups in the last update (.105 I think.)

Can someone confirm if it’s true that"group.all_devices", “group.all_lights”, and “group.all_devices” are no longer valid? If so, is there a function to replace them?

Correct, the auto-generated groups are no more. You could use entity_id: all with a light.turn_off service call though.

Other options listed here:

Excellent, this helps. Now for the second part of my problem. I have a presence based automation, that turns everything off after a period of time. Is there a better way to recreate this now as group.all_devices has been depreciated?

Code as it now stands:

- id: '1537562738209'
  alias: Away
  trigger:
  - entity_id: group.all_devices
    from: home
    platform: state
    to: not_home
  condition: []
  action:
  - data:
      entity_id: all
    service: light.turn_off
  - data:
      entity_id: all
    service: switch.turn_off

You could manually re-create that group (and any other group you want) and use it in the trigger.

If you have lights of the same type there might be the option to create a group that includes all lights with the native method of control and expose that group as an individual light to Home Assistant (thus the turning off/on commands will be instantly applied case you have several lights that you might want to change in the same time).

It turns out, I had already done this. I don’t know when, or why, but I’m not complaining. I haven’t confirmed that it’s working yet, but I don’t see why it wouldn’t. Thanks a million :slight_smile:

Only works using yaml? Can’t set entity to ‘all’ in (automation) ui.