I’ve been trying to make a group and other possible solutions which I’ve fou d on YouTube and here. Not succeeded.
What I want is to create one button to switch All lights of when I go to bed. Not toggle because some are possibly already off. Some with a solution or link to a solution?
What exactly have you tried? and what didn’t work about it?
I would think that a group would have been the correct answer.
Or just putting all the lights you want to switch off together in a Lovelace card and then you will end up with a switch at the top of the card that also allow you to switch all of the entities in the card on or off at the same time.
How about a scene
Create a sence in the configuration page with all the devices and entries you would like.
Set the values in the scene to off for all the devices in the scene.
Create an automation that actions the scene
Helpful link
if it helps here is the code in my scenes.yaml for my christmas lights
- id: '1576871841018'
name: Turn off all Christmas lights
entities:
switch.christmas_path:
friendly_name: Christmas Path
state: 'off'
switch.christmas_tree:
friendly_name: Christmas Tree
state: 'off'
Put the switches together in a group, then add an entities card with that group in your ui. This should result in a single switch that operates all grouped lights (explicit on/off, not toggle).
That’s why I asked what you have tried so we can stop guessing at what you have tried and why it “didn’t work”. It makes it easier to give suggestions.
After this I have added a entity card in lovelace. Now I have one switch with on/off for all lights and switches (conneccted to lights) in the bottom floor.
Thank you. for this great support. I didn’t put in the youtube links because I have been watching Youtube for several days and did not know all the visited links.
Something that pulled me up a while was adding a group to the group.yaml file instead of in the configuration.yaml, just remove the “-platform: group” line eg
usually it’s standard practice to credit the “solution” selection to the post that solved your problem. If you solved it yourself then you would give it to yourself. I don’t think that’s the case here since someone else pointed you to the solution.
Might flick an email to the moderators, I hear what you are saying finity, if I’ guessing what has happen Mark has selected his post as the solution which it is yet in the first post it say solved by which to me is different.
For me solution is the end goal that anyone can look at to see the code, solved by are the key people that helped you get there.
Maybe have a solution and solved by links in the posts or at least have the wording of the tick and quote in the first post to match.
It was not to give myself the credits. It was indeed to describe the solution and mark it as the solution for future readers not having to read the whole thread. Sorry if it doesn’t work this way. My bad then.
just for those coming across this in 2021, i solved this using groups and groups of groups. That seemed to give me the most flexibility and ease of maintenance