ESPhome pour couverture de piscine Maytronics

Bonjour,

Si vous avez une couverture de piscine Maytronics avec la box bluetooth v2.0, voici un moyen très simple de l’intégrer à Home Assistant. Il vous faut juste un ESP32, le préparer pour ESPhome et ensuite vous pouvez utiliser ce YAML:

esp32_ble_tracker:

ble_client:
  - mac_address: YOUR_MAYTRONICS_BOX_MAC_ADDRESS
    id: maytronics_cover

sensor:
  - platform: ble_client
    type: characteristic
    ble_client_id: maytronics_cover
    id: needed_to_open
    name: "Needed to open"
    service_uuid: dfad4778-1b37-4241-b665-f66b2736b956
    characteristic_uuid: d92a2420-a036-41d5-b7d7-6161ce4cead3
    notify: true
  - platform: ble_client
    type: characteristic
    ble_client_id: maytronics_cover
    id: opening
    name: "Opening"
    service_uuid: dfad4778-1b37-4241-b665-f66b2736b956
    characteristic_uuid: 3bcc2430-f209-4055-9566-fcfe3ea27776
    notify: true

cover:
  - platform: template
    name: "Pool cover"
    lambda: |-
      if (id(opening).state == 16) {
        return COVER_CLOSED;
      }
      else {
        return COVER_OPEN;
      }
    open_action:
      - ble_client.ble_write:
          id: maytronics_cover
          service_uuid: dfad4778-1b37-4241-b665-f66b2736b956
          characteristic_uuid: 8bcc63e3-f209-4055-9566-fcfe3ea27776
          value: [0xcb,0x2c,0x7c,0x7c,0x17,0x1f,0x1e,0x75,0x5a,0x11,0x09,0xdc,0x32,0x6c]
    close_action:
      - repeat:
          count: 10
          then:
            - ble_client.ble_write:
                id: maytronics_cover
                service_uuid: dfad4778-1b37-4241-b665-f66b2736b956
                characteristic_uuid: 8bcc63e3-f209-4055-9566-fcfe3ea27776
                value: [0xcb,0x2c,0x7c,0x7c,0x17,0x1c,0x1e,0x75,0x5a,0x11,0x09,0xdc,0x32,0x6d]
            - delay: 1s
    optimistic: true
1 « J'aime »