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?
Helpful post? Buy me a coffee.
Out of curiousity, why do you need to configure it via cmd?
Czy wolisz polską wersję strony elektroda?
Nie, dziękuję Przekieruj mnie tam// addEventHandler OnChannelChanged 5 ???addEventHandler OnChannelChanged 1 setChannel 2 0Info: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:setChannel 2 $Channel0
that would set channel 2 to current value from channel 0.
addRepeatingEvent $Channel0 1 setChannel 1 0p.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 addRepeatingEventThis 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
.
Quote:
Info:MAIN:Module reboot in 1...
Debug:CMD:Adding command SetPinRole
Debug:CMD:Adding command SetPinChannel
Debug:CMD:Adding command GetChannel
Debug:CMD:Adding command GetReadings
Debug:CMD:Adding command ShortName
Debug:CMD:Adding command AddEventHandler
Debug:CMD:Adding command AddChangeHandler
Debug:CMD:Adding command listEvents
Debug:CMD:Adding command restart
Debug:CMD:Adding command clearConfig
Debug:CMD:cmd [backlog led_basecolor_rgb FF0000; led_enableAll 1;]
Debug:CMD:backlog [led_basecolor_rgb FF0000; led_enableAll 1;]
Debug:CMD:cmd [led_basecolor_rgb FF0000]
Debug:CMD: BASECOLOR got FF0000
Info:GEN:CHANNEL_Set channel 1 has changed to 100 (flags 2)
Info:GEN:No change in channel 2 (still set to 0) - ignoring
Info:GEN:No change in channel 3 (still set to 0) - ignoring
Info:GEN:No change in channel 4 (still set to 0) - ignoring
Info:GEN:No change in channel 5 (still set to 0) - ignoring
Debug:CMD:cmd [led_enableAll 1]
Info:CMD: enableAll (led_enableAll) received with args 1
Info:GEN:No change in channel 1 (still set to 100) - ignoring
Info:GEN:No change in channel 2 (still set to 0) - ignoring
Info:GEN:No change in channel 3 (still set to 0) - ignoring
Info:GEN:No change in channel 4 (still set to 0) - ignoring
Info:GEN:No change in channel 5 (still set to 0) - ignoring
Debug:CMD:backlog executed 2
Debug:CMD:cmd [exec autoexec.bat]
Debug:CMD:exec autoexec.bat
Error:CMD:lfs is absent
Info:GEN:PIN_SetupPins pins have been set up.
Debug:MAIN:started timer
Info:MAIN:Time 1, free 94728, MQTT 0, bWifi 0, secondsWithNoPing 0, socks 2/38
Info:MAIN:Time 2, free 94728, MQTT 0, bWifi 0, secondsWithNoPing 0, socks 2/38
Info:MAIN:Time 3, free 94728, MQTT 0, bWifi 0, secondsWithNoPing 0, socks 2/38
Info:MAIN:Time 4, free 94728, MQTT 0, bWifi 0, secondsWithNoPing 0, socks 2/38
Info:MAIN:Time 5, free 94728, MQTT 0, bWifi 0, secondsWithNoPing 0, socks 2/38
Debug:MAIN:Registered for wifi changes
Info:MAIN:Time 6, free 90744, MQTT 0, bWifi 0, secondsWithNoPing 0, socks 2/38
Info:MAIN:Time 7, free 90744, MQTT 0, bWifi 0, secondsWithNoPing 0, socks 2/38
Info:MAIN:Time 8, free 90744, MQTT 0, bWifi 0, secondsWithNoPing 0, socks 2/38
Info:MAIN:wl_status 3
Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTING
Info:MAIN:Time 9, free 90568, MQTT 0, bWifi 0, secondsWithNoPing 0, socks 2/38
Info:MAIN:Time 10, free 90568, MQTT 0, bWifi 0, secondsWithNoPing 0, socks 2/38
Info:GEN:dhcp=0 ip=0.0.0.0 gate=0.0.0.0 mask=0.0.0.0 mac=38:1f:8d:38:57:0e
Info:MQTT:mqtt_userName homeassistant
mqtt_pass Ripee5iaRaiph4Zoo8phee4Ahf5Gooquaeg3ohdaj9ahcah1eiKoosh8AhT9ooja
mqtt_clientID obk8D38570E
mqtt_host 192.168.0.121:1883
Info:MQTT:Connect error in mqtt_client_connect - code: -4
Info:MAIN:Time 11, free 90568, MQTT 0, bWifi 0, secondsWithNoPing 0, socks 2/38
Info:MAIN:Time 12, free 90568, MQTT 0, bWifi 0, secondsWithNoPing 0, socks 2/38
Info:MAIN:Time 13, free 90568, MQTT 0, bWifi 0, secondsWithNoPing 0, socks 2/38
Info:MAIN:Time 14, free 90568, MQTT 0, bWifi 0, secondsWithNoPing 0, socks 2/38
Info:MAIN:Time 15, free 90568, MQTT 0, bWifi 0, secondsWithNoPing 0, socks 2/38
Info:MAIN:Time 16, free 90568, MQTT 0, bWifi 0, secondsWithNoPing 0, socks 2/38
Info:MAIN:Time 17, free 90568, MQTT 0, bWifi 0, secondsWithNoPing 0, socks 2/38
Info:MAIN:Time 18, free 90568, MQTT 0, bWifi 0, secondsWithNoPing 0, socks 2/38
Info:MAIN:wl_status 9
Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_AUTH_FAILED
Info:MAIN:Time 19, free 89288, MQTT 0, bWifi 0, secondsWithNoPing 0, socks 2/38
Info:MAIN:Time 20, free 89288, MQTT 0, bWifi 0, secondsWithNoPing 0, socks 2/38
Info:GEN:dhcp=0 ip=0.0.0.0 gate=0.0.0.0 mask=0.0.0.0 mac=38:1f:8d:38:57:0e
Info:MAIN:wl_status 3
Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTING
Info:MAIN:wl_status 10
Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTED
Info:MAIN:wl_status 11
Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTED
Info:MAIN:Time 21, free 89920, MQTT 0, bWifi 1, secondsWithNoPing 0, socks 2/38
Info:MQTT:mqtt_userName homeassistant
mqtt_pass Ripee5iaRaiph4Zoo8phee4Ahf5Gooquaeg3ohdaj9ahcah1eiKoosh8AhT9ooja
mqtt_clientID obk8D38570E
mqtt_host 192.168.0.121:1883
Info:MAIN:Time 22, free 89960, MQTT 0, bWifi 1, secondsWithNoPing 0, socks 2/38
Info:MQTT:mqtt_connection_cb: Successfully connected
Info:MQTT:mqtt_subscribed to obk8D38570E/+/set
Info:MQTT:mqtt_subscribed to cmnd/obk8D38570E/+
Info:MQTT:mqtt_publish requies 31, has 1024
Info:MQTT:MQTT client "obk8D38570E" request cb: err 0
Info:MQTT:MQTT client "obk8D38570E" request cb: err 0
Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic cmnd/obk8D38570E/led_enableAll
Info:MQTT:MQTT in topic cmnd/obk8D38570E/led_enableAll
Info:CMD: enableAll (led_enableAll) received with args 1
Info:GEN:No change in channel 1 (still set to 100) - ignoring
Info:GEN:No change in channel 2 (still set to 0) - ignoring
Info:GEN:No change in channel 3 (still set to 0) - ignoring
Info:GEN:No change in channel 4 (still set to 0) - ignoring
Info:GEN:No change in channel 5 (still set to 0) - ignoring
Info:MQTT:Publishing led_enableAll = 1
Info:MQTT:mqtt_publish requies 34, has 1024
Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic cmnd/obk8D38570E/led_dimmer
Info:MQTT:MQTT in topic cmnd/obk8D38570E/led_dimmer
Info:CMD: dimmer (led_dimmer) received with args 78
Info:GEN:CHANNEL_Set channel 1 has changed to 78 (flags 2)
Info:GEN:No change in channel 2 (still set to 0) - ignoring
Info:GEN:No change in channel 3 (still set to 0) - ignoring
Info:GEN:No change in channel 4 (still set to 0) - ignoring
Info:GEN:No change in channel 5 (still set to 0) - ignoring
Info:MQTT:Publishing led_dimmer = 78
Info:MQTT:mqtt_publish requies 32, has 1024
Info:MQTT:Publishing led_basecolor_rgb = FF0000
Info:MQTT:mqtt_publish requies 43, has 1024
Info:MQTT:Publishing led_finalcolor_rgb = C60000
Info:MQTT:mqtt_publish requies 44, has 1024
Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic cmnd/obk8D38570E/led_basecolor_rgb
Info:MQTT:MQTT in topic cmnd/obk8D38570E/led_basecolor_rgb
Debug:CMD: BASECOLOR got ffffff
Info:GEN:No change in channel 1 (still set to 78) - ignoring
Info:GEN:CHANNEL_Set channel 2 has changed to 78 (flags 2)
Info:GEN:CHANNEL_Set channel 3 has changed to 78 (flags 2)
Info:GEN:No change in channel 4 (still set to 0) - ignoring
Info:GEN:No change in channel 5 (still set to 0) - ignoring
Info:MQTT:Publishing led_basecolor_rgb = FFFFFF
Info:MQTT:mqtt_publish requies 43, has 1024
Info:MQTT:Publishing led_dimmer = 78
Info:MQTT:mqtt_publish requies 32, has 1024
Info:MQTT:Publishing led_finalcolor_rgb = C6C6C6
Info:MQTT:mqtt_publish requies 44, has 1024
Info:MAIN:Time 23, free 89960, MQTT 1, bWifi 1, secondsWithNoPing 0, socks 2/38
Info:MAIN:Time 24, free 89960, MQTT 1, bWifi 1, secondsWithNoPing 0, socks 2/38
Info:MQTT:Publishing host = obk8D38570E
Info:MQTT:mqtt_publish requies 31, has 1024
Info:MQTT:[g_bPublishAllStatesNow] item -12 result 0
Info:MAIN:Time 25, free 89960, MQTT 1, bWifi 1, secondsWithNoPing 0, socks 2/38
Quote:
Info:MQTT:mqtt_publish requies 32, has 1024
Info:MQTT:Publishing led_basecolor_rgb = FF0000
Info:MQTT:mqtt_publish requies 43, has 1024
Info:MQTT:Publishing led_finalcolor_rgb = C60000
Quote:
Info:MQTT:mqtt_publish requies 44, has 1024
Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic cmnd/obk8D38570E/led_basecolor_rgb
Info:MQTT:MQTT in topic cmnd/obk8D38570E/led_basecolor_rgb
Debug:CMD: BASECOLOR got ffffff
p.kaczmarek2 wrote:Can you check your device, do you also experience same issue?
skylineh44 wrote:This would go someway to explain the multiple drivers.
Tych0 wrote:
I've noticed the same behaviour on a RGB light. And if I remember correctly, solved it by clearing the cmnd topic for that specific device. I don't use the retain flag on cmnd messages. But still the device seem to pick them up...
Tych0 wrote:
I also noticed, when I change temp and/or color in HA, a led_basecolor_rgb message (get = FFFFFF) is published in the state topic of my CW light. I don't expect that at all...
p.kaczmarek2 wrote:Can you try latest version (update OTA, by WiFi to latest build for your platform - do not chose wrong platform!)?
p.kaczmarek2 wrote:Is there anything else I could add?
skylineh44 wrote:
Debug:CMD:cmd [VoltageSet 243]
Info:EnergyMeter:CurrentSet: you gave 243.000000, set ref to 0.140706
skylineh44 wrote:
Templates for finding the relays, LED's, Buttons/GPIO's would be useful and time saving!
rcayadi wrote:
is i can using this https://github.com/openshwprojects/OpenBK7231T_App/releases or must compile it by myself in my laptop as before
p.kaczmarek2 wrote:I am not sure what you mean by "clearing the cmnd topic".
p.kaczmarek2 wrote:I think we can sort it out tomorrow, but we both will need to test the updated version
p.kaczmarek2 wrote:EDIT: how is your CW light configured? Do you have 3 dummy channels for RGB (or dummy PWMs?) and 4-5 are CW, or just 2 channels (2 PWMs)?
p.kaczmarek2 wrote:EDIT2: Do you have "broadcast led parameters together" flag set?