I made an update of my original post above showing how to do the same function using the new HA version 0.113 automation features. Now you can do is all with one automation which makes it simpler to overview and maintain.
Since I posted my original post I have put all HA config on github. You can find more examples there using the dimming method with deconz
Thanks for sharing @KennethLavrsen , thatās really cool and just want I needed! Reduced 5 individual scripts down to one and I had got stuck on the stop dimming bit! Thanks againā¦
Iāve changed this to āā¦ not in ( 2001, 3001 )ā¦ā this seems a bit more reliable. Some times I had that the automation kept dimming even after i stopped turning.
If I just use event: 1002 and remove the templating, it works perfect.
But I want it to perform the same action whether its an on button press or off button press.
I know I could just make an additional trigger, but Iām pursuing this in order to learn.
Fantastic! Thank you so much.
But did you mean; āYou canāt template an event like thisā or did you mean; āYou canāt template an event at allā ?
() defines a set and [] defines list. The main difference is that sets canāt have duplicate items and are unordered. For this application (x in y) a set is more efficient, but it doesnāt matter at all for this kind of use cases.
These things that we talk about here (templates doās ond donāts, parenthesis, square brackets etc). How on earth can I learn these things? What is generic yaml syntax rules and what is HA-specific custom rules? To me, itās a mystery how people manage to learn this. Especially templating stand out as a syntaxic chaos
In my days we learned Fortran, Pascal and Cobol, and everything was based on simple distinct rules (building blocks) that never changed. The logic was based on a bottom-up abstraction. The HA docs appear to me as a top-down structure. My only hope is to find an example that somehow resembles as closely as possible, something that looks like what Iām trying to accomplish.
I then have to try to break it down to manageable pieces and trialānāerror along until it works (or until I give up - whatever comes first).
The thing with searching for syntax symbols like a [ or ( is that you get too many hits.
Burningstones good answer helped me searching the documentation. So let me wrap it up for those that come by and read the thread.
So it seems in Jinja you can have lists like [alpha, bravo, zulu] and tuples like (alpha, bravo, zulu). So tuples, not sets. I cannot see that you can use Python syntax for sets which would be in {}. I tried and get an error and I cannot see it in the documentation either. It seems that tuplets may have a speed advantage over lists with the in but that would only be noticeable if the number of values was large. So for this specific use both will work.
The Jinja documentation reference for lists and tuples is here
Thanks for your hint. What Iām loking for
Basically what Iām focusing is to find a way to use the knx switch.
The best would be to be able to use directly the KNX address as input(trigger) to control a hue light.
Additional question hue
Using the hue zigbee accessories, do you have a better response time than using them via the hue bridge?
Swisscom
I see that you are a swisscom user, do you have a swisscomTV ? If yes did you manage to make it working via the Ubiquiti security gateway?