Elektroda.com
Elektroda.com
X

Deta Grid Connect Smart Fan Speed Controller with Touch Light Switch - 6914HA - Teardown

wolfieeewolf 1353 39
  • #31
    wolfieeewolf
    Level 9  
    So I have been testing the latest code over the last few months and have found a few little idiosyncrasies that are causing issues.

    1. Fans turn on randomly. I have done some testing and I believe it is happening when the wifi is reset or home assistant is rebooted. Not sure if it's a MQTT thing or not. Only happen with new code old code works fine. possible that it doesn't like the extra fan channel. also only happens on two of my switches. Have completely reset them but still happens.

    2. Light button will not turn on light power unless I hold it down for a few seconds. same when you go to turn it off. If you just click the button once it does a quick flick from off to on and visa versa. Does not happen with old code. Again could be the extra fan channel as it doesn't do it when I delete the Fan ON/OFF part of the script.

    3. Extra fan channel. When using Tasmoadmin the switch now has an extra channel that needs to be manually named for it to work.

    4. When using Google to control the fan always goes to max speed first no matter what speed I ask it to do. be it Low, Med, 33% 66%. When you ask Google again it will then adjust speed. I'm thinking this has something to do with the extra fan channel or the way the fan speed is set to always be Max on startup. I think this could be avoided if the Fan ON/OFF button was not a thing but then it would not be like the OEM firmware.

    To combat these issues I think getting rid of the Fan ON/OFF button and just using the fan speed button to control the fan speeds from off, low, med, and high would be the way. This would leave the Fan button as a non-functioning button. Not ideal but should fix the problems I'm having.

    My thoughts would be to utilise the fan button as a scene button for dimming lights or running some kind of automation. Would be good for bedtime routines to set lights to low and turn off house.

    Is anyone else experiencing these issues? I have tried to re-write the code again to see if I can stop it from happening but no matter what I do I can't get it working like the OEM firmware.
  • #32
    p.kaczmarek2
    Moderator Smart Home
    Maybe we could approach it from a different angle. I don't have this device at hand, so it's problematic for me to imagine the whole functionality, but maybe with your help I could try to write a dedicated C driver for that? I would need to know again what exactly should be on UI and what are the inputs/outputss, but it should be possible... what do you think?

    I often do drivers to help users, as you can see here:
    https://github.com/openshwprojects/OpenBK7231T_App/issues/892
    The only issue that your one use case is a bit more complicated.
  • #33
    drkarl
    Level 4  
    wolfieeewolf wrote:
    So I have been testing the latest code over the last few months and have found a few little idiosyncrasies that are causing issues.

    1. Fans turn on randomly. I have done some testing and I believe it is happening when the wifi is reset or home assistant is rebooted. Not sure if it's a MQTT thing or not. Only happen with new code old code works fine. possible that it doesn't like the extra fan channel. also only happens on two of my switches. Have completely reset them but still happens.


    I have not experienced any of this behavior on the 4 fans I have so don't think it would be related to the script. It may be happening if you are still using both the HASS Discovery function AND manual MQTT yaml configuration at the same time.
    Turn off HASS Discovery and ONLY use the manual MQTT yaml config.
    You may need to manually remove/delete the devices HASS Discovery added Home Assistant?

    This could also be an issue with your MQTT RETAIN settings but again I have not experienced any of this behavior.
    Watch this video from THE HOOKUP https://www.youtube.com/watch?v=31IyfM1gygo


    wolfieeewolf wrote:
    2. Light button will not turn on light power unless I hold it down for a few seconds. same when you go to turn it off. If you just click the button once it does a quick flick from off to on and visa versa. Does not happen with old code. Again could be the extra fan channel as it doesn't do it when I delete the Fan ON/OFF part of the script.


    I have this behavior also and would LOVE to fix it
    I tried using FLAG 6 expecting the switch to become instant but still have to hold for 0.5-1 sec to toggle state
    FLAG 6 [BTN] Instant touch reaction instead of waiting for release (aka setoption13 in tasmota)

    wolfieeewolf wrote:
    3. Extra fan channel. When using Tasmoadmin the switch now has an extra channel that needs to be manually named for it to work.


    I do not use Tasmoadmin to manage/use the device so has been a non issue for my use case.
    All interaction is done physically at the switch or through Home Assistant manual MQTT setup, exposing ONLY Light On/OFF (Switch1), Fan On/OFF (Switch 5) and Fan Speed (Switch 10)

    wolfieeewolf wrote:
    4. When using Google to control the fan always goes to max speed first no matter what speed I ask it to do. be it Low, Med, 33% 66%. When you ask Google again it will then adjust speed. I'm thinking this has something to do with the extra fan channel or the way the fan speed is set to always be Max on startup. I think this could be avoided if the Fan ON/OFF button was not a thing but then it would not be like the OEM firmware.


    This was by design and expected behavior consistent with the OEM firmware.
    I felt the OEM firmware was written this way to ensure the fans startup current load is spread across all 3 fan relays/capacitors to not overload any one individual.
    I mimicked this behavior in the script. The fan must be turned on first, always at full speed. Speed cycle is then DECREASED cascade from Max -> Med -> Min.
    If you feel this is over cautious and not necessary you could change it, but doing so will deviate from the OEM operation of the device.

    wolfieeewolf wrote:
    To combat these issues I think getting rid of the Fan ON/OFF button and just using the fan speed button to control the fan speeds from off, low, med, and high would be the way. This would leave the Fan button as a non-functioning button. Not ideal but should fix the problems I'm having.

    My thoughts would be to utilise the fan button as a scene button for dimming lights or running some kind of automation. Would be good for bedtime routines to set lights to low and turn off house.


    This would deviate from the OEM firmware but may work better for your use case. Test it out and report back how you feel it functions.

    TLDR
    If the press delay (problem 2 above) can be fixed the device would be PERFECT as per OEM supplied.

    The GHOST SWITCHING are likely due to using BOTH HASS discovery and MANUAL MQTT yaml config at the same time.
    This would also explain the additional device entities in Home Assistant. I suggest turn OFF HASS discovery and use MANUAL MQTT yaml config ONLY exposing switch 1 (Light on/off), 5 (Fan on/off), 10 (Fan speed %)

    Ghost switching may possibly but unlikely be due to incorrect MQTT RETAIN settings.
  • #34
    p.kaczmarek2
    Moderator Smart Home
    drkarl wrote:

    I have this behavior also and would LOVE to fix it
    I tried using FLAG 6 expecting the switch to become instant but still have to hold for 0.5-1 sec to toggle state
    FLAG 6 [BTN] Instant touch reaction instead of waiting for release (aka setoption13 in tasmota)

    Please post your code.

    If you have scripted:
    
    addEventHandler OnClick 1 Do_Power_Press
    

    and you want it to be instant press, then flag 6 won't work, because you have specified yourself that it must be "OnClick".

    If you want to use OnPress event, do:
    
    addEventHandler OnPress 1 Do_Power_Press
    
  • #35
    drkarl
    Level 4  
    Outstanding! Thank you this now works exactly as OEM firmware
    I have changed both the Light and Fan Speed selector to OnPress and they both act instantly when FLAG 6 is selected.

    I have chosen to leave Fan ON/OFF as OnClick as the LIGHT and FAN buttons are very close together so having the Light instant but Fan slightly delayed might help to stop accidentally turning the fan on.

    // Display the labels for each channel on the GUI
    setChannelLabel 1 "Light Relay"
    setChannelLabel 2 "Min Fan 1 Relay"
    setChannelLabel 3 "Mid Fan 2 Relay"
    setChannelLabel 4 "Max Fan Relay"
    setChannelType 5 Toggle
    setChannelLabel 5 "Fan ON/OFF"
    setChannelType 10 OffLowMidHigh
    
    // Hide the raw relay channel buttons from the GUI
    setChannelVisible 1 0
    setChannelVisible 2 0
    setChannelVisible 3 0
    setChannelVisible 4 0
    setChannelVisible 5 0
    
    // Start the HTTP button driver
    startDriver httpButtons
    
    // Set up the Light button on the GUI
    setButtonLabel 1 "Light ON/OFF"
    setButtonCommand 1 Do_Light_Press
    setButtonEnabled 1 1
    setButtonColor 1 red
    addChangeHandler Channel1 == 0 setButtonColor 1 red
    addChangeHandler Channel1 != 0 setButtonColor 1 green
    addEventHandler OnPress 14 Do_Light_Press
    alias Do_Light_Press toggleChannel 1
    
    // Set up the Fan ON/OFF button on the GUI
    setButtonLabel 2 "Fan ON/OFF"
    setButtonCommand 2 Do_Power_Press
    setButtonEnabled 2 1
    setButtonColor 2 red
    addChangeHandler Channel2 == 0 setButtonColor 2 red
    addChangeHandler Channel2 != 0 setButtonColor 2 green
    addEventHandler OnClick 1 Do_Power_Press
    alias Do_Power_Press toggleChannel 5
    
    // Set up the Fan speed cycle button on the GUI
    setButtonLabel 10 "Next Fan Speed"
    setButtonCommand 10 Do_Cycle_Press_Ext
    setButtonEnabled 10 1
    addEventHandler OnPress 8 Do_Cycle_Press_Ext
    alias Do_Cycle_Press addChannel 10 -1 1 3 1 
    alias Do_Cycle_Press_Ext if $CH10!=0 then Do_Cycle_Press 
    
    
    // Set up change handlers for the fan speed options
    addChangeHandler Channel10 == 0 backlog SetChannel 2 0; SetChannel 3 0; SetChannel 4 0; SetChannel 5 0
    addChangeHandler Channel10 == 1 backlog SetChannel 2 1; SetChannel 3 0; SetChannel 4 0; SetChannel 5 1
    addChangeHandler Channel10 == 2 backlog SetChannel 2 1; SetChannel 3 1; SetChannel 4 0; SetChannel 5 1
    addChangeHandler Channel10 == 3 backlog SetChannel 2 1; SetChannel 3 1; SetChannel 4 1; SetChannel 5 1
    addChangeHandler Channel5 == 0 backlog SetChannel 10 0
    addChangeHandler Channel5 == 1 backlog SetChannel 10 3
  • #36
    p.kaczmarek2
    Moderator Smart Home
    To be clear, FLAG 6 "instant touch reactions" is not related to scripted button events. Flag 6 only related to "automatic" button events, like a button and relay on a single channel. This is why flag 6 doesn't do anything for you. Still, it's good to hear it's working! Is there anything else I may help you with?
  • #37
    wolfieeewolf
    Level 9  
    >>20695671

    Can you share your channel template with me? I'm thinking yours might differ slightly from mine. I'm still experiencing issues, but it seems to be related to some sort of configuration error. This problem only arises when MQTT is configured and occurs after the device is rebooted or the internet connection drops. It's strange because I've removed all MQTT configurations from Home Assistant and cleared all the flags. I even reset the device to its factory OBK settings. The only MQTT-related thing I have active is Home Assistant's auto-discovery feature, but even with auto-discovery turned off, the issue is still there. Strangely, when I remove all MQTT data from the OBK, it functions as intended.

    I prefer to keep auto-discovery enabled, as manually writing custom MQTT config YAML for all my devices seems unnecessary when it's only this specific device causing problems. While having the ability to send custom MQTT config from the OBK itself could potentially help ensure only the desired information is exposed to Home Assistant, this function doesn't currently exist, so it's hard to determine if this could work or not.

    I'm currently using the latest version of Home Assistant:

    Home Assistant 2023.8.2
    Supervisor 2023.08.1
    Operating System 10.4
    Frontend 20230802.0 (latest)

    This issue has only been happening in the past month or so, so there's a chance it's related to a Home Assistant update. However, this doesn't explain why it's only happening to 2 out of 4 devices. It's also possible that there are hardware differences between what you have and what I have. My switches are black and are series 2. I belive the white series 2 switches might have been released before the black ones, so there could be internal hardware variations.

    The issue is occurring on only 2 of the 4 switches I own, which makes it even more puzzling. I've even copied the data from the non-working switches to the working ones, and those devices continue to function correctly. It's very bizarre.

    Interestingly, when I delete the fan on/off channel 5 from the script, the issue seems to be resolved. This is why I think it could be something related to my channel setup causing the problem. It's the only thing I can think of.

    drkarl wrote:
    I felt the OEM firmware was written this way to ensure the fans startup current load is spread across all 3 fan relays/capacitors to not overload any one individual.


    This is interesting to me. I wonder what the power draw across the different relays is? Not sure how I would go about testing the current load in all the different scenarios. I haven't pulled one of these apart to see just how many relays are in or how there are running them. I do have a spare laying around somewhere maybe I'll post some pictures to see if starting on low or medium speeds first will cause an issue.

    p.kaczmarek2 wrote:
    Maybe we could approach it from a different angle. I don't have this device at hand, so it's problematic for me to imagine the whole functionality, but maybe with your help I could try to write a dedicated C driver for that? I would need to know again what exactly should be on UI and what are the inputs/outputss, but it should be possible... what do you think?


    This could be something worth exploring if the above solutions don't work. I like having the freedom of modifying the btn_script to perform basically any function I wish, a driver might offer a simpler solution for users who prefer the device's original functions. If I can't resolve the issue by trying all available options, we can consider developing a dedicated driver for this purpose.

    Just to note this device does not have a TuyaMCU on board it works via switching relays on and off so I'm not sure if that would effect how you build a driver for this device.
  • #38
    wolfieeewolf
    Level 9  
    drkarl wrote:
    This could also be an issue with your MQTT RETAIN settings but again I have not experienced any of this behavior.
    Watch this video from THE HOOKUP https://www.youtube.com/watch?v=31IyfM1gygo


    I believe this is most likely the case.

    My logs from a startup.

    Info:MAIN:Module reboot in 2...
    Info:MAIN:Time 98, idle 55956/s, free 74752, MQTT 1(1), bWifi 1, secondsWithNoPing 24, socks 2/38 POWERSAVE
    Info:MAIN:Module reboot in 1...
    ndler: added OnClick with cmd Do_Cycle_Press_Ext
    Info:CMD:New alias has been set: Do_Cycle_Press runs addChannel 10 -1 1 3 1
    Info:CMD:New alias has been set: Do_Cycle_Press_Ext runs if $CH10!=0 then Do_Cycle_Press
    Info:EVENT:CMD_AddChangeHandler: added Channel10 with cmd backlog SetChannel 2 0; SetChannel 3 0; SetChannel 4 0; SetChannel 5 0
    Info:EVENT:CMD_AddChangeHandler: added Channel10 with cmd backlog SetChannel 2 1; SetChannel 3 0; SetChannel 4 0; SetChannel 5 1
    Info:EVENT:CMD_AddChangeHandler: added Channel10 with cmd backlog SetChannel 2 1; SetChannel 3 1; SetChannel 4 0; SetChannel 5 1
    Info:EVENT:CMD_AddChangeHandler: added Channel10 with cmd backlog SetChannel 2 1; SetChannel 3 1; SetChannel 4 1; SetChannel 5 1
    Info:EVENT:CMD_AddChangeHandler: added Channel5 with cmd backlog SetChannel 10 0
    Info:EVENT:CMD_AddChangeHandler: added Channel5 with cmd backlog SetChannel 10 3
    Info:MAIN:Time 1, idle 32223/s, free 86344, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 POWERSAVE
    Info:MAIN:HA discovery is scheduled, but MQTT connection is not present yet
    Info:MAIN:Time 2, idle 37910/s, free 86344, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 POWERSAVE
    Info:MAIN:HA discovery is scheduled, but MQTT connection is not present yet
    Info:MAIN:Time 3, idle 37662/s, free 86344, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 POWERSAVE
    Info:MAIN:HA discovery is scheduled, but MQTT connection is not present yet
    Info:MAIN:Time 4, idle 35544/s, free 86344, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 POWERSAVE
    Info:MAIN:HA discovery is scheduled, but MQTT connection is not present yet
    Info:MAIN:Time 5, idle 37995/s, free 86344, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 POWERSAVE
    Info:MAIN:HA discovery is scheduled, but MQTT connection is not present yet
    Info:MAIN:ssid:TelstraC3E92F key:paecawv8q5rr2ghf
    Info:MAIN:Time 6, idle 75273/s, free 81064, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 POWERSAVE
    Info:MAIN:Boot complete time reached (5 seconds)
    Info:CFG:####### Set Boot Complete #######


    This boot-up section seems ok and is doing what it should

    Info:MAIN:HA discovery is scheduled, but MQTT connection is not present yet
    Info:MAIN:Time 7, idle 91569/s, free 80520, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 POWERSAVE
    Info:MAIN:HA discovery is scheduled, but MQTT connection is not present yet
    Info:MAIN:Time 8, idle 40159/s, free 79760, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 POWERSAVE
    Info:MAIN:HA discovery is scheduled, but MQTT connection is not present yet
    Info:MAIN:Time 9, idle 0/s, free 79760, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 POWERSAVE
    Info:MAIN:HA discovery is scheduled, but MQTT connection is not present yet
    Info:MAIN:Time 10, idle 0/s, free 79760, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 POWERSAVE
    Info:GEN:dhcp=0 ip=0.0.0.0 gate=0.0.0.0 mask=0.0.0.0 mac=10:d5:61:27:b9:c5
    Info:GEN:sta: 0, softap: 0, b/g/n
    Info:MAIN:HA discovery is scheduled, but MQTT connection is not present yet
    Info:MAIN:Time 11, idle 0/s, free 79760, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 POWERSAVE
    Info:MAIN:HA discovery is scheduled, but MQTT connection is not present yet
    Info:MAIN:Time 12, idle 0/s, free 79760, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 POWERSAVE
    Info:MAIN:HA discovery is scheduled, but MQTT connection is not present yet
    Info:MAIN:Time 13, idle 0/s, free 79760, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 POWERSAVE
    Info:MAIN:HA discovery is scheduled, but MQTT connection is not present yet
    Info:MAIN:Time 14, idle 0/s, free 79760, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 POWERSAVE
    Info:MAIN:HA discovery is scheduled, but MQTT connection is not present yet
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTING - 1
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTED - 4
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTED - 4
    Info:MAIN:Time 15, idle 25868/s, free 80168, MQTT 0(0), bWifi 1, secondsWithNoPing -1, socks 3/38 POWERSAVE
    Info:MAIN:HA discovery is scheduled, but MQTT connection is not present yet
    C5/+/get
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic obk6127B9C5/5/set
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic obk6127B9C5/10/set
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic obk6127B9C5/1/get
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic obk6127B9C5/2/get
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic obk6127B9C5/3/get
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic obk6127B9C5/4/get
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic obk6127B9C5/5/get
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic obk6127B9C5/10/get
    Info:MQTT:MQTT client in mqtt_incoming_data_cb data is 0 for ch 5
    Info:GEN:No change in channel 5 (still set to 0) - ignoring
    
    Info:MQTT:MQTT client in mqtt_incoming_data_cb data is 2 for ch 10
    Info:GEN:CHANNEL_Set channel 10 has changed to 2 (flags 0)
    
    Info:MQTT:Channel has changed! Publishing 2 to channel 10 
    Info:MQTT:Publishing val 2 to obk6127B9C5/10/get retain=0
    Info:EVENT:EventHandlers_ProcessVariableChange_Integer: executing command backlog SetChannel 2 1; SetChannel 3 1; SetChannel 4 0; SetChannel 5 1
    Info:GEN:CHANNEL_Set channel 2 has changed to 1 (flags 0)
    
    Info:MQTT:Channel has changed! Publishing 1 to channel 2 
    Info:MQTT:Publishing val 1 to obk6127B9C5/2/get retain=0
    Info:EVENT:EventHandlers_ProcessVariableChange_Integer: executing command setButtonColor 2 green
    Info:GEN:CHANNEL_Set channel 3 has changed to 1 (flags 0)
    
    Info:MQTT:Channel has changed! Publishing 1 to channel 3 
    Info:MQTT:Publishing val 1 to obk6127B9C5/3/get retain=0
    Info:GEN:No change in channel 4 (still set to 0) - ignoring
    
    Info:GEN:CHANNEL_Set channel 5 has changed to 1 (flags 0)
    
    Info:MQTT:Channel has changed! Publishing 1 to channel 5 
    Info:MQTT:Publishing val 1 to obk6127B9C5/5/get retain=0
    Info:EVENT:EventHandlers_ProcessVariableChange_Integer: executing command backlog SetChannel 10 3
    Info:GEN:CHANNEL_Set channel 10 has changed to 3 (flags 0)
    
    Info:MQTT:Channel has changed! Publishing 3 to channel 10 
    Info:MQTT:Publishing val 3 to obk6127B9C5/10/get retain=0
    Info:EVENT:EventHandlers_ProcessVariableChange_Integer: executing command backlog SetChannel 2 1; SetChannel 3 1; SetChannel 4 1; SetChannel 5 1
    Info:GEN:No change in channel 2 (still set to 1) - ignoring
    
    Info:GEN:No change in channel 3 (still set to 1) - ignoring
    
    Info:GEN:CHANNEL_Set channel 4 has changed to 1 (flags 0)
    
    Info:MQTT:Channel has changed! Publishing 1 to channel 4 
    Info:MQTT:Publishing val 1 to obk6127B9C5/4/get retain=0
    Info:GEN:No change in channel 5 (still set to 1) - ignoring
    
    Info:MAIN:Time 18, idle 5993/s, free 80504, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 POWERSAVE
    Info:MAIN:Will do request HA discovery now.
    Info:MQTT:Queued topic=homeassistant/switch/Bedroom_Switch_relay_1/config, 1 items in queue
    Info:MQTT:Queued topic=homeassistant/switch/Bedroom_Switch_relay_2/config, 2 items in queue
    Info:MQTT:Queued topic=homeassistant/switch/Bedroom_Switch_relay_3/config, 3 items in queue
    Info:MQTT:Queued topic=homeassistant/switch/Bedroom_Switch_relay_4/config, 4 items in queue
    Info:MQTT:Queued topic=homeassistant/switch/Bedroom_Switch_relay_5/config, 5 items in queue
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic obk6127B9C5/10/get
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic obk6127B9C5/2/get
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic obk6127B9C5/3/get
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic obk6127B9C5/5/get
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic obk6127B9C5/10/get
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic obk6127B9C5/4/get
    Info:MQTT:Publishing val (315 bytes) to homeassistant/switch/Bedroom_Switch_relay_1/config retain=1
    Info:MQTT:Publishing val (319 bytes) to homeassistant/switch/Bedroom_Switch_relay_2/config retain=1
    Info:MQTT:Publishing val (319 bytes) to homeassistant/switch/Bedroom_Switch_relay_3/config retain=1
    Info:MAIN:Time 19, idle 5447/s, free 74624, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 POWERSAVE
    Info:MQTT:Publishing val (317 bytes) to homeassistant/switch/Bedroom_Switch_relay_4/config retain=1
    Info:MQTT:Publishing val (314 bytes) to homeassistant/switch/Bedroom_Switch_relay_5/config retain=1
    Info:MAIN:Time 20, idle 18302/s, free 74624, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 POWERSAVE
    Info:GEN:dhcp=0 ip=192.168.0.11 gate=192.168.0.1 mask=255.255.255.0 mac=10:d5:61:27:b9:c5
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-54,ssid=TelstraC3E92F,bssid=a2:b5:3c:c3:e9:37,channel=11,cipher_type:CCMP
    Info:MQTT:Channel has changed! Publishing 1 to channel 1 
    Info:MQTT:Publishing val 1 to obk6127B9C5/1/get retain=0
    Info:MAIN:Time 21, idle 25986/s, free 74624, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 POWERSAVE
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic obk6127B9C5/1/get
    Info:MQTT:Channel has changed! Publishing 1 to channel 2 
    Info:MQTT:Publishing val 1 to obk6127B9C5/2/get retain=0
    Info:MAIN:Time 22, idle 11256/s, free 74176, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 3/38 POWERSAVE
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic obk6127B9C5/2/get
    Info:MQTT:Channel has changed! Publishing 1 to channel 3 
    Info:MQTT:Publishing val 1 to obk6127B9C5/3/get retain=0
    Info:MAIN:Time 23, idle 52338/s, free 74624, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 POWERSAVE
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic obk6127B9C5/3/get
    Info:MQTT:Channel has changed! Publishing 1 to channel 4 
    Info:MQTT:Publishing val 1 to obk6127B9C5/4/get retain=0
    Info:MAIN:Time 24, idle 55164/s, free 74624, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 POWERSAVE
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic obk6127B9C5/4/get
    Info:MQTT:Channel has changed! Publishing 1 to channel 5 
    Info:MQTT:Publishing val 1 to obk6127B9C5/5/get retain=0
    Info:MAIN:Time 25, idle 50575/s, free 74624, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 POWERSAVE
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic obk6127B9C5/5/get
    Info:MQTT:Channel has changed! Publishing 3 to channel 10 
    Info:MQTT:Publishing val 3 to obk6127B9C5/10/get retain=0
    Info:MAIN:Time 26, idle 46237/s, free 74392, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 POWERSAVE
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic obk6127B9C5/10/get
    Info:MAIN:Time 27, idle 40869/s, free 66016, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 3/38 POWERSAVE
    Info:MAIN:Time 28, idle 94650/s, free 74624, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 POWERSAVE
    Info:MAIN:Time 29, idle 54483/s, free 74624, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 POWERSAVE
    Info:MAIN:Time 30, idle 53936/s, free 74624, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38 POWERSAVE
    Info:GEN:dhcp=0 ip=192.168.0.11 gate=192.168.0.1 mask=255.255.255.0 mac=10:d5:61:27:b9:c5
    Info:GEN:sta: 1, softap: 0, b/g/n


    I'm thinking that somehow a retained value is stuck in the flash memory and will not release. I have done a complete reset of the device but it appears that this is not wiping out everything. As I can't use the Tasmota ButtonRetain On and Off commands I am not sure how I would wipe the retain memory out.

    I have done some testing by deleting parts of the autoexec.bat script and with everything else deleted but this code, it still turns the fan on.

    // Set up change handlers for the fan speed options
    addChangeHandler Channel10 == 0 backlog SetChannel 2 0; SetChannel 3 0; SetChannel 4 0; SetChannel 5 0
    addChangeHandler Channel10 == 1 backlog SetChannel 2 1; SetChannel 3 0; SetChannel 4 0; SetChannel 5 1
    addChangeHandler Channel10 == 2 backlog SetChannel 2 1; SetChannel 3 1; SetChannel 4 0; SetChannel 5 1
    addChangeHandler Channel10 == 3 backlog SetChannel 2 1; SetChannel 3 1; SetChannel 4 1; SetChannel 5 1
    addChangeHandler Channel5 == 0 backlog SetChannel 10 0
    addChangeHandler Channel5 == 1 backlog SetChannel 10 3
    


    I have even deleted the script down to one line of code

    addChangeHandler Channel10 == 2 backlog SetChannel 2 1; SetChannel 3 1; SetChannel 4 0; SetChannel 5 1


    I have turned off all flags and reset. I've deleted scripts, configs and basically everything I can think of then reset again. I also have auto-discovery turned off and all entities deleted in-home assistant. With the MQTT broker turned off it doesn't do it but as soon as the MQTT broker is turned on and it connects it turns the fan on. It has to be something stuck somewhere when the MQTT connection is made and it's sending some kind of trigger that turns on the fan.

    I have even gone as far as reflashing the device manually but the problem still is there. @p.kaczmarek2 Not sure if you can assist on this one but I'm at a complete loss on where to go next.
  • #39
    MnM1
    Level 8  
    Have you tried MQTT Explorer to connect to your mqtt and delete all traces of that device manually? (after you remove it from you HA config, etc)
  • #40
    wolfieeewolf
    Level 9  
    MnM1 wrote:
    Have you tried MQTT Explorer to connect to your mqtt and delete all traces of that device manually? (after you remove it from you HA config, etc)


    This has worked. There was a few retained entries that I have cleared out and now it's all functioning how it should. Thanks for your help on this. It was driving me insane trying to work it out.