But with Flag 17 it is not possible to switch on with Smart Button when the LED is off and you press directly long the button. You know what I mean?
And is it possible to select the steps how fast the Smart Button increases?
Czy wolisz polską wersję strony elektroda?
Nie, dziękuję Przekieruj mnie tammplum wrote:
But with Flag 17 is Not possible to Switch on with Smart Button when the led is off and you Press directly Long the Button. You Know what i mean?
mplum wrote:
And it is possible to select the Steps How fast the Smart Button increase?
// SetButtonTimes [ValLongPress] [ValShortPress] [ValRepeat]
// Each value is times 100ms, so: SetButtonTimes 2 1 1 means 200ms long press, 100ms short and 100ms repeat
// Default is:
SetButtonTimes 10 3 5
SetButtonTimes 10 3 1
SetButtonTimes 10 3 10
mplum wrote:OK with the Smart Button is working. The lights going on when you press hold the button.
With the time i need to check. But i think this is what i will change.
Is the step also possible to change with a command?
in The moment the step is 10%.
.
mplum wrote:
Some other question, is it possible to send messages from one cb3s to another cb3s. i will relaize a zantral On / off function. when i press one button on a cb3s then all other cb3s hearing this und switch on or off?
I think about Home assistent and use an MQTT Broker. But Home Assistent needs few minutes to start on the raspberry.
I will use it in my mobilehome. so its important for me that start in a few seconds.
SendGet http://192.168.0.112/cm?cmnd=Power0%20Toggle
addRepeatingEvent 5 SendGet http://192.168.0.112/cm?cmnd=Power0%20Toggle
addEventHandler OnClick 8 SendGet http://192.168.0.112/cm?cmnd=Power0%20Toggle
addChangeHandler Channel1 == 0 SendGet http://192.168.0.112/cm?cmnd=Power0%20OFF
addChangeHandler Channel1 == 1 SendGet http://192.168.0.112/cm?cmnd=Power0%20ON
mplum wrote:
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.
// let's say channel 20 is a dimmer direction
$CH20 = 1
// at start, this will add $CH20 value to dimmer, which is 1 now
addEventHandler OnHold 26 add_Dimmer $CH20 1
// but if you do something like this:
setChannel 20 -1
// now the event handler will add -1 value, not 1
mplum wrote:
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
if $CH10==1 then do_smth
mplum wrote:
Is there an Edge command. Which is only active for the first cycle?
mplum wrote:
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
mplum wrote:- how can i use add_Dimmer with an IF? see on the last lines in the script. This is no working. The log said: fourth argument always must be 'else', but it's '-1'
// once, at startup:
alias MySetDimmerDay led_dimmer 15
alias MySetDimmerNight led_dimmer 88
// somewhere inside loop
if $hour<10||$hour>20 then MySetDimmerNight else MySetDimmerDay
mplum wrote:- how can i use 2 or more actions with an IF? The backlog is not working. for exampel: if $CH11==1 then backlog add_dimmer -1 1; echo dimm_up'
// once, at startup
alias Do_Dimmer_Up backlog add_dimmer -1 1; echo dimm_up
// later, when you run your script
if $CH11==1 then Do_Dimmer_Up
mplum wrote:
- how can i select onHold with the IF, For Exampel If OnHold 26 then echo Hold26
addEventHandler OnHold 5 addChannel 4 10
mplum wrote:
And the Group Adress send is not working fine. When i start both moduls. and i make double click then only the local unit going on. when i make a 2nd double click then the 2nd unit going also on. but only the first time after restart. After restarting i waiting for the connectio to the wifi, then i make the test.
// when channel 1 becomes 0, send OFF
addChangeHandler Channel1 == 0 SendGet http://192.168.0.112/cm?cmnd=Power0%20OFF
// when channel 1 becomes 1, send ON
addChangeHandler Channel1 == 1 SendGet http://192.168.0.112/cm?cmnd=Power0%20ON
p.kaczmarek2 wrote:In general, backlog should be working in this case, but for now, same as above. See your modified example below:
p.kaczmarek2 wrote:I am sorry, but I'm afraid I am not sure what you are trying to do. OnHold is an event that is thrown at given time, it's not persistent. The correct OnHold usage is following:
p.kaczmarek2 wrote:I am currently not sure what the problem is, can you provide more information?
Maybe you could just come up with a simple scenario with two or 3 devices and give me an example what is not working?
Your script is currently very complicated.
The device groups should work good without any scripting. Just set them up via GUI.
In worst case you could use HTTP instead:
addEventHandler OnDblClick 6 backlog DGR_SendPower All_on 1 1; POWER ON
addEventHandler On3Click 6 backlog DGR_SendPower All_on 0 1; POWER OFF
addEventHandler OnDblClick 6 backlog startScript sendAllOn.bat; POWER ON
addEventHandler On3Click 6 backlog startScript sendAllOff.bat; POWER OFF
// send several time, just to be sure
DGR_SendPower All_on 1 1
delay_s 0.1
DGR_SendPower All_on 1 1
delay_s 0.1
DGR_SendPower All_on 1 1
delay_s 0.1
// each IP is next light
SendGet http://192.168.0.100/cm?cmnd=POWER%20ON
delay_s 0.1
SendGet http://192.168.0.101/cm?cmnd=POWER%20ON
delay_s 0.1
SendGet http://192.168.0.102/cm?cmnd=POWER%20ON
delay_s 0.1
SendGet http://192.168.0.103/cm?cmnd=POWER%20ON
delay_s 0.1
p.kaczmarek2 wrote:// send several time, just to be sure
DGR_SendPower All_on 1 1
delay_s 0.1
DGR_SendPower All_on 1 1
delay_s 0.1
mplum wrote:
I think I found the problem with flag 12.
If you activate the Flag12, then submit, then save and if you then restart directly without having sent an LED command once, it won't come out of there anymore.
If you set Flag12 submit and save and then dim back and forth a bit and then restart. Then everything works.
mplum wrote:
And another problem with the command:
ClampChannel 0 5 100
I have it in my autoexec.bat script and my LED always goes on when I restart. Should that be so? I thought that just sets the limits.
p.kaczmarek2 wrote:Hmmm flag 12 only saves LED state on change so it is basically expected. But we assume that users set flag 12 at the beginning of configuration so it's not the big deal that first state after setup is not saved, is it?
Or do you mean there is another problem?
p.kaczmarek2 wrote:This is incorrect. That command clamps channel value at the time of execution. In case of bulbs, it is operating on raw PWM values, which is not recommended. So basically, it will clamp PWM 0 (red color?) at the device startup to [5,100] range, so if PWM 0 is 0 it will set it to 5, ignoring the led state.
TL;DR: 13 A single-channel FUT036W drivers can be tamed with OpenBeken 1.15.663; “dual-MOSFETs share one PWM for higher current” [Elektroda, p.kaczmarek2, post #20521323] Configure PWM pins, Smart-Button roles, and Flag 12 correctly to restore full web and local control within 3 reboots. Why it matters: avoids dead-LED and overheating faults in camper lighting.
• FUT036W rating: 12-24 V DC, 13 A max [Elektroda, mplum, post #20521163] • BK7231 chips expose 6 hardware PWM pins; others flicker [Elektroda, p.kaczmarek2, post #20521194] • OpenBeken build fixing multi-PWM UI: v1.15.663 (7 Apr 2023) [Elektroda, mplum, post #20529781] • TuyaMCU UART baud: 9600 bps typical (“simple protocol”) [Elektroda, p.kaczmarek2, post #20521194] • Flash endurance: ≥100 k erase cycles; OBK slices writes to 64 B, extending life ×128 [Elektroda, p.kaczmarek2, post #20554657]