qwandor / qbutton

A smart button that can send Google Assistant commands.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

qButton

qButton is really three related projects for smart home control in one, all running on ESP8266 boards.

This is not an officially supported Google product.

Standalone smart button

This is a simple standalone WiFi-connected button. It sends a pre-programmed command through the Google Assistant API, which may be used for smart home control, such as to turn a set of lights on or off, start some music, or anything else that you can do with a Google Assistant command.

It is designed to be low-power so that it can run for a while from a small battery. It remains off or in low-power mode until the button is pressed, then quickly starts up, connects to WiFi, sends the command, and turns off again.

Setup

  1. Copy config.h.example to config.h.
  2. Set your client ID, client secret and device model ID for the Google Assistant API in config.h.
  3. Build and install the firmware from the 'button' env using PlatformIO.
    1. $ platformio run --target upload --environment button
  4. Connect the device to power. After a few seconds it will show up as an access point named qbutton.
  5. Connect to the access point from your phone or laptop.
  6. Open http://192.168.0.1/ or http://qbutton.local/ in your browser.
  7. Enter your WiFi network details and click 'Update'.
  8. Reset the device. It should connect to your WiFi network.
  9. Connect to the same WiFi network and open http://qbutton.local/ in a browser, or find the device's IP address (from the serial console or your DHCP server) and use that.
  10. Click the 'set account' link and authorize it to access your Google account.
  11. Set the command you want it to run.
  12. Reset once more. It should now connect and run your command on each reset.

RF button bridge

This is replacement firmware for the Sonoff RF Bridge 433, which lets you pair a large number of 433 MHz RF buttons (of which there are many available) and have each send a certain Google Assistant command.

Setup

  1. Copy config.h.example to config.h.
  2. Set your client ID, client secret and device model ID for the Google Assistant API in config.h.
  3. Open the Sonoff RF Bridge (screws are under stickers on the base), solder a 4 pin header for the serial port. The Tasmota wiki has some more details.
  4. Connect a 3.3V USB serial adapter between the serial pins and your computer, remembering to swap to RX and TX lines.
  5. Switch the switch on the board towards the side that the serial pins are on.
  6. Connect the RF Bridge to power (either via the USB port or from the serial header, not both at the same time) while holding down the button on the side. You can release the button a few seconds after connecting pwoer. This puts it into reflashing mode.
  7. Build and install the firmware from the 'rfbridge' env using PlatformIO.
    1. $ platformio run --target upload --environment rfbridge
  8. Disconnect power and the serial cable. Switch the switch back to the other side.
  9. Connect the bridge device to power. After a few seconds it will show up as an access point named qbutton.
  10. Connect to the access point from your phone or laptop.
  11. Open http://192.168.0.1/ or http://qbutton.local/ in your browser.
  12. Enter your WiFi network details and click 'Update'.
  13. Reset the device. It should connect to your WiFi network.
  14. Connect to the same WiFi network and open http://qbutton.local/ in a browser, or find the device's IP address (from the serial console or your DHCP server) and use that.
  15. Set an admin password for the web interface.
  16. Click the 'set account' link and authorize it to access your Google account.
  17. Enter a command for the first button you want to pair, and click 'Add command'. The bridge should beep.
  18. Hold the RF button you are pairing down until the bridge beeps again.
  19. Repeat for the rest of the buttons you want to pair.
  20. To reflash, run:
    1. $ PLATFORMIO_UPLOAD_PORT=qbutton.local platformio run --target upload --environment miniupdate
    2. $ PLATFORMIO_UPLOAD_PORT=qbutton.local platformio run --target upload --environment rfbridge

Smart switch

This is a simple smart switch for switching on and off whatever devices you can attach to the pins of your ESP8266 board from Google Home, via the Sinric service. It's well suited for low voltage devices, such as fairy lights that can run off 5V from a USB power supply.

Setup

  1. Create an account on Sinric and follow the instructions there to connect it to Google Home.
  2. Add devices there for each device you want to control, with device type 'Switch'.
  3. Copy config.h.example to config.h.
  4. If you're not using my circuit board design, update config.h so that:
    1. SWITCH_PINS has all the pins you want to be able to control.
    2. SWITCH_NAMES has the names you want to display for them in the web interface. These names don't have to match the names you use on Sinric; the names from Sinric are what Google Home will see.
  5. If you want to, enable OTA updates and network or serial logging for debugging in config.h.
  6. Build and install the firmware from the 'switch' env using PlatformIO.
    1. $ platformio run --target upload --environment switch
  7. Connect the device to power. After a few seconds it will show up as an access point named qswitch.
  8. Connect to the access point from your phone or laptop.
  9. Open http://192.168.0.1/ or http://qswitch.local/ in your browser.
  10. Enter your WiFi network details and click 'Update'.
  11. Reset the device. It should connect to your WiFi network.
  12. Connect to the same WiFi network and open http://qswitch.local/ in a browser, or find the device's IP address (from the serial console or your DHCP server) and use that.
  13. Set an admin password.
  14. Enter your Sinric API key.
  15. Enter the switch IDs from your Sinric account for each pin that you want to control.
  16. Connect whatever you want to control to the pins, and try controlling it from the Google Home app or Google Assistant.

About

A smart button that can send Google Assistant commands.

License:Apache License 2.0


Languages

Language:C 54.5%Language:C++ 45.5%