Giter Site home page Giter Site logo

pipicogaragehomebridge's Introduction

PiPicoGarageHomebridge

Control a garage door using a Raspberry Pi Pico W, a relay, three resistors and Homebridge.

This project is meant for garage doors that only have a single input for start / stop / reverse.

Because these doors are quite "stupid", in some cases we'll have to make some assumptions on the door state, but it's still possible to make a fully functioning smart garage door controller with just the one input and two sensors that detect if the door is fully open or closed.

YouTube Video

To learn more, check out the YouTube video I made about the Garage Door Opener

IMAGE ALT TEXT HERE

Setting up the hardware

In order to control the door and detect if the door is opened or closed, we need to use three pins on the Raspberry Pi Pico.

The pins that I have chosen are:

Relay: Pin 21

Sensor to detect if the door is opened: Pin 19

Sensor to detect if the door is closed: Pin 20

The relay connects directly between Pin 21 and ground. The Impulse input is connected between COM and NO on the relay through a 180 Ohm resistor.

The Open and Closed sensors are connected to Pin 19 and 20 using 10k resistors.

Installation on the Pi Pico

Make sure that you have Micropython installed on your Raspberry Pi Pico.

Edit the wifi setting in the main.py file and upload through your favourite tool, such as Thonny.

Connecting to Homebridge

In order to connect the Pi Pico to Homebridge, I'm using the HTTP Advanced Accessory plugin by staromeste.

You can find the plugin here: https://github.com/staromeste/homebridge-http-advanced-accessory

This plugin is very powerful, but not very user friendly as it needs to be configured using JSON to talk to and understand accessories.

But don't despair. I included a working configuration file in this repository. Just copy and paste the contents into the plugin configuration. The only thing you need to do is replace "YOUR_PI_PICO" with the IP-address of your device.

pipicogaragehomebridge's People

Contributors

mannbro avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

pipicogaragehomebridge's Issues

Web UI API

Hey, thanks for this. I've been wondering how to use the pico with Homebridge.

What are the cons of using a virtual accessory (Webhooks) and using the UI interface to update its state from the pico only when there is a status change.

GET/PUT
/api/accessories/{uniqueId}

Get/Set the value of an accessory characteristic.

An option would be send the accessory ID or entire URL in the body of the Open and Close request sent from the accessory.

This may make it easier for people like me and we would be using verified plugins that hopefully will be supported for some time.

Thanks again.

I have not tried micro python or my pico yet. Now, thanks to you, I have a starting point. I could for example use a pico as the hardware end for an HVAC system.

currentState reversed when opening the garage door manually

Hi there!

Thank you for this Pi Pico garage door controller, it works great! I'm fairly new to tinkering with the Pi Pico. While testing I found out when opening the garage door manually, the state in the Home app is reversed. It would say 'closing' until the state 'fully opened' and vice versa. I noticed that the currentState is depending on the (last) targetState as shown below.

        if targetState==TARGET_DOOR_STATE_OPEN:
            currentState=CURRENT_DOOR_STATE_OPENING
        elif targetState==TARGET_DOOR_STATE_CLOSED:
            currentState=CURRENT_DOOR_STATE_CLOSING

I'm trying to figure this out by myself as part of the fun, but I just wanted to let you know.

Kind regards,
Dennis

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.