Dimming with mulltiple touch sensors

Hi,

I am trying to improve my (single) touch sensors by swapping them out for these “quad-sensors”:


These require 4 IO’s and are practically 4 separate sensors on one PCB.

What I want to achieve:

  1. Single tap on any of the 4 sensors switches a Home Assistant light on/off to the last (brightness) state.
  2. Long press on any of the 4 sensors will turn on to 100% brightness
  3. Swiping from left to right (hitting only 2 IO’s in a row) will brighten a light by 5% in Home Assistant. Swiping from right to left will dimm by 5%.
    This needs to work for sensors 1>2, 2>3, 3>4 or 2>1, 3>2, 4>3
  4. Swiping from left to right (hitting only 3 IO’s in a row) will brighten a light by 10% in Home Assistant. Swiping from right to left will dimm by 10%.
    This need to work for 1>2>3, 2>3>4 or 3>2>1, 4>3>2
  5. Swiping from left to right (hitting all 4 IO’s in a row) will brighten a light by 15% in Home Assistant. Swiping from right to left will dimm by 15%.
    So 1>2>3>4 or 4>3>2>1

I have no clue on how to get this done.

Can anyone help me out?

Cheers,

Michel

What I would do.
Presuming they are binary sensors in esp home.
Do all the logic there: if you look in the docs for binary sensor, you’ll see option for press, click, double, multi click etc.
For each of those Send an event to ha.

Example event: lounge_switch, event data button1_click

Then in ha use those events as triggers.
You can even handle them all with one automation triggered by the lounge switch event, with choose actions to determine an action for each variation of event data.

Sorry just noticed you wanted to swipe. That’s more complicated but you should be able to.

Yup, I think so too, but I don’t know how. The trick is there should only be dimming if you hit more then 1 sensor in a swipe.
If pressing no more then 1 sensor within 200ms (or so) it should only toggle the light.