-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sonoff Basic R4 Magicswitch bounces when toggled by command #22535
Comments
I will try to reproduce but I believe your problem is hardware related as the magic switch features detects a power loss while you are not actuating the switch. What is your load? Passive or inductive? What power? |
Load is 4x 6watt GU10 LED lamps. I am seeing the magic switch detect pulses of around 5000 to 50000 when switching the relay with MQTT. It is not every time, probably about 10% erroneous detection. I suspecting it could be the load characteristics too but would be nice to be able to filter it. It is not general power noise as I have no phantom switching other than the described issue. I tried switchdebounce 1000 which I suspect may have reduced the frequency of this issue. Do you know if Switchdebounce 69 works with the basic R4 I am going to try a rule to create a longer delay, maybe 2 sec I would like to find a software solution as I am sure others could have similar loads. Thanks for responding |
Switchdebounce will have no impact on the MagicSwitch which use a logic totally indépendant from Switches I don't see how you could workaround that with rules. I think the only solution is indeed to apply the masking window for any power switch whatever is the source I understand you know how to compile your own so I'll provide you patches or a branch to test |
Thank you for your help, I will be sure to test this on my setup and feedback to you if it is successful. |
I can confirm I am also seeing this with different GU10 lamps, with a single lamp and also with no load so I am ruling out the load now. |
I'm fighting with my build env |
Just compiled and flashed and pleased to confirm it works and the issue is resolved. Really appreciate you working on this so quickly. Many Thanks again. Off to turn my lighting automations back on in home assistant now. |
PROBLEM DESCRIPTION
A clear and concise description of what the problem is.
I have noticed that when toggling the sonoff relay from the web interface or MQTT command, the relay will sometimes bounce back to its previous state. MAGICSWITCH_MASKING_WINDOW_LEN appears not to be active for switching by command but may solve the problem.
REQUESTED INFORMATION
Make sure your have performed every step and checked the applicable boxes before submitting your issue. Thank you!
Backlog Template; Module; GPIO 255
:Backlog Rule1; Rule2; Rule3
:Status 0
:weblog
to 4 and then, when you experience your issue, provide the output of the Console log:The log above shows the MQTT turn off command
Then a 4566 pulse is detected and it turns on again
The second MQTT turn off command is successful
TO REPRODUCE
Steps to reproduce the behavior:
Apply the standard magicswitch template
Set MAGICSWITCH_MASKING_WINDOW_LEN to 20
The relay does not bounce when using the magicswitch but does bounce when switched from the web interface or MQTT.
EXPECTED BEHAVIOUR
A clear and concise description of what you expected to happen.
Expect the relay to change state once and not trigger the magicswitch feature.
SCREENSHOTS
If applicable, add screenshots to help explain your problem.
ADDITIONAL CONTEXT
Add any other context about the problem here.
I had to increase the MAGICSWITCH_MASKING_WINDOW_LEN from the default 5 (250ms) to 20 (1 sec) to prevent the bouncing when using the physical switch but I still get the issue when switching by software. Should the masking be applied to all switching?
(Please, remember to close the issue when the problem has been addressed)
The text was updated successfully, but these errors were encountered: