/PAJ7620-ESPHome

Connecting the PAJ7620 (GY-PAJ7620) gesture sensor to the Home Assistant via ESPHome and ESP8266

Primary LanguageC++

Подключаем датчик жестов PAJ7620 (GY-PAJ7620) в Home Assistant через ESPHome и ESP8266

  1. Положить paj7620_.h в каталог, где лежит yaml-файл проекта
  2. Добавить в yaml-файл
esphome:
  includes:
    - paj7620_.h
  libraries:
    - "Wire"
    - "seeed-studio/Gesture PAJ7620"
  1. Добавить в 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
  1. Собрать

  2. Подключить всё, как в этой статье:

Схема подключения

Всё, можно махать руками.)

Множество состояний сенсора

  • 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