Skip to content

A variety of sensors and actuators connected to the famous ESP8266 and communicating via MQTT. Webserver configuration for WiFi MQTT and sensor/actuator parameters

License

Notifications You must be signed in to change notification settings

papartmike/MQTT-devices-for-ESP8266

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MQTT-devices-for-ESP8266

Scope of Repository

The scope of this repository is to provide a series of ready-made schetches for variety of sensors and actuators that can easily communicate via MQTT using ESP8266 chip family boards. Initally developed for connecting to a generic MQTT platform, the sensors works fine together with home automation framework like Home Assistant, Domoticz, NODE-RED and everything that can easily communicate with an MQTT broker.

Getting Started

Install ESP8266 CORE

These sketches are developed inside the Arduino development enviroment (Arduino IDE) for the ESP8266 bords. Information about how to install the core for such boards are available here:

esp8266 core

Get an MQTT broker

MQTT (aka MQ Telemetry Transport) is a machine-to-machine or “Internet of Things” connectivity protocol on top of TCP/IP. It allows extremely lightweight publish/subscribe messaging transport. In order to make your device communicating you need to connect to an MQTT broker. For testing purposes you can use an online broker like: HiveMQ

A better solution is to choose a broker and to install it on a local machine (i.e. a Raspberry PI). The most widely used at the moment of writing is Eclipse - Mosquitto

Get a Dashboard

In order to easily manage your "things" you should have a platform able to perform automation and give you control and visibility of your devices. Our choice is Home Assistant (HA) integrated together with Node-Red (NR). If you choose to install HA operating system (Hass.IO) it is very easy to install mosquitto and NR on the very same machine (preferred RPI) that will be your HUB for the "things".

Actuators TOPIC and PAYLOAD naming criteria

With ACTUATORS we consider all the devices that perform action FROM the microcontroller to the real world (OUTPUTs). Actuators (LEDs, relays, buzzer, etc...) communicate with Home Assistant standard which means:

  • "ON" payload for turn on device
  • "OFF" payload for turn off
  • Brightness (where supported) the brightness of a light nedds to recieve a value between 0 and 255
  • RGB lights (where supported) the color of a lamp is expressed in ad RGB format like following R,G,B

ACKNOLEDGMENT TOPIC:

Every time a state of an actuator changes (via MQTT or via phisical control) the MCU notifies it communicating the very same payload he recieved (if it recieved that from an MQTT communication). If you want to use it in Home assistant you should use "optimistic: FALSE". the criteria is the following:

  • {topic header}/brightnessSet -> command topic
  • {topic header}/setBrightness -> status topic (confirm, or akcnoledgment topic)

Authors

  • Mike Papa - Initial work - GitHub

License

Copyright (C) 2016-2017 by Marco Provolo

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

About

A variety of sensors and actuators connected to the famous ESP8266 and communicating via MQTT. Webserver configuration for WiFi MQTT and sensor/actuator parameters

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages