All Projects → corbanmailloux → Esp Mqtt Rgb Led

corbanmailloux / Esp Mqtt Rgb Led

Licence: mit
MQTT RGB LEDs Using JSON for Home Assistant

Projects that are alternatives of or similar to Esp Mqtt Rgb Led

Sonoff Homeassistant
Firmware for ESP8266 based itead Sonoff switches for use with HomeAssistant
Stars: ✭ 354 (+46.89%)
Mutual labels:  homeassistant, mqtt, esp8266
Home Assistant Config
My Home Assistant Configuration 🏡🏡
Stars: ✭ 133 (-44.81%)
Mutual labels:  homeassistant, mqtt, esp8266
Esp Mqtt Json Multisensor
(OBSOLETE) ESP MQTT JSON Multisensor for Home Assistant. Supported sensors include the TEMT6000 light, AM312 PIR, DHT22 temperature/humidity sensors. RGB led supports flash, fade, and transition. Over-The-Air (OTA) uploading, too!
Stars: ✭ 323 (+34.02%)
Mutual labels:  homeassistant, mqtt, esp8266
Haswitchplate
LCD touchscreen for Home Automation
Stars: ✭ 666 (+176.35%)
Mutual labels:  homeassistant, mqtt, esp8266
Ems Esp
ESP8266 firmware to read and control EMS and Heatronic compatible equipment such as boilers, thermostats, solar modules, and heat pumps
Stars: ✭ 226 (-6.22%)
Mutual labels:  homeassistant, mqtt, esp8266
Hass Yaap
Yet another alarm (control) panel for Home Assistant.
Stars: ✭ 44 (-81.74%)
Mutual labels:  homeassistant, mqtt, esp8266
Smarthome
SmartHome: firmware per ESP8266 - Casa domotica
Stars: ✭ 28 (-88.38%)
Mutual labels:  homeassistant, mqtt, esp8266
Hugo Esp8266
Hugo is a 4-button ESP8266 Wi-Fi Remote, Arduino compatible and simple to use.
Stars: ✭ 77 (-68.05%)
Mutual labels:  homeassistant, mqtt, esp8266
Mqtt Ir Transceiver
ESP8266 based bidirectional bridge between MQTT and IR (change MQTT message to IR signal and change received IR signal to MQTT message)
Stars: ✭ 130 (-46.06%)
Mutual labels:  mqtt, esp8266
Blinker Doc
blinker中文文档
Stars: ✭ 139 (-42.32%)
Mutual labels:  mqtt, esp8266
Temper Esp8266
Temper is a compact temperature sensor based on ESP8266 and SHT30 with large 13x7 pixel led display.
Stars: ✭ 155 (-35.68%)
Mutual labels:  mqtt, esp8266
Coogleiot
A ESP8266 Library for easy IOT device development
Stars: ✭ 118 (-51.04%)
Mutual labels:  mqtt, esp8266
Itead sonoff
Alternative firmware for Itead Sonoff switches, based on the MQTT protocol and a TLS connection
Stars: ✭ 115 (-52.28%)
Mutual labels:  mqtt, esp8266
Mqtt433gateway
MQTT 433.92 MHz radio-frequency device gateway
Stars: ✭ 111 (-53.94%)
Mutual labels:  mqtt, esp8266
Openmqttgateway
MQTT gateway for ESP8266, ESP32, Sonoff RF Bridge or Arduino with bidirectional 433mhz/315mhz/868mhz, Infrared communications, BLE, Bluetooth, beacons detection, mi flora, mi jia, LYWSD02, LYWSD03MMC, Mi Scale, TPMS, BBQ thermometer compatibility, SMS & LORA.
Stars: ✭ 2,413 (+901.24%)
Mutual labels:  mqtt, esp8266
Espmqttclient
Wifi and MQTT handling for ESP8266 and ESP32
Stars: ✭ 169 (-29.88%)
Mutual labels:  mqtt, esp8266
Home Assistant Configuration
My Home Assistant Config. For more Information visit ->
Stars: ✭ 102 (-57.68%)
Mutual labels:  homeassistant, mqtt
Amstomqttbridge
Minimalistic system to read AMS/HAN data from electrical meter
Stars: ✭ 165 (-31.54%)
Mutual labels:  mqtt, esp8266
Pjon
PJON (Padded Jittering Operative Network) is an experimental, arduino-compatible, multi-master, multi-media network protocol.
Stars: ✭ 2,615 (+985.06%)
Mutual labels:  mqtt, esp8266
Irbaby
基于 ESP8266 利用 IRext 开源红外库实现万能红外遥控,已对接 MQTT 协议,可轻松接入 HomeAssistant 💣
Stars: ✭ 187 (-22.41%)
Mutual labels:  mqtt, esp8266

