There is currently no way to set it via command, but no problem, I can add it, if you want.
Out of curiousity, why do you need to configure it via cmd?
Out of curiousity, why do you need to configure it via cmd?
// addEventHandler OnChannelChanged 5 ???
addEventHandler OnChannelChanged 1 setChannel 2 0
Info:EVENT:CMD_AddEventHandler: OnChannelChanged is not a valid event
setPinRole 10 Btn
setPinChannel 10 0
setPinRole 11 Btn
setPinChannel 11 0
setPinRole 26 PWM
setPinChannel 26 1
addEventHandler OnClick 10 setChannel 1 100
addEventHandler OnHold 10 addChannel 1 10
addEventHandler OnClick 11 setChannel 1 0
addEventHandler OnHold 11 addChannel 1 -10
//
// On change listeners
// Full example of on change listeners:
// addChangeHandler Channel0 < 50 echo value is low
// addChangeHandler Current > 100 setChannel 0 0
// addChangeHandler Power > 40 setChannel 1 0
//
//
// LCD demo:
// backlog startDriver I2C; addI2CDevice_LCD_PCF8574 I2C1 0x23 0 0 0
// addChangeHandler Channel1 != 0 backlog lcd_clearAndGoto I2C1 0x23 1 1; lcd_print I2C1 0x23 Enabled
// addChangeHandler Channel1 == 0 backlog lcd_clearAndGoto I2C1 0x23 1 1; lcd_print I2C1 0x23 Disabled
AddEventHandler OnClick 0 addChannel 1 -10 0 100 AddEventHandler OnClick 1 addChannel 1 10 0 100
addChangeHandler Channel0 == 0 echo "First channel is now ZERO"
addChangeHandler Channel0 == 1 echo "First channel is now ONE"
Debug:CMD:cmd [addChangeHandler Channel0 == 0 echo "First channel is now ZERO"]
Info:EVENT:CMD_AddChangeHandler: added Channel0 with cmd echo "First channel is now ZERO"
Debug:API:POST to api/cmnd
Debug:CMD:cmd [addChangeHandler Channel0 == 1 echo "First channel is now ONE"]
Info:EVENT:CMD_AddChangeHandler: added Channel0 with cmd echo "First channel is now ONE"
// Relay is connected to pin 6
setPinRole 6 Rel
// Set external switch pin
setPinRole 8 TglChanOnTgl
// Set led pin
setPinRole 9 LED
// Set button pin
setPinRole 26 Btn
// Assign pin 6, 8, 9 and 26 to channel 1
setPinChannel 6 1
setPinChannel 8 1
setPinChannel 9 1
setPinChannel 26 1
// Set countdown channel
setChannelType 2 TextField
// Set countdown channel(2) to 0 when channel 1 state is 0 or 1
addChangeHandler Channel1 == 0 setChannel 2 0
addChangeHandler Channel1 == 1 setChannel 2 0
p.kaczmarek2 wrote:That's a very nice setup, you can consider posting this as a separate article with a brief explanation of how it works, so I can add a link to that from a Github.
p.kaczmarek2 wrote:Is this a final version?
p.kaczmarek2 wrote:I've been working on a small scripting backend for OpenBeken for a few weeks already (but only mostly on weekends), so soon it will be possible to write small programs to exec on our devices, with IF blocks, GOTOs, delays, etc.
marioalmeida wrote:
Yes, I'll do a teardown post for this device
marioalmeida wrote:
Is there a way to set a channel value from another channel?
setChannel 2 $Channel0
marioalmeida wrote:
Is it possible to get feedback of addRepeatingEvent remaining seconds sent via MQTT?
marioalmeida wrote:
Definitely would like see this
p.kaczmarek2 wrote:
Would a syntax "$Channel0" for Channel0 value be ok?
So:Code:
setChannel 2 $Channel0
that would set channel 2 to current value from channel 0.
addRepeatingEvent $Channel0 1 setChannel 1 0
p.kaczmarek2 wrote:What exactly would you like to receive and how? Please be more specific and I will look into it
marioalmeida wrote:
Will that also be possible for addRepeatingEventCode:This way I can use MQTT to set the countdown instead of HTTP APIaddRepeatingEvent $Channel0 1 setChannel 1 0
Quote:
Debug:API:POST to api/cmnd
Debug:CMD:cmd [SetChannel 13 2022]
Debug:API:POST to api/cmnd
Debug:CMD:cmd [GetChannel 13]
Info:CMD:CMD_GetChannel: channel 13 is 2022
Debug:API:POST to api/cmnd
Debug:CMD:cmd [SetChannel 12 $CH13]
Debug:API:POST to api/cmnd
Debug:CMD:cmd [GetChannel 12]
Info:CMD:CMD_GetChannel: channel 12 is 2022
rcayadi wrote:
P7 - LED (but this led is on when OFF and led off wen ON) how to solve this?
rcayadi wrote:
and then the wifi connection is offline immediately ? first i thought that about limited user in my router but it going off after i try off some wifi it's still happen.
p.kaczmarek2 wrote:
Use LED_n option, which is an inverted LED. Same goes for REL (if you want), there is a REL_N option.
p.kaczmarek2 wrote:
I am not sure what you mean. Is the device still pingable? Is the device responding to the Button, but offline? Or maybe is the device 100% dead?
p.kaczmarek2 wrote:if not, specify how do you drive your lights and show the HA yaml config.
- platform: mqtt
name: "obk06B22AC7"
unique_id: "obk06B22AC7"
command_topic: "cmnd/obk06B22AC7/led_enableAll"
state_topic: "obk06B22AC7/led_enableAll/get"
availability_topic: "obk06B22AC7/connected"
payload_on: 1
payload_off: 0
brightness_command_topic: "cmnd/obk06B22AC7/led_dimmer"
brightness_scale: 100
brightness_state_topic: "obk06B22AC7/led_dimmer/get"
brightness_value_template: "{{value}}"
color_temp_command_topic: "cmnd/obk06B22AC7/led_temperature"
color_temp_state_topic: "obk06B22AC7/led_temperature/get"
optimistic: true
retain: false