Skip to main content

In an upcoming video on the DIY Smart Home series, we planned to "smartify" the garage door and, of course, it had to be local control without all the fees and ever changing nonsense and security issues that the cloud brings.  One option we picked up was using the Sonoff SV to try, but as an alternative the Moes version of the garage door opener is easy to install.  Out of the box it does come with Tuya/Smart Life firmware, but of course we wanted to get rid of that, and put open source local control software such as Tasmota on it. Moes Garage Door Opener on Amazon

At first glance you might be thinking that someone simply took a Sonoff basic, added a couple wires, and repackaged it; unfortunately that isn't true.  If it was as easy as a Sonoff Basic, we probably wouldn't be writing this article on how to get it to work with Tasmota.  It does have a Tuya module inside, and as of the writing of this article, Tuya-Convert does work on the device.  But before I was quick to convert it, I decided to pop it open and found that it was sporting a TuyaMCU onboard!  I had this funny feeling they were doing something odd and decided to do a bit of sniffing on the TuyaMCU RX/TX serial lines first, and I was glad I did!  So after a couple of Live Streams on YouTube of the process, and banging my head against the wall a bit, I present to you the rules necessary to set this little guy up.

Live Stream #1 & Live Stream #2 on YouTube

Flash the device with either soldering to the chip via USB TTL and Tasmotizer, or use Tuya-Convert.  Do the dance to get the device on your WiFi like you normally would, and browse to the Tasmota GUI using the local IP of the device found from your Router/DHCP Server.  As always upgrade to teh latest Tasmota by utilizing the Firmware Upgrade button in the GUI. Configure your MQTT Broker and Custom Topic like you normally would, then click the Console Button and paste these commands in one by one:

template {"NAME":"Moes Garage","GPIO":\[255,148,255,149,255,255,255,255,255,255,21,255,255\],"FLAG":15,"BASE":18}

module 0

At this point, the device should reboot. Now you might be thinking “Why don't we just use TuyaMCU built into Tasmota?”  The problem with that is during any reboot of the device, it was cycling the relay which could cause your garage door to open at 3 AM!  So we do it raw, plus add a few features!  Go back to the console of Tasmota, and enter these commands in (be careful to grab the entire rule due to word wrapping):

Rule1 on System#Boot do backlog baudrate 9600 ; serialsend5 55aa000300010407 ; serialsend5 55AA0008000007 ; ruletimer1 10 endon on rules#timer=1 do backlog serialsend5 55AA00000000FF ; ruletimer1 10 endon

Rule1 1

This rule sets up the serial communication at boot, sets the LED, sends a command to query the state of the reed switch (i.e., garage door position) in case it changed while the power was off, and then sets up the 10 second heartbeat packet the TuyaMCU requires.

Rule2 on event#doortoggle do serialsend5 55AA0006000501010001000D endon

Rule2 1

This creates an event that is sent from your home automation software (via MQTT) to toggle the relay which opens/closes the garage door.  OK, now for the last rule, and this all on one line!

Rule3 on SerialReceived#Data=55AA0307000565010001007555AA03070005010100010011 do power1 1 endon on SerialReceived#Data=55AA0307000501010001001155AA0307000807020004000000001E55AA03070005650100010075 do power1 1 endon on SerialReceived#Data=55AA0307000565010001017655AA03070005010100010112 do power1 0 endon on SerialReceived#Data=55AA0307000501010001011255AA0307000807020004000000001E55AA03070005650100010176 do power1 0 endon

Rule3 1

This rule watches the TuyaMCU packets for the garage door state (open or closed) via the magnetic reed switch attached to the door.  This rule toggles the fake relay on the Tasmota GUI and can be monitored via the power1 MQTT topic.

powerretain 1

Makes the state of the door being open or closed be retained during a Home Assistant reboot.

Restart the Garage Door Opener.  You can use the Restart button on the GUI of Tasmota.

View on Amazon - Moes Garage Door Opener

But wait . . . can't we do this without all these serial rules on Tasmota with a Sonoff SV?  Absolutely!  But you do have to remember this is an alternative solution that is ready to go in the case, without any wire soldering, 3D printed cases, etc.  Options for everyone, choose the one that best fits your needs.

Home Assistant Sample Configurations

Modify the “GarageDoor” topic below to match the unique topic set in the Tasmota MQTT Configuration:

