logo elektroda
logo elektroda
X
logo elektroda

Smart Outlets Restarting to ON State, Ignoring Last Relay State

fibergm 333 8
ADVERTISEMENT
  • #1 21220423
    fibergm
    Level 5  
    Hi, I have a problem concerning the Software:

    Sometimes my outlets restart during the night. But when they turn back on, they don't assume the last state of the relais. They ALWAYS turn on.
    During the night I'm always woken by this.

    I already tried setting the start-up state on the relais to no avail.

    The problem is reproducible by restarting the plug manually.

    Maybe a startup command can fix it, but I could not find one.
  • ADVERTISEMENT
  • #2 21220839
    p.kaczmarek2
    Moderator Smart Home
    Hello, what kind of platform and device?

    For a classic Relay device, on the most of the platforms, setting a -1 in "Configure startup" for relay channel should be enough. However, if your device gets restarted by a watchdog for some reasons, you may indeed hear a brief click during restart. That being said, if startup is correctly set to -1, the relay should come back to the state that it was before the reboot.

    I don't think that relays should turn on by default, unless you've set it excplicitly in the autoexec.bat or short startup command or startup menu.

    Still, for a start, I would also suggest testing it without MQTT. We had similiar reports and it turned out that it was Home Assistant at fault.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #3 21221092
    fibergm
    Level 5  
    Yes that, solved the thing. Now it restarts to the last state.
    I'm using btw the plug I flashed in my other post.

    But that only partially fixes my problem, because I'm using homeassistant.
    I am also a bit confused because all of my plugs are basically flashed with the same hardware and software, so why do I have these bugs only on some devices?
  • #4 21221096
    p.kaczmarek2
    Moderator Smart Home
    Maybe you have different flags? There are few flags that may alter HA behaviour. For example, "retain" flag setting. Or broadcasting value at MQTT connect. Etc. See here:
    https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/flags.md
    Check which flags do you have set.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #5 21221098
    DJ MHz
    Level 25  
    Lots of details about the hardware and software in them and the software that controls the whole thing :]
  • #6 21221107
    p.kaczmarek2
    Moderator Smart Home
    >>21221098 I actually guessed that it was about https://github.com/openshwprojects/OpenBK7231T_App
    Helpful post? Buy me a coffee.
  • #7 21221396
    fibergm
    Level 5  
    I removed all flags it still shows this behavior.
    I also checked with my other plugs, which work and copied their flags. But all to no avail.
    I also took the obk config of one of the working plugs and sent it to the not working plugs but also no effect.

    The workaround I found was to set up an automation in homeassistant, that checks when THIS plug goes unavailable and then turns on, it instantly turns it off.
  • ADVERTISEMENT
  • #8 21262419
    fibergm
    Level 5  
    Are there any new revelations. In this topic?
  • #9 21262859
    DJ MHz
    Level 25  
    Electrical check, drying out capacitors cause reboots and swirling sockets/switches. I have this in my sonoffs, on average once a year one falls and I have to solder new nichicons there

Topic summary

The discussion revolves around a user experiencing issues with smart outlets that restart to an ON state, disregarding their last relay state. The user has attempted to set the startup state to -1 without success and suspects a potential startup command might resolve the issue. Responses suggest checking the platform and device settings, particularly the "retain" flag in Home Assistant (HA) and other configuration flags that could affect behavior. Despite attempts to synchronize configurations across devices, the problem persists. A workaround involving Home Assistant automation to manage the outlet's state was proposed. Additionally, hardware issues such as drying out capacitors in devices like Sonoff were mentioned as potential causes for unexpected reboots.
Summary generated by the language model.
ADVERTISEMENT