OK. I want to write a script that contains the following functions.
2 buttons with script only
2 PWM outputs that are on one channel.
If I should now press a button briefly, the LED should toggle.
Now if I long press I want to run add_dimmer 1 until 100 is reached. It shouldn't go higher than 100 or jump back to 0 or anything.
If I then let go and long-press again, I want to run add_Dimmer -1 until a minimum value is reached. e.g. 5.
When I double-click, I want to issue one or more sendget commands to implement a central command.
Ok now to the script.
The script works halfway. I just can't dim up and down. For this I need a variable that I press every long time Toggle. and thus I distinguish whether I dim up or down.
For example, I don't know how I can query the P26 in an IF, which is only script only.
Or you can also use AND commands in an IF to query 2 conditions.
e.g. If P26==1 and Channel10==1 then goto Dimm_up
If P26==1 and Channel10==0 then goto Dimm_down
Is there an Edge command. Which is only active for the first cycle?
Is there somewhere in the documentation a list of event handlers and ChangeHandler or RepeatHandler etc.
I didn't find anything in the documentation about that
This would be the script I'm running right now:
setButtonTimes 2 1 0
addEventHandler OnClick 6 POWER TOGGLE
addEventHandler OnClick 26 POWER TOGGLE
addEventHandler OnHold 6 add_Dimmer 1 1
addEventHandler OnHold 26 add_Dimmer 1 1
addEventHandler OnDblClick 6 SendGet
http://192.168.1.94/cm?cmnd=Power0%20Toggle
addEventHandler OnDblClick 26 SendGet
http://192.168.1.94/cm?cmnd=Power0%20Toggle
Thank you first of all.
Added after 10 [minutes]:>>20535211
now i have the same problem again. no matter what I do. if I switch on flag 12, then I can't control the LED either via the buttons or via the website. Channel always remains 0
I have P6 and P26 as BTN script only
P7 and P8 as PWM Channel 0
P24 WiFi LED
In the configuration, if I turn flag 12 off and turn on flag 17, I can dim and switch again, but when the LED is off and then long press to dim, the LED doesn't go ON.
If I take a Smart Btn then it works, is that possible?