Hello, i recently started my home assistant experience and i am running into an issue that google cannot solve for me. i am experienced in many programming languagues but not yaml and since supervisor mode is not possible on my synology nas, i am force to use home assistant instead of node red for this problem.
the situation is quite simple. i have 3 lights controlled with 3 times the dimmer 2 from shelly.
i want to use 1 of the inputs of the switch inputs of 1 of the shelly dimmers to dim all the brightnesses of all 3 lights at once and 1 of the switch inputs to make all 3 of them brighter.
i was thinking of using an automation for this but i cannot make any variables to store the state state of the current light in.
the prefferd situation would look like this:
if btn 1 is pressed:
case (status)
0: set status to 20 // meaning set brightness from 0 to 20%
20: set status to 40
40: set status to 60
60: set status to 80
80: set status to 100
100: set status to 100
if btn 2 is pressed:
case (status)
100:set status to 80
80:set status to 60
60:set status to 40
40:set status to 20
20:set status to 0
0:set status to 0
of course this isn’t yaml but i hope someone can give me a start on how to approach this.
the main problem i run in is not being able to read the brightness state so i can copy it over and being able to set the brightness state.
please let me know if there is any information missing or if there is already a similar post somewhere that i missed. thanks in advance.
entity ID of dimmers:
1: light.shellydimmer2_3c6105e4a3c7
2: light.shellydimmer2_e8db84d6e0cb
3: light.shellydimmer2_e8db84d6a003
Should be pretty easy, what are the button entity ids for the first dimmer?
Also you know you can change those light numeric entity id’s to be something meaningful?
Click on the entity in the Configuration / Entities list and change it - if you have not used it in a script or automation yet. Otherwise you have to update all those too.
I tried to change those to something meaningful and it shows up in the Lovelace view as a completely different name. but for some reason the entity id’s have not changed their name. i have no clue yet how to change this at this point but will try to figure that out.
after some searching, i found that i have no entity ID’s for the buttons attached to the dimmer. in the shelly app i can use it but in home assistant i cannot see them unfortunately. if anyone has any experience with this how i can make this visible i would appreciate that really much.
but in case the entity id would be xyz1 and xyz2, how would i approach this problem? should this be made in automations or as a script or how?
wow, i did not expect to get the full code out of this! this is really appreciated! however i get the error that a dictionary is needed. i am not sure if this is any plugin that i need to download, or if this is just a bracket issue like it is in python.
after checking the configuration and making sure it is valid,
i tested the code and it does turn on all 3 lights by clicking the switch.
however it only happens after 12 seconds holding switch 1, and after that i cannot make it more brighter or set it back to zero.
if i check the logbook, also only after 12 seconds holding the button, it pops up in the logbook.
Go to Configuration / Automations, find the dimmer automation, look at the automation trace for the last time it triggered by clicking on the clock icon to the right of the automation name.
is there a way to see live if a button is pressed ?
cause if i check the history of the entities as shown below, it displays that the 2nd channel input was never pressed.