HeimgardTechnologiesAS / homecontrol-mqtt

Software to enable you to make your own IoT devices and connect them to Home Control AS powered smart home systems.
https://www.homecontrol.no
MIT License
5 stars 3 forks source link
arduino embedded esp32 iot mcu nodemcu raspberry

Heimgard Technologies

Heimgard Technologies (formerly Homecontrol) is a Norwegian energy management and home automation provider. More information about the system and preorders can be found here:

Wiki

Check the Wiki in this repository for more information and description of the protocol

Why this library

HGT provides an open source Arduino library for integration with your smart home. This library enables microcontrollers, with MQTT capability, to connect to the HomeControl system. This gives you, as a user, the ability to use HomeControl solution for home automation with your DIY hardware. You can use gateway and app to have control and feedback over all your devices. It runs on super-low cost hardware and can be used to integrate Your existing projects.

MQTT

MQTT is a machine-to-machine (M2M)/"Internet of Things" open source connectivity protocol. It was designed as an extremely lightweight publish/subscribe messaging transport. It is useful for connections with remote locations where a small code footprint is required and/or network bandwidth is at a premium.

Getting started:

Arduino

The Arduino Software (IDE) allows you to write examples and upload them to your board. IDE can be downloaded here. If you have a reliable internet connection, you can use the online IDE. It will allow you to save your sketches in the cloud, having them available from any device and backed up.

To download HomeControl open source Arduino library, click the DOWNLOAD button in the top right corner and uncompress the folder. Place the homecontrol library folder to your /libraries/folder. You may need to create the libraries subfolder if this is your first library. Restart the IDE.

You can open one of the HomeControl example sketch: File > Examples > homecontrol-mqtt

Select the board You are using (Tools > Board) and correct serial port of the board (Tools > Port). If You are using one of the verified ESP controllers, start IDE and open Preferences window. Enter http://arduino.esp8266.com/stable/package_esp8266com_index.json into Additional Board Manager URLs field. You can add multiple URLs, separating them with commas. Open Boards Manager from Tools > Board menu and install esp8266 platform (don't forget to select your ESP8266 board from Tools > Board menu after installation).

Make sure you select 2.4.1/2.4.2 version when installing esp8266 platform. While 2.5.2 version is available, it has a bug that, once fixed, will allow you to compile and upload sketches on the board, but the app will not recognize it.

We also support ESP32. Tested using version 1.0.4.

On Windows, port this should be something like COM2 (or some other number), on the Mac, this should be something like /dev/cu.usbserial-1B1.

Push the reset button on the board then click the Upload button in the IDE. Wait a few seconds. If successful, the message "Done uploading." will appear in the status bar.

Other platforms

Raspberry Pi and PC builds has more information in the subfolder examples_rpi_pc

Examples:

Arduino

HomeControl is providing You examples composed of specific endpoints for each application:

Your smart devices can be a combination of multiple endpoints from this library. That way devices can be implemented for virtually every user need.

Make sure you delete the device in the app (can be done in Settings > Manage devices) before you upload the sketch of another device or the current one that underwent significant changes. The app is set to keep the last known configuration, and it may cause trouble during the testing period.

Other platforms

This platforms will have examples in their own subfolders