Skip to content
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

Add support for switches using an AC detection circuitry #8606

Merged

Conversation

halfbakery
Copy link
Contributor

Description:

MOES MS-104B and many of its clones (mine is a BlitzWolf SS5 2 gang) using an AC detection circuitry to emulate switches. This circuit generates a ~4 ms long LOW pulse in every AC period if the external switch is pressed.

My solution is to use the switch debouncing code to detect these AC pulses, so these switches can work almost out-of-the-box. The SwitchDebounce parameter controls the AC detection. If the last digit is 9, it will activate the AC detection code. The other part of the parameter behaves exactly as expected: e.g. 69 means 60 msec debounce time (60 msec / (1 / 50 Hz) -> 3 pulses).

I wanted to be as non-intrusive as possible, so I kept the polling code, but I had to call it 5x faster to detect pulses (of course only if AC detection is requested).

Checklist:

  • The pull request is done against the latest dev branch
  • Only relevant files were touched
  • Only one feature/fix was added per PR.
  • The code change is tested and works on core ESP8266 V.2.7.1
  • The code change is tested and works on core ESP32 V.1.12.2
  • I accept the CLA.

NOTE: The code change must pass CI tests. Your PR cannot be merged unless tests pass

@arendst arendst merged commit 7e8c136 into arendst:development Jun 3, 2020
@halfbakery halfbakery deleted the support_switches_with_ac_detection branch June 5, 2020 17:23
@discip
Copy link

discip commented Jul 29, 2020

@halfbakery
Good evening,
thank you for this PR.
Could you please help me out with this?
Because I can't manage to understand, how to setup this device, to make use of the external switches/push buttons.

thank you in advance
kind regards

@ascillato
Copy link
Contributor

Please, address this to the Tasmota Support Chat. The chat is a better and more dynamic channel for helping you. Github issues are meant for Tasmota Software Bug Reporting.

Please check the Contributing Guideline and Policy and the Support Guide.

Thanks.


Support Information

See Wiki for more information.
See FAQ for common questions/answers and links if none of your question is in the list
See Chat for more user experience.
See Community for forum.
See Code of Conduct

@halfbakery
Copy link
Contributor Author

I hope the documentation will be updated soon. Here's the relevant patch:
https://github.com/tasmota/docs/pull/355/files

@blakadder
Copy link
Collaborator

It being updated right now :D

@discip
Copy link

discip commented Oct 13, 2020

@halfbakery, @ascillato & @blakadder

Thank you very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants