Reset input-switch on MOES MS-104B

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Micha_he
Normal user
Posts: 369
Joined: 07 Feb 2018, 19:14
Location: Helmstedt, Germany

Reset input-switch on MOES MS-104B

#1 Post by Micha_he » 02 May 2021, 20:11

Background:
I'll modify a MOES MS-104B (internal a WB2S BEKEN chip) with a ESP. The two input-channels a seems to work as follows:

Short press = single pulse to low
Long press = double pulse to low.

When I configure a Switch-Input-Device with 'Push Button Active Low' and press the button for a short time only, the state remains on '1' (for a long press, the release-impulse correctly reset it to '0').

Can I reset the switch-state with a rule-timer and special command ?
Or does someone have another solution? A normal switch does not work, because the impulses seem too short.

Edit: I have to revise the statement about the normal switch. It is short, but the event is triggered. But that doesn't really change the problem, because sometimes the 0-1-0 change is triggered once and a long press is then triggered twice.

Micha_he
Normal user
Posts: 369
Joined: 07 Feb 2018, 19:14
Location: Helmstedt, Germany

Re: Reset input-switch on MOES MS-104B

#2 Post by Micha_he » 02 May 2021, 22:11

Maybe I've found a solution... I'll report more, tomorrow.

Micha_he
Normal user
Posts: 369
Joined: 07 Feb 2018, 19:14
Location: Helmstedt, Germany

Re: Reset input-switch on MOES MS-104B

#3 Post by Micha_he » 03 May 2021, 11:23

I have to admit, my idea doesn't work!

Additional information:
  • Press and hold button = First pulse low 250ms
  • Release holded button = Second pulse low 250ms
  • Press button short with immediate release = Single pulse low 250ms
I've no idea how I should differentiate the two states.

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Reset input-switch on MOES MS-104B

#4 Post by TD-er » 03 May 2021, 12:06

Maybe you could monitor a GPIO pin state and act on it via rules?
In the latest code you can use the %uptime_ms% to store in a variable and when the button is released you can see how long it took.
Problem is that rules are not processed in real time, so you should expect some drift.

Maybe it can be combined with the pulse counter, to inspect the pulse duration from within the rules?

Micha_he
Normal user
Posts: 369
Joined: 07 Feb 2018, 19:14
Location: Helmstedt, Germany

Re: Reset input-switch on MOES MS-104B

#5 Post by Micha_he » 04 May 2021, 11:39

For now, I created a block-timer for 2-3s, after the first (or single) pulse. During this period, another pulse is ignored.
If the block-timer is expired, the next pulse toggle the state again.

If someone holds the button longer than 2-3s, the relay will switch off immediately when released. But this is ok for now. I've no better solution.

Post Reply

Who is online

Users browsing this forum: No registered users and 36 guests