• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

maxmacstn/MQTT-LEDStrip: A code for ESP8266 microcontroller to control LED Strip ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

maxmacstn/MQTT-LEDStrip

开源软件地址:

https://github.com/maxmacstn/MQTT-LEDStrip

开源编程语言:

C++ 100.0%

开源软件介绍:

HomeBridge-MQTT LED-Strip

forthebadge

A code for ESP8266 microcontroller to control LED Strip via homebridge-mqtt plugin for homebridge which can contron LED Strip from iOS Devices. Implemented from https://github.com/ArnieX/esp8266_dimmer_mqtt

gif https://www.youtube.com/watch?v=2EnSU2nZBkw

Functions

  • Turn on/off
  • Brightness control
  • Manual control with momentary push button.

Prerequisites

  • MQTT Broker (I use Mosquitto)
  • Homebridge-mqtt plugin installed on homebridge

Hardware

I duplicate DIY Dimmer module circuit from https://github.com/ArnieX/esp8266_dimmer_mqtt but I added momentary push button and connected it to D3 and ground (No pull-up resistor needed because I uses built-in pull-up) It control 12V LED Strip using PWM Signal that generated from ESP8266 which can control brightness of the LED Strip Please visit original project link for schematic. Note : Controlling LED from this circuit is invert, 100% PWM Duty cycle is off, 0% duty cycle is full brightness. (You can change invert setting with ISINVERT boolean parameter)

Add accessories to Homebridge-mqtt plugin

According to homebride-mqtt plugin, you can add accessories for LED-Strip to homebridge by sending message(payload) to topic below.

  • topic
homebridge/to/add
  • payload
{
    "name": "LED Strip",
    "service_name": "led_strip",
    "service": "Lightbulb",
    "Brightness": "default"
  }

Usage

  1. Install homebridge-mqtt plugin to your homebridge instance and add accessories to it using topic and payload above.
  2. Feel free to edit source file to suits your requirements and don't forget to change your mqtt server ip to match yours (Mine is 192.168.1.120)
  3. Install dependencies
  • WiFiManager
  • PubSubClient
  • ESP8266wifi
  1. Flash main.cpp to your microcontroller. You can use Aruino IDE or PlatformIO
  2. For the first time, you'll need to connect to your Wifi. First, ESP8266 will create wifi named "ESP8266 LED_Light", connect to it using password 12345678, you'll see login redirect to wifi config page(if not, enter 192.168.4.1 in browser), connect to your wifi.
  3. If everything works, your ESP8266 should followed the command from HomeBridge.

Tested on

  • NodeMCU
  • Wemos D1 Mini

Known bugs

  • Manual light control won't work with LED fade effect because it takes sometime to finished and it blocked main loop, PubSubCilent will not subscribe to topic if main loop was blocked too long.

If you got any problem or suggestions, don't hesitate to contact me, enjoy!




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
thncode/homebridge-fakeswitch发布时间:2022-06-17
下一篇:
jannnfe/homebridge-ESP8266-pojects: This is a directory where I want to share my ...发布时间:2022-06-17
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap