Entropy Reduction

Personal log of yet another digital native.


Project maintained by andre-abadi Hosted on GitHub Pages — Theme by mattgraham

Purpose

Actions

Reflections

Code

switch:
  - platform: gpio
    pin: D1
    id: d1
    name: "${friendly_name} Light"
    restore_mode: ALWAYS_ON
    internal: true

binary_sensor:
  - platform: gpio
    id: d2
    icon: mdi:radiobox-marked
    name: "${friendly_name} Button"
    #device_class: garage_door
    pin:
      number: D2
      inverted: true
      mode: INPUT_PULLUP
    filters:
      - delayed_off: 30s
    # automation when button is pressed
    on_press:
      - repeat:
          count: 15
          then:
            - switch.turn_off: d1
            - delay: 50ms
            - switch.turn_on: d1
      - switch.turn_off: d1
    on_release:
      then:
        - switch.turn_on: d1