cover:

  • platform: mqtt

    name: "Garage Door"

    command_topic: "cmnd/GarageDoor/event"

    state_topic: "stat/GarageDoor/POWER"

    availability_topic: "tele/GarageDoor/LWT"

    qos: 1

    payload_available: "Online"

    payload_not_available: "Offline"

    payload_open: "doortoggle"

    payload_close: "doortoggle"

    payload_stop: "doortoggle"

    state_open: "OFF"

    state_closed: "ON"

    device_class: garage

Swap the states of OFF/ON if your status is backwards depending on how the sensor is used/mounted.

Moes Garage Door Opener

Door Sensor and Wire

Accessories for Installation Included

Integrating a Switch into Home Assistant and Setting up the Long Press Action to toggle another switch in the DIY Smart Home.  Join us on this series when we tackle a new home and evolve it into an automated smart home. 

-=-=- Parts -=-=-
Martin Jerry Dimmer
Martin Jerry Switch
Cliff QuickTest
Wago221 Connectors

TuyaConvert Process - https://youtu.be/dt5-iZc4_qU

Home Assistant Install Guide - https://www.home-assistant.io/hassio/installation/

Products We Use/Recommend
Amazon US - https://amzn.to/2YZNDeO
Amazon UK - https://amzn.to/2TnG2R4
Amazon CA - https://amzn.to/2HchPZe

Come chat with us!
Discord - https://discord.gg/bNtTF2v
Patreon - https://www.patreon.com/digiblurDIY

Links to products provided through the Amazon Affiliate program.

So you want to create a Smart Home? Are you unsure what to do and what to get?  Join us on this series when we tackle a new home and evolve it into an automated home.  This episode we are installing and setting up Home Assistant on the Raspberry Pi 4, getting everything ready to install our light switches and automations.

Parts List
Raspberry Pi 4 https://amzn.to/2sNZjCg
Power Supply - https://amzn.to/2TO4Ofn
64gb Micro SD Card - https://amzn.to/2Rh4aFF
Fliirc Case - https://amzn.to/2QuUDKR
APC Battery Backup - https://amzn.to/2utcY21

Others
Martin Jerry Dimmer - https://amzn.to/2Thgun0
Martin Jerry Switch - https://amzn.to/2qowzv3
Lohas 4 pack - https://amzn.to/2Z4qiWd

Hassio Install Guide - https://www.home-assistant.io/hassio/installation/

MQTT Addon Sample Config (Post 105.x)

logins:
- username: diymqtt
password: mqttdiy
anonymous: false
customize:
active: false
folder: mosquitto
certfile: fullchain.pem
keyfile: privkey.pem
require_certificate: false

Products We Use/Recommend
Amazon US - https://amzn.to/2YZNDeO
Amazon UK - https://amzn.to/2TnG2R4
Amazon CA - https://amzn.to/2HchPZe

Come chat with us!
Discord - https://discord.gg/bNtTF2v
Patreon - https://www.patreon.com/digiblurDIY

Links to products provided through the Amazon Affiliate program.

Amcrest AD110 Doorbell integration with Blue Iris and Home Assistant.  I enjoyed this camera and bought myself a 2nd one due to the local control and integration features.  You can also utilize Micro SD card storage as well as Cloud Storage.

Amcrest AD110 Video Doorbell - https://amzn.to/2usgiKT
Doorbell Transformer (only if needed) - https://amzn.to/2seBWSg
Coupon Code - DIGIBLUR

Amcrest Installation Video - https://youtu.be/RWxDH6Ap4FQ

Update#2: New Pull Request on HomeAssistant to add the correct motion sensor for the PIR! Hope to see it merged soon!  https://github.com/home-assistant/home-assistant/pull/30932

UPDATE: It's been found by myself and other users after the video launch that the HA Motion Detection binary is from the video itself and is very sensitive.  In my initial testing it was fine during the day while making the video.  If you find yours too sensitive I'd use a NVR based binary sensor such as Blue Iris to trigger it in the meantime until they expose the PIR and Button push.

-=-=-=- Sample Home Assistant -=-=-=- stream:
amcrest:
- host: 192.168.1.50
name: Doorbell Camera
username: admin
password: yourDEVICEpassword
stream_source: rtsp
binary_sensors:
- motion_detected
- online

