No problem!
You can either get a wink hub to then tie into ha. Which is easy.
The way I am doing it is a custom component over here.
Hopefully one day it is a supported component.
Perfect, thanks! Looks like the hub isnāt super expensive so I might go that route. Though I also like the DIY approach. Really appreciate your response!
+1 for the Garadget recommendation. I have been using it for a few months now and love the HA intergration. The Dev is super responsive too.
Here is my HA scripts.
https://github.com/CCOSTAN/Home-AssistantConfig/blob/master/automation/garadget.yaml
Im using an ESP8266 with a relay and a magnetic sensor. The ESP8266 is connected to HA and Homekit with MQTT. Itās cheap(~$15) and works really well.
Hey PTP,
can you tell me more about your config. I need a āremote HAā in the garage as well to remote control my door
Iām assuming that could be used as a cheap door sensor as well no?
I would be happy to helpā¦
I sent you a PM.
Sure! Why not?
For a fairly simple, hard-wired solution I used this:
- rPi with HA, and setup for rPi binary sensor and rPi relay
- 4-Channel Relay Driver Module
- Reed sensor with magnet w/NO and NC contacts (having NO &NC gives you options for later)
- 5V SPST DIL Reed Relay
- Runs of spare CAT5 cable
I power the driver module off the +5V on rPi and whilst the 4way driver is designed for Arduino, the logic on rPi is switching it no problem.
config.yaml
-
first I activate the correct gpio for the switch and sensor:
switch pi:
- platform: rpi_gpio
invert_logic: False
ports:
24: āGarage Doorābinary_sensor pi:
- platform: rpi_gpio
invert_logic: False
ports:
18: āGarage Door Stateā
And then I make some customisations to the switch. Namely, making it a momentary switch, so it makes brief (300ms) connection.As far as the sensor goes, I prefer reading āopenā and āclosedā as a status, rather than āon/offā which can be misleading.
switch:
- platform: template
switches:
garage_door_pi:
value_template: "{{ False }}"
friendly_name: "Garage Door"
turn_on:
- service: switch.turn_on
entity_id: switch.garage_door
- delay:
seconds: 0.3
- service: switch.turn_off
entity_id: switch.garage_door
turn_off:
service: switch.turn_off
entity_id: switch.garage_door
sensor:
- platform: template
sensors:
garage_door_state:
value_template: >-
{%if states.binary_sensor.garage_door_state.state == 'off' %}
closed
{%elif states.binary_sensor.garage_door_state.state == 'on' %}
open
{% else %}
unknown
{% endif %}
friendly_name: 'Garage Door State'
Youāll notice that I have used 4way relay driver, giving you the option to plug up to four garage doors/etc. Due to limitations of CAT5 (8 wires) I have only ended up using 3 of 4 relays. And here is the finished product, just a simple enclosure and voila.
The whole build cost me NZ$68.30 ~ US$50 (devide by 3 = $16 per channel ), with 4 relays (+ US$6) /4 = $14. Ignoring the cost of CAT5 that I had lying around.
I just ordered an Open Garage for $50.
https://opensprinkler.com/product/opengarage/
Iām surprised no one has used this yet. It should be pretty easy to configure with a Rest Switch and Rest Sensor in Home Assistant.
Iāll post my config when it arrives.
It looks interesting, but @ $50 for one door itās probably one of the more expensive options out there.
Really? I saw recommendations for Garadget which is almost double the cost. I havenāt seen any off the shelf products that are much less than this.
The solution you propose would likely end up costing more than $50. You have to factor in the price of a Rasp Pi, all those components, the wire, the breadboards, not to mention the time to get it configured in the software. Your opening sentence āFor a fairly simple, hard-wired solutionā, made me laugh after I saw the long explanation after it. We have different opinions on what simple means.
There are a lots of options in this area. Different solutions for different people.
@swbradshaw there is no point to go thermonuclear on this. All I said itās āOne of the more expensive optionsāā¦ perhaps āmiddle of the road would be betterā.
My explanation is detailed, so anybody new to the subject can just copy & paste the code.
Rasp Pi is a sunk cost to me, as if you want to run my garage controller off homeassistant, I need it regardless. Everything else is calculated off the shop bill, to the last penny and it works out at about US$20 (factoring in the CAT5). This could have been even less, if Iād ordered the parts online, as my local jaycar electronics shop nearly doubles the price on most components used. Yes a bit of time is needed to configure hass, but if you desire to have āOpen Garageā working with hass, youāll need to do the same.
Of course there are horses for courses and each to their own. I actually started with Belkin Wemo Maker, which is (nearly) plug & play solutionā¦ all you need is a reed sensor for sensing the door closed/open, at the total sum of approx. US$64. That was my first stab at hass and home automation. A fortnight later I realised that there are much more cost effective solutions, hence Iāve gone with my solution above.
Now Iāve just started toying with the idea of using Wemos D1 Mini w/ relay shield for a wifi based garage controller (or any other project that needs a relay and a sensor). The costing is likely going to be sub US$10ā¦ of course not an off-the shelf productā¦
Look at the Sonoff SV https://www.itead.cc/smart-home/sonoff-sv.html
Flash the Tasmoto firmware by arendst GitHub - arendst/Tasmota: Alternative firmware for ESP8266 and ESP32 based devices with easy configuration using webUI, OTA updates, automation using timers or rules, expandability and entirely local control over MQTT, HTTP, Serial or KNX. Full documentation at
Just need a magnetic reed switch and could probably do that for $10 USD.
I wanted to follow up on the Open Garage. As the name suggests, its open source (hardware and software). I bought the first one from them, but for my other garage I ended up building my own with their source (flashing to ESP8266 chip). That cost was under $10. If you are still looking at D1 mini, its a firmware to checkout. At some point Iāll commit my OpenGarage cover component to HASS so it will be supported.
Thanks for that. Iāve now got a bunch of ESP8266 devices myself and it will be interesting to see what your software does and can be used for.
So finally after months of getting distracted with other jobs, Iām getting to our sub-ten-bucks garage opener. Iāve used Wemos D1 mini, relay shield and a little custom board, for the sensor connections, plus a reed switch. As @HickHackerz suggested I used the arendst/Tasmota firmware to power the device. A little mind boggling to workout how to connect the sensor, though it might have been due to me trying to work it out at 2am.
Otherwise, Tasmota is grand firmware, especially on the Wemos. It comes with a webserver built in, so you can customise a lot of the parameters in your browser, it supports a MQTT messaging and OTA updates. The Wemos D1 mini sports a pull-up resistor on GPIO0 (and GPIO2, though that is used by the relay shield) and a pull down on GPIO15 (more about wemos d1 mini pin outs).
UPDATE: Donāt use the GPIO0/2 for the reed sensor, as it crashes the wemos on reboot. Instead use a 10k pull up resistor and say GPIO16/pin D0.
So now back to costs:
- reed switch - ~ $1
- Wemos d1 mini - $4
- Relay shield - $2.10
- Custom board- ~$1.50 (much less from China, but I bought the terminal point at a local shop)
- 5VDC microUSB source - $3 (from IT recyclers)
- Cableā¦ probably the most expensive item @ $0.56/m.
- Case - let your imagination go wildā¦ a plastic box from screws.
Total cost $11.60 plus cable, depending on distance from your reed switch. Provided that you bargain down your local thrift store,etc and get your microUSB charger cheaper and source the custom board bits from the Far East, sub-$10 garage opener is ( in Mythbustersā words) PLAUSIBLE!
UPDATED: The custom board in the above image has been rewired and equipped with a 10k resistor, as in the image below. Apologies for the horrible wiringā¦
Iāve used a Xiaomi WiFi plug ($10), a $12V DC adapater ($3), and a 12V NO automotive relay ($6).
Under $20 solution provided you have a couple of lengths of wire and some crimp connectors already. If not add another couple of $. Extremely simple to setup. The hardest part was getting the wifi plug integrated into HA. But after that we were away.
This wonāt give you open/close detection however I already had a Xiaomi gateway, so added a Xiaomi door sensor for a few more $
Those who want to avoid soldering and long wires, please consider open-source controller Garadget starting at $69. Latest firmware supports direct MQTT integration with Home Assistant.
Question? AMA.