- Положить paj7620_.h в каталог, где лежит yaml-файл проекта
- Добавить в yaml-файл
esphome:
includes:
- paj7620_.h
libraries:
- "Wire"
- "seeed-studio/Gesture PAJ7620"
- Добавить в yaml-файл
text_sensor:
- platform: custom
lambda: |-
auto paj7620 = new esphome::paj7620::PAJ7620();
App.register_component(paj7620);
return {paj7620->guesture_sensor};
text_sensors:
name: "PAJ7620"
icon: mdi:hand-left
-
Собрать
-
Подключить всё, как в этой статье:
Всё, можно махать руками.)
- left
- right
- up
- down
- forward
- backward
- clockwise
- count_clockwise
- alias: paj7620-up
trigger:
- platform: state
entity_id: sensor.paj7620
to: 'up'
condition:
action:
- service: switch.turn_on
entity_id:
- switch.xxxx
- alias: paj7620-down
trigger:
- platform: state
entity_id: sensor.paj7620
to: 'down'
condition:
action:
- service: switch.turn_off
entity_id:
- switch.xxxx