Sample Lovelace HomeAssistant Card
aspect_ratio: 50%
camera_view: live
entity: camera.amcrestdoor
name: AmcrestDoorBell
type: picture-entity

Products We Use/Recommend
Amazon US - https://amzn.to/2YZNDeO
Amazon UK - https://amzn.to/2TnG2R4
Amazon CA - https://amzn.to/2HchPZe

Come chat with us!
Discord - https://discord.gg/bNtTF2v
Patreon - https://www.patreon.com/digiblurDIY

Links to products provided through the Amazon Affiliate program.

So you want to create a Smart Home? Are you unsure what to do and what to get?  Join us on this series when we tackle a new home and evolve it into an automated home.  

 -=-=-Parts List-=-=-

Raspberry Pi 4 https://amzn.to/2sNZjCg

Power Supply - https://amzn.to/2TO4Ofn

64gb Micro SD Card - https://amzn.to/2Rh4aFF

Fliirc Case - https://amzn.to/2QuUDKR 

APC Battery Backup - https://amzn.to/2utcY21

Others--

Martin Jerry Dimmer - https://amzn.to/2Thgun0

Martin Jerry Switch - https://amzn.to/2qowzv3

Lohas 4 pack - https://amzn.to/2Z4qiWd

Hassio Install Guide - https://www.home-assistant.io/hassio/installation/

Products We Use/Recommend

Amazon US - https://amzn.to/2YZNDeO
Amazon UK - https://amzn.to/2TnG2R4
Amazon CA - https://amzn.to/2HchPZe

Come chat with us!
Discord - https://discord.gg/bNtTF2v
Patreon - https://www.patreon.com/digiblurDIY

Links to products provided through the Amazon Affiliate program.

Skip to the nonsense and just buy the thing here on Amazon: https://amzn.to/2S9MFpX

In my weirdo tech geek cruising of FCC certifications I stumbled upon an interesting 8 button scene controller by TopGreener.  It fits in a standard decora face plate, flexible to fit in whatever gang size box you choose with standard face plates. The ESP8266 based Tuya module in the internal pictures caught my attention.  I searched the stores for it but alas it wasn't for sell yet. Then the Jedi mind wipe of the holiday season happened, fast forward to January and a viewer, Buckyfan reminded me about this switch and had one in hand!  I found the switch on Amazon and ordered mine immediately.  

So what is this thing and what can I do with it?  It is designed to replace an existing light switch in your home and then add 7 other buttons with single and double tap actions.  Of course following our motto of "Get your shhhzzz... out of the cloud!" we flashed ours with Tasmota using Tuya-Convert.  It doesn't require any special template or anything, simply choose the TuyaMCU module in the Configure Module section and its practically done.  You don't even need to follow my TuyaMCU setup video as the relay/button for the standard light switch is ready to roll.

But what about the other 7 buttons?  Well first that's up to you to come up with 14 actions that you can remember what they all do.  As someone suggested in the live stream showing this switch, it would be mind boggling to put 4 of these side by side.  Just make sure you leave a book for the other household members!  The technical side of things is pretty easy.  There are two methods we will use to tackle this switch/scene controller; Tasmota Rules and NodeRed.

To do all the processing of the buttons with NodeRed, apply this rule in the Tasmota console:

Rule1 on TuyaReceived#Data do publish Scene1/data %value% endon

Then apply the following command to turn the rule on:

Rule1 1

This will make all of the serial messages from the TuyaMCU that interacts with the button presses to be sent to a custom MQTT topic of Scene1/data , you can change this topic in the rule if you want something different.

Then utilize a flow such as the following:

In the Switch Node I have 7 of the 14 buttons as logic branches to call various functions in Home Assistant or whatever you choose to do.  You could also do the same thing inside of Home Assistant automations if you are more comfortable with those.

Serial Message to Button Translations
#1 55AA00070005650400010075   Double Tap - 55AA000700056C040001007C
#2 55AA00070005660400010076   Double Tap - 55AA000700056D040001007D
#3 55AA00070005670400010077   Double Tap - 55AA000700056E040001007E
#4 55AA00070005680400010078   Double Tap - 55AA000700056F040001007F
#5 55AA00070005690400010079   Double Tap - 55AA00070005700400010080
#6 55AA000700056A040001007A  Double Tap - 55AA00070005710400010081
#7 55AA000700056B040001007B  Double Tap - 55AA00070005720400010082

