Touch the Lamp to Open the Curtains!

Here’s something pretty cool that I’m quite pleased with.

Since converting my touch lamps to ESP32, I can use the touch sensing capabilities to do… well… whatever I want!

The automation itself couldn’t be simpler.

alias: Buttons - Spare Room Configuration
description: ""
triggers:
  - alias: Lamp 1 Touched for 1.5 Seconds
    trigger: state
    entity_id:
      - binary_sensor.smart_touch_1_touch_pad_pin_13
    from:
      - "off"
    for:
      hours: 0
      minutes: 0
      seconds: 1.5
    id: Long Lamp Touch
    to:
      - "on"
  - alias: Lamp 2 Touched for 1.5 Seconds
    trigger: state
    entity_id:
      - binary_sensor.smart_touch_2_touch_pad_pin_13
    from:
      - "off"
    for:
      hours: 0
      minutes: 0
      seconds: 1.5
    id: Long Lamp Touch
    to:
      - "on"
conditions: []
actions:
  - choose:
      - conditions:
          - condition: trigger
            id:
              - Long Lamp Touch
        sequence:
          - choose:
              - conditions:
                  - condition: state
                    entity_id: cover.spare_room_curtains
                    state:
                      - closed
                sequence:
                  - action: cover.open_cover
                    metadata: {}
                    target:
                      entity_id: cover.spare_room_curtains
                    data: {}
              - conditions:
                  - condition: state
                    entity_id: cover.spare_room_curtains
                    state:
                      - open
                sequence:
                  - action: cover.close_cover
                    metadata: {}
                    target:
                      entity_id: cover.spare_room_curtains
                    data: {}
mode: single

1 Like