Skip to content
Programmable smart device for Home Automation and IoT applications.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.idea consolidating draft code Jan 31, 2019
data
include HomeGenie-mini initial commit. Jan 9, 2019
lib/NTPClient-master added NTP client; added formatted timestamps to events messages Jan 23, 2019
pcb
src
test added X10 message decoding/encoding class Jan 17, 2019
.gitignore fix git ignore Jan 27, 2019
.travis.yml
CMakeLists.txt implemented WPS button and status LED; refactored NetManager class; i… Feb 16, 2019
CMakeListsPrivate.txt
LICENSE added logger; more refactoring Jan 10, 2019
README.md
platformio.ini adding CI / removed unused deps Feb 2, 2019

README.md

Travis Build Status

HomeGenie Mini

HomeGenie mini (code name Sbirulino) is an open hardware + firmware solution for building smart devices based on the popular ESP8266 chip, a WiFi capable micro controller.

HomeGenie Mini Quick Setup Video

(click the picture above to watch the video)

Hardware features

  • WPS button for quick WiFi protected setup
  • Temperature and light sensors
  • RF transceiver (315/330/433Mhz)
  • Expansion connector (P1) with 4 GPIO configurable as SPI/DIO/PWM

Example applications of the P1 connector:

  • control up to 4 relays to actuate lights and appliances (DIO)
  • hosting additional sensors, connecting a display or other hardware (SPI)
  • control the brightness of a led or drive a motor at different speed (PWM)
  • breadboard playground

Firmware features

  • Automatic discovery (SSDP) for instant client setup
  • GPIO mapping to virtual modules: switch for digital output, dimmer for analog output or sensor for inputs (work in progress)
  • X10 home automation RF protocol encoding and decoding with mapping to virtual modules
  • Modules state persistence
  • HTTP API (subset of standard HomeGenie API)
  • Real time event stream over WebSocket or SSE connection
  • MQTT broker over websocket
  • NTP client for time sync
  • Scripting engine (work in progress)
  • Serial CLI with same API as HTTP

Assembling a HomeGenie Mini device

HomeGenie Mini PCB front and rear

HomeGenie Mini board front and rear view

STEP 1: Start by soldering the 3 resistors, 2 LEDS, light sensor, temperature sensor and the momentary switch button

HomeGenie Mini assembling step 1

STEP 2: Solder the header pins to the D1 Mini

HomeGenie Mini assembling step 2

STEP 3: Solder the D1 Mini to HomeGenie Mini board

HomeGenie Mini assembling step 3

STEP 4: Optionally solder the RF receiver and transmitter: the firmware currently only support X10 home automation protocol. More protocols might be added in the future (any request?).

The picture below shows a basic HomeGenie Mini device without the RF transceiver but adding the RF transceiver is easy as solder two more components. You can also take advantage of the expansion port (P1) to connect a relay module to control lights and appliances or any other additional sensors/components required for your projects.

HomeGenie Mini assembling step 4

Building and flashing the firmware

HomeGenie Mini firmware is based on Platform.IO. You can choose to build firmware without installing the code editor but just the Platform.IO core. After installing Platform.IO core you can build the firmware by entering this command:

platformio update
platformio lib install
platformio run

If you prefer installing the whole IDE follow instructions for Platform.IO IDE installation instead.

To install the firmware connect HomeGenie Mini to the USB port of your PC and issue the command:

platformio run -t upload

Congratulations!! =) You've just got a new shiny HomeGenie Mini device up and running.

HomeGenie API

HomeGenie Mini API is a subset of HomeGenie Server API that makes HomeGenie Mini a real fully working light version of HomeGenie Server specifically designed for micro controllers.

HomeAutomation.HomeGenie

Implemented subset:

EXAMPLE Request

GET /api/HomeAutomation.HomeGenie/Config/Modules.Get/HomeAutomation.HomeGenie/mini

Response

{
  "Name": "HG-Mini",
  "Description": "HomeGenie Mini node",
  "DeviceType": "Sensor",
  "Domain": "HomeAutomation.HomeGenie",
  "Address": "mini",
  "Properties": [{
    "Name": "Sensor.Luminance",
    "Value": "114",
    "Description": "",
    "FieldType": "",
    "UpdateTime": "2019-01-30T13:34:02.293Z"
  },{
    "Name": "Sensor.Temperature",
    "Value": "18.25",
    "Description": "",
    "FieldType": "",
    "UpdateTime": "2019-01-30T13:34:02.293Z"
  }],
  "RoutingNode": ""
}

HomeAutomation.X10

Implemented subset:

HomeGenie Mini specific API

It's possible to control the 4 GPIOs on the P1 expansion port using the following API:

  • /api/HomeAutomation.HomeGenie/<pin_name>/Control.On
  • /api/HomeAutomation.HomeGenie/<pin_name>/Control.Off
  • /api/HomeAutomation.HomeGenie/<pin_name>/Control.Level/<level>

Where <pin_name> can be D5, D6, D7 or D8 and <level> a integer between 0 and 100.

Examples

# Set output D6 to 50% (1.65V)
/api/HomeAutomation.HomeGenie/D6/Control.Level/50

# Set output D5 to 100% (3.3V)
/api/HomeAutomation.HomeGenie/D5/Control.Level/100
# or
/api/HomeAutomation.HomeGenie/D5/Control.On

# Set output D8 to 0% (0V)
/api/HomeAutomation.HomeGenie/D8/Control.Level/0
# or
/api/HomeAutomation.HomeGenie/D8/Control.Off

Components listing

Gerber files required for printing the circuit board are located in the ./pcb folder.

You can use the Gerber file and autonomously get HomeGenie Mini board manufactured from any PCB print service.

If just need a few boards you can get 3 boards for less than $20 from AISLER. Open AISLER website and click Get Started then you will be able to upload HomeGenie Mini Gerber file and order your PCBs.

The PCB size is 44mm*50mm.

Components listing

  • 1 ESP8266 WeMoo D1 mini WiFi module (or equivalent)
  • 1 DS18B20 (temperature sensor)
  • 1 LDR (light sensor)
  • 1 FS1000A (RF transmitter)
  • 1 XY-MK-5V (RF receiver)
  • 1 R1 10kΩ
  • 1 R2 4.7kΩ
  • 1 R3 330Ω
  • 1 R4 330Ω
  • 2 LED 3mm
  • 1 Push button 6mm*6mm

Source code

Release

Disclaimer

THIS PROJECT IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS PROJECT, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

You can’t perform that action at this time.