An alternate look, you can move all the translations to Tasmota rules and have it push the various topics/payloads by using these rules.

rule1 on TuyaReceived#Data=55AA00070005650400010075 do publish scene/button1 toggle endon
on TuyaReceived#Data=55AA00070005660400010076 do publish scene/button2 toggle endon
on TuyaReceived#Data=55AA00070005670400010077 do publish scene/button3 toggle endon
on TuyaReceived#Data=55AA00070005680400010078 do publish scene/button4 toggle endon
on TuyaReceived#Data=55AA00070005690400010079 do publish scene/button5 toggle endon
on TuyaReceived#Data=55AA000700056A040001007A do publish scene/button6 toggle endon

rule2 on TuyaReceived#Data=55AA000700056B040001007B do publish scene/button7 toggle endon
on TuyaReceived#Data=55AA000700056C040001007C do publish scene/button1b toggle endon
on TuyaReceived#Data=55AA000700056D040001007D do publish scene/button2b toggle endon
on TuyaReceived#Data=55AA000700056E040001007E do publish scene/button3b toggle endon
on TuyaReceived#Data=55AA000700056F040001007F do publish scene/button4b toggle endon

rule3 on TuyaReceived#Data=55AA00070005700400010080 do publish scene/button5b toggle endon
on TuyaReceived#Data=55AA00070005710400010081 do publish scene/button6b toggle endon
on TuyaReceived#Data=55AA00070005720400010082 do publish scene/button7b toggle endon

Don't forget to turn on your rules with:
Rule1 1
Rule2 1
Rule3 1

Let us know what you plan to use this switch for in Discord and share
some ideas with us!

The 2.3 refresh of the Tuya Convert process with a few additional features such as the Tuya Donor, custom bin file menu, start with ESPHome, update Tasmota, etc.  Flash all your devices without any soldering or opening of devices!  This process allows you to flash your previously locked out devices that wouldn't flash before on the original version of Tuya Convert.  TC will convert both older and newer firmware devices automatically.  Use your Raspberry Pi, Linux PC, Proxmox, etc to unlock all the amazing features of open source firmware.  Protect your privacy and data and keep it in your home.

Parts List
Raspberry Pi 4 or Pi 3
32gb Micro SD Card
Fliirc Case (optional: great RPi heat sink case)
Wemos D1 Mini (optional)

Tuya based favorites
Aoycocr Plugs in Video
Martin Jerry Dimmer
Martin Jerry Switch
4 pack Smart Plugs
Aoycocr Switch 3 LED
Lohas Smart Light 4 pack
and many more

Zemismart downlights
Zemismart downlight (Amazon)

Links
Raspbian Buster Lite - https://downloads.raspberrypi.org/raspbian_lite/images/raspbian_lite-2019-09-30/2019-09-26-raspbian-buster-lite.zip
Etcher Link - https://www.balena.io/etcher/
Putty Link - https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html
Tuya Donor Files - https://github.com/digiblur/Tuya-Convert-Donor

Set your WiFi Country Code!! https://www.raspberrypi.org/documentation/configuration/wireless/wireless-cli.md

Steps for SSH/Putty Terminal
sudo apt update
sudo apt install git
git clone https://github.com/ct-Open-Source/tuya-convert
cd tuya-convert
./install_prereq.sh
./start_flash.sh

NOTE: If you have an issue with a device not working and it is an ESP82xx based device, you can try the older 2.3 branch; delete your old tuya-convert folder, run the git command below then run install_prereq.sh again.

git clone https://github.com/digiblur/tuya-convert -b development

Others

Tasmota - https://github.com/arendst/Tasmota
EspHome - https://esphome.io/
Tasmota MQTT Configuration How-to - https://youtu.be/KOg5qwO3Rh4
ct-Tuya-Convert Github - https://github.com/ct-Open-Source/tuya-convert

Products We Use/Recommend

Amazon US - https://amzn.to/2YZNDeO
Amazon UK - https://amzn.to/2TnG2R4
Amazon CA - https://amzn.to/2HchPZe

Come chat with us!
Discord - https://discord.gg/bNtTF2v
Patreon - https://www.patreon.com/digiblurDIY

Links to products provided through the Amazon Affiliate program.