1) Give a description of the problem
The target is to control four windows blinds (Fibaro Roller shutter 2) with one Heatit Push8 controller. The controller has 8 buttons, four “on” four and “off”. The attached piston works for blind nr 1 by pressing button 1 and 2. I would like to create an efficient code doing what the attached piston does, but also does the same for blind 2-4 by pressing buttons 3-8.
The attached snapshot shows the blind as Dimmer since the DH is build from a Fibaro Dimmer2 DH.
2) What is the expected behaviour?
Instead of creating line 17-45 four times (which I think must be very unefficient) I would like to make
the code “dynamic” as the action (blind 1-4) changes with respect to which buttons are pressed. So button 3/4 applies to blind 2, button 5/6 applies to blind 3 and button 7/8 to blind 4.
I.e. I just want to create an efficient code and not making tons of lines.
3) What is happening/not happening?
The button 1 is closing and 2 opening the blinds. During closing/opening pressing button 1 or 2 will stop the blind
The attached piston works for blind 1, but I suppose there must be a better way of doing it without multiplying the code by 4.
4) Post a Green Snapshot