Announcement

Collapse
No announcement yet.

Share your ESPHome projects here

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Share your ESPHome projects here

    I'd like to use this topic so other people can share their ESPHome projects.

    Here's one of mine: a controller for my garagedoor. With this I am able to open/close the garage and read the state of the following sensors:
    • 2 reed contacts placed on the garagedoor, 1 in the fully opened position and 1 in the fully closed position
    • Ultrasonic sensor to detect if my car is in the garage. I use this to determine if the garage needs to be opened whenever I get home. Or to determine if I should open the door whenever I'm about to leave.
    I've used a D1 mini clone for this. Total project costprice: ~5$

    Code:
    esphome:
      name: garagedoorcontroller
      platform: ESP8266
      board: d1_mini
    
    wifi:
      ssid: "xxxxxxxxx"
      password: "xxxxxxxxxxxxx"
    
    # Enable logging
    logger:
    
    mqtt:
      broker: xxx.xxx.xxx.xxx
      discovery: true
      username: xxx
      password: xxx
    
    ota:
      password: "xxxx"
    
    sensor:
      - platform: ultrasonic
        trigger_pin: D5
        echo_pin: D0
        timeout: 4m
        name: "Ultrasonic Sensor"
        id: ultrasonic_sensor_car
    
    binary_sensor:
      - platform: gpio
        pin:
          number: D7
          mode: INPUT_PULLUP
          inverted: True
        name: "Fully open"
        id: sensor_open
        filters:
          - delayed_on: 250ms
        on_press:
          then:
            - cover.template.publish:
                id: cover_garage
                current_operation: !lambda 'return COVER_OPERATION_IDLE;'
        on_release:
          then:
            - cover.template.publish:
                id: cover_garage
                position: !lambda 'return 0.5;'
                current_operation: !lambda 'return COVER_OPERATION_CLOSING;'
    
      - platform: gpio
        pin:
          number: D6
          mode: INPUT_PULLUP
          inverted: True
        name: "Closed"
        id: sensor_closed
        filters:
          - delayed_on: 250ms
        on_press:
          then:
            - cover.template.publish:
                id: cover_garage
                current_operation: !lambda 'return COVER_OPERATION_IDLE;'
        on_release:
          then:
            - cover.template.publish:
                id: cover_garage
                position: !lambda 'return 0.5;'
                current_operation: !lambda 'return COVER_OPERATION_OPENING;'
    
      - platform: template
        name: "Car in garage"
        lambda: |-
          if (id(ultrasonic_sensor_car).state <= 1.30) {
            return true;
          } else {
            return false;
          }
    
    switch:
      - platform: gpio
        pin: D1
        name: relay
        id: relay
    
    cover:
      - platform: template
        name: "Garagedoor"
        id: cover_garage
        lambda: |-
          if (id(sensor_closed).state) {
            return COVER_CLOSED;
          } else {
            return COVER_OPEN;
          }
        open_action:
          - if:
              condition:
                binary_sensor.is_off: sensor_open
              then:
                - switch.turn_on: relay
                - delay: 1s
                - switch.turn_off: relay
        close_action:
          - if:
              condition:
                binary_sensor.is_off: sensor_closed
              then:
                - switch.turn_on: relay
                - delay: 1s
                - switch.turn_off: relay
        stop_action:
          - switch.turn_on: relay
          - delay: 1s
          - switch.turn_off: relay
    Click image for larger version  Name:	image_85661.png Views:	0 Size:	294.6 KB ID:	1358152

    #2
    DIY 2$ smart doorbell: https://frenck.dev/diy-smart-doorbel...just-2-dollar/

    Using the plugin, you can now easily add it to HomeSeer too!

    Verstuurd vanaf mijn SM-G965F met Tapatalk

    Comment


      #3
      Originally posted by kriz83 View Post
      DIY 2$ smart doorbell: https://frenck.dev/diy-smart-doorbel...just-2-dollar/

      Using the plugin, you can now easily add it to HomeSeer too!
      This is cool. If a AC to DC buck converter like the one below was added you might be able to power it from the doorbell transformer thus doing away with the wall wart.

      https://www.amazon.com/dp/B00SO4T7IU..._t1_B076K8HT8Z

      Comment

      Working...
      X