Hi there, I’m not sure which switches you are using, and how Home-assistant detects a single click from them, but I will provide an automation that will cycle thru 0% (off), 33%, 66% and 100%. I will be using an Aqara button to simulate your switch, so you will have to make changes to the trigger to fit your switches. So, this is a quick and dirty automation that will get the job done:
This automation will start from the bulb being off - 0% to 33% to 66% then to 100%. You might find that you will want to change it so when you first click the button while the light is off it will go to full brightness 100% and the go to 66% and so on, but that’s what so cool about his you have so many options.
when i copy and pasted, replaced with my device ID, it’s showing ‘‘Message malformed: extra keys not allowed @ data[‘actions’][0][‘choose’][3][‘conditions’][0][‘state’]’’
I just used the copy option form the top right corner of the automation and pasted it into a text document and renamed it to toggle_brightness_automation.yaml, and it did not give me any errors when I checked the config. From the error that you are getting, I believe you are somehow getting extra characters in the automation, ones that you can not see. I would recommend downloading something like Notepad ++ and copying and saving with that, I think that will clear up your issue.
it’s Automation editor, I am not aware where automation.yaml is.
I do not wish to make changes to the main file, I just want to add another ‘automation’ under the automaton tab.
So, it looks like you are using the Automation Editor, I can not show you how to transcribe this automation to the editor, but I can show you a way to add it. Go into your Home-assistant config folder and create a directory call “automations”. Once that is done open up your configuration.yaml which is also in your config folder and add this line somewhere near the top:
automation: !include_dir_list automations/
Now open your newly created automation folder and create a text document and give it a name, whatever you want, and make sure .yaml is at the end (my_automation.yaml). Open this text document and paste the automation into this, and save and close. Now restart Home-assistant, and when Home-assistant comes back online your automation should be active. Sorry I don’t have much experience with the Editor, but when I started this did not exist, I have been writing them by hand for a while now.
I completely understand your logic, I am looking for a solutions just to use the ‘automation editor’ and makes a few changes inside its ‘yaml’ editor, but I will make notes how you do it!