We can use a lot of different versions of ESP8266 such as Nodemcu. Here you will see V2 and V3. This is the easist way to flash and use HomeHome.App firmware.
Relay and Button pins can be customized as needed of your device.
There are ready embedded devices for easy select in setup menu like: Sonoff Basic, Dual (R2 Version), 4ch Pro, TH10/16 (Thermostat), Shelly 1, Shelly 2.5... You can find a lot of sources about how to flash Sonoff and other manufacturers products. wiki1 , wiki2
You can set 1-2-4 relay & button on-off switch or roller shutter/blinds with 2 relay & button
If you don't know how to flash Sonoff or others (GPIO-0 must be HIGH to enter flash mode when you give power) please check these repo's wiki1 or wiki2 or try google "how to flash xxxxx device" Skip this for nodemcu, wemos dev boards.
There are 3 easy ways to flash
1.Way - Windows / Mac : A ) Get Windows standalone executable
B ) Run in terminal
pip3 install tasmotizer
After installation start your device in flash mode. (GPIO-0 is HIGH)
2.Way - Terminal Commands :
We suggest you to backup your original firmware because everything will be lost on the device.
esptool.py -p /dev/cu.SLAB_USBtoUART --baud 115200 write_flash -fs 1MB -fm dout -ff 40m 0x0 /downloads/homehome.bin (/dev/cu.SLAB_USBtoUART change this with your com port. Same command for nodemcu and 1mb boards.)
3.Way - Espressif Tool: If you don't want to use terminal commands you can Espressif's download windows flash tool Espressif is manufacturer of ESP8266.
First plug USB cable and ERASE the chip.
Unplug and plug USB cable and START flash.
Unplug and plug USB cable after flash finished.
Connect to HomeHome-xxxxxx WiFi network.
Select HomeHome.bin from your download folder and write to 0x0
SPI Speed 40MHz
Flash Size 8Mbit (same for 1MB/4MB boards)
Only SPI MODE is different for boards.
DEVICE WITH 1-MB FLASH : SPI MODE: "DOUT"
DEVICE WITH 4-MB FLASH [NODEMCU] : SPI MODE: "DIO"
After successful upload unplug and plug power of your device. Now connect to your device WiFi network.
Select HomeHome-xxxxxx and enter pass homehome
3-Custom Pins Setup with Nodemcu
Buttons can be momentary or toggle.
You can set your device as roller shutter / blind if it has 2 relays. For example Sonoff Dual(R2) can be selected as roller shutter or you can select custom pins for relays and buttons.
You can find a lot of info about usable pins of ESP8266 with Google. Check this.
Be careful! You may see that your relay board have reversed pins. Do not connect any cable until you are sure with pin directions.There will be a 'Reverse pin' setup in the settings page of your device.Use at your own risk!
Set fields as you need. Enter GPIO# or leave blank. Relay required. You can leave blank the 'Reset, Led and Button'. Set 1-2-4 relay(s), 3 relays not supported.
Example 4 Relays On-Off nodemcu GPIO setting:
Relay2=4(d2) Relay3=14(d5) Relay4=12(d6) Button1=13(d7) Button2=3(RX) Button3=1(TX) *Button4=10(SDD3) or 2(d4) *10(SDD3) or 2(d4) for nodemcu V2 and 2(d4) for nodemcu V3 Reset button=16(d0) Led=2(d4) if you use GPIO2 for button don't set a pin for LED
Example Roller Shutter / Blinds nodemcu setting:
Relay1=5(d1) - Relay2=4(d2) Button1=12(d6) - Button2=13(d7) Reset button=16(d0) - Led=2(d4)
VIN pin which is 5dc from USB cable goes to Relay board's VCC. JD-VCC jumper is on.
Gmail required. It must be the same with your Android device account.
Set optional static ip, you must know your Gateway IP (like 192.168.0.1) and Subnet Mask (like 255.255.255.0) or you can set a static ip from your router.
Select your WiFi from network list and write your WiFi password correctly.
Save your settings, wait 5 seconds and unplug-plug USB cable.
You can pair the device in 90 seconds after you plug the USB cable. HomeKit pair code is 111-88-111
Wait 1 minute and HomeKit will be ready to use.
Long press the accessory > settings to find your device ip
6-Google Home Setup
Unplug and plug Nodemcu and open Google Home from your Android.
At top-left corner "+" > "Set up device" > "Works with Google" > "+HomeHome"
You will see login screen.
Log in with Google and select the same gmail account you wrote in device setup.
Your devices will be in your Google Home application after you login. Set them to a room.
You can change device names in HTTP server of your device.
Write the IP of your ESP8266 and setup device name. Note that HomeKit device names can be editted in HomeKit application.
Turn on-off and see HomeKit and Web UI will be synchronized.
7- HTTP Local Server and WEB UI
Find your device ip : Open HomeKit, long press the accessory > settings or check your router DHCP list
Go to smart.homehome.app activate your device now you can control it from WEB UI & Google Home.
You can also control the device without an Apple hub (iPad, Apple TV, HomePod)
8- 3.Party App Communication
You can control HomeHome.App with 3th party apps.
Your email adress must be gmail so don't add @gmail.com
Turn on 1. relay: 'http://ip.address/1/on?myEmail'
Turn off 1. relay: 'http://ip.address/1/off?myEmail'
All state replies are in array for example: [0,1,2,2] 0 --> off , 1 --> on , 2 --> none
Get all relay states: 'http://ip.address/all?myEmail'
1-2-4 relay devices are using the same firmware so we push all together. You can easly understand this is a 2 relay device. First relay is off, second relay is on in this example.