ESP8266 MQTT RGB(W) Lights Using JSON for Home Assistant

This project adds an easy way to create DIY lighting for Home Assistant, an amazing, extensible, open-source home automation system.

I was frustrated that the built-in MQTT light didn't support transitions (fading between colors/brightnesses), and that it uses multiple separate calls to set the different values (state (on/off), brightness, color), so I decided to make my own version. As of version 0.26, the MQTT JSON light platform has been merged into Home Assistant.

By sending a JSON payload (in an MQTT message), Home Assistant can include whichever fields are necessary, reducing the round trips from 3 to 1. For example, this is a sample payload including most of the fields:

{
  "state": "ON",
  "brightness": 120,
  "color": {
    "r": 255,
    "g": 100,
    "b": 100
  },
  "transition": 5
}

Installation/Configuration

To set this system up, you need to configure the MQTT light component in Home Assistant and set up a light to control. This guide assumes that you already have Home Assistant set up and running. If not, see the installation guides here.

The Home Assistant Side

  1. In your configuration.yaml, add the following, depending on the supported features of the light:

    # Only one color:
    light:
      - platform: mqtt
        schema: json
        name: mqtt_json_light_1
        state_topic: "home/json_brightness"
        command_topic: "home/json_brightness/set"
        brightness: true
        effect: true
        effect_list: [flash]
        optimistic: false
        qos: 0
    
    # RGB:
    light:
      - platform: mqtt
        schema: json
        name: mqtt_json_light_2
        state_topic: "home/rgb1"
        command_topic: "home/rgb1/set"
        brightness: true
        rgb: true
        effect: true
        effect_list: [colorfade_slow, colorfade_fast, flash]
        optimistic: false
        qos: 0
    
    # RGBW:
    light:
      - platform: mqtt
        schema: json
        name: mqtt_json_light_3
        state_topic: "home/rgbw1"
        command_topic: "home/rgbw1/set"
        brightness: true
        rgb: true
        white_value: true
        effect: true
        effect_list: [colorfade_slow, colorfade_fast, flash]
        optimistic: false
        qos: 0
    
  2. Set the name, state_topic, and command_topic to values that make sense for you.

  3. Restart Home Assistant. Depending on how you installed it, the process differs. For a Raspberry Pi All-in-One install, use sudo systemctl restart home-assistant.service (or just restart the Pi).

The Light Side

I'm using ESP8266-01 microcontrollers for my lights because they are so cheap and small. The downside of the size and price is that programming them can be a bit of a hassle. There are many sites that go into detail, so I won't do it here. You'll need an ESP set up to work with the Arduino IDE. See the readme here for instructions. Another good device to work with is the Wemos D1 Mini, which has a built-in micro-USB port and is much easier to program.

  1. Using the Library Manager in the Arduino IDE, install ArduinoJSON and PubSubClient. You can find the Library Manager in the "Sketch" menu under "Include Library" -> "Manage Libraries..."
  • NOTE:: At the moment, this project only supports ArduinoJSON version 5. The default is now version 6, so you'll have to specify the version to install in the dropdown in the Library Manager window.
  1. Open the mqtt_esp8266_light project in the Arduino IDE.
  2. Update the config-sample.h file with your settings for LED type, pin numbers, WiFi settings, and MQTT settings.
  3. Review the comments to help with the options. For the CONFIG_STRIP option, choose one of BRIGHTNESS, RGB, or RGBW.
  4. Ensure that the CONFIG_MQTT_CLIENT_ID setting is a unique value for your network.
  5. Set CONFIG_MQTT_TOPIC_STATE and CONFIG_MQTT_TOPIC_SET to match the values you put in your configuration.yaml.
  6. Save the configuration file as config.h.
  7. Open the .ino file in the Arduino IDE and upload to an ESP with the correct connections.

About the DEPRECATED Folder

Originally, there were separate Arduino sketches for each of the supported light types. This quickly became redundant and hard-to-maintain, so the new, unified sketch was created.

Please use this (mqtt_esp8266_light) sketch going forward. The deprecated sketches will not receive new features and will be removed from the project in the future.

Wiring

For an RGB LED strip using N-MOSFETs for control, you'll want to wire it similar to this: RGB Wiring

Note that the MOSFETs have pull-up resistors in this setup. This means that the lights may flash on when the module resets, but it was necessary to keep the ESP's pins in the right start state.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].