I am new to HA but I am reading a lot how I can transfer all my programs from Homematic to HA.
Yesterday I wrote a little program for a light in a small room. That room is that small so I only use a opening-sensor and the light. Door open = light on / door closed = light off.
This program does work, as long as I check against the lamp state itself in the action options. But I saw I can also use the trigger ID function to check against in the action options. So I changed the program, but now the lamp only turn on and never off again.
My question now, what did I do wrong, I don’t geht it. Here is the code of it:
Ah, ok, thanks for your hints. I know this with the devices / entity problem from Homematic, there I solved this with variables and only got one program per device to change the variable. I didn’t know the naming here but now I am a litte smarter
Anyway. I changed my program and now nothing works anymore:
Yes, I creating this programs with the GUI. In the 21th century this should be possible, I got enough work with codes with my µc at work.
No, I didn’t test the program with the GUI. I walked down the stairs to test it
Trigger ids are numbered from 0 by default. So even if you left the ids out your triggers your automation would still work with the choose conditions you have.
You only need to specify the id if you want something other than numbered ids. e.g.
Ah, ok, then I will change my code. Nice to know these trigger ID rules and also that I don’t need the IDs at all here.
Anyway, I want to implement this to get the knowledge and to be able to copy this program to many other light scenarios. This refrigerator light mode I only need 2 times in my house. Most of the other ones are dimming or hue lamps controlled by motion sensors and switches.
I don’t know how I could select to options in “from” or “to” at the trigger section. Also I don’t know what to choose at the action section for the switch.turn “trigger to state”.
My program was created with the GUI and I want to avoid “coding” as much as possible. With Homematic I only needed some scripts for speech output with Alexa, but this was only nice to have. Everyting else I could do with the GUI. I am not alone at home and at one point maybe my wife ormy childrens should also be able to maintenence the system.
Another question about this “attribute”. I wanted to use a switch in another program, also as entity at the triggers. But I only get it to run if I remove the attributes and select “from: any status” “to: any status”. But this way I can’t seperate short or long press. As soon as I choose in attribute the “event”, I can select short and long press, but where do I put them, in the “from” or “to” field?. Anyway, I almost tried every combination and none worked, the program doen’t trigger. Only when I remove the attributes.
Any hints?
Oh, and one surprise, when I use the switch as “device” in the trigger, it works fine so far. But yes, I would like to implement it as entity if possible.