Could be. I grabbed 1.7.1 which was the newest posted.
Edit: would definitely appreciate your updates
Could be. I grabbed 1.7.1 which was the newest posted.
Edit: would definitely appreciate your updates
Super! Donât hesitate to ask anything if youâre stuck
Yeah, PlatformIO is pretty nice. Iâm using Arch Linux for all my coding / hackingâŠ
If you have a look at the Espurna source code (https://bitbucket.org/xoseperez/espurna/src/a042efb5106aa7dae4b26e3975910f20c81908fb/code/espurna/light.ino?fileviewer=file-view-default), you can see functions (color_rgb2array
) that convert a RGB triplet into a HEX color.
I wrote my own firmware that publishes the colors as HASS wants them
so when will you publish your firmware with OTA and all the goodie stuff?
With Xose PĂ©rez firmware is it only possible to turn the bulb on/off and change color, not set the brightness?
The last time I looked at the source code for something I got sucked into developing an application, so Iâm realllllly trying to avoid it here But loving seeing what you guys are working on here, the evolution will happen
I have problem to get the MQTT to work, when I eneter the commands (see below) nothing happens. I have configured the bulb and I can see in status site that the MQTT is âConnectedâ but when I try to send commands from my RPi with Hass and Mosquitto.
This is the commands I did try sending from my RPi
mosquitto_pub -u pi -P xxxxxxxx -t â/test/switch/AI LIGHT_AC38FB/relay/colorâ -m â#FF0000â
mosquitto_pub -u pi -P xxxxxxxx -t â/test/switch/AI_LIGHT_AC38FB/relay/colorâ -m â#FF0000â
mosquitto_pub -u pi -P xxxxxxxx -t â/test/switch/AI-Light01_AC38FB/relay/colorâ -m â#FF0000â
mosquitto_pub -u pi -P xxxxxxxx -t â/test/switch/AI-Light01 AC38FB/relay/colorâ -m â#FF0000â
Thereâs no error message and my â/var/log/mosquitto/mosquitto.logâ is empty
The curl commands works fine, itâs just the mqtt that I canât get to work.
Hereâs some info for my system
chip id: AC38FB
hostname For the bulb): AI-Light01
RPi: IP 192.168.50.35
Hereâs screenshots of the bulb
Does anyone have any idea what could be wrong?
Does your MQTT broker require authentication? If not, then leave the MQTT user field blank.
Publishing messages without a username/password (with authentication enabled), results in nothing Your messages disappear in nothingnessâŠ
I have made my complete firmware available on Github here; https://github.com/stelgenhof/AiLight. I reworked the previous library version into a regular PlatformIO project.
Note that it isnât equipped with many features like Espurna, however gives you a basic firmware that allows you to control the light with MQTT/HASS.
With this firmware you can:
There is still some work to do, but should be working fine if you follow the instructions in the README file.
Happy to hear your thoughts / feedback!
I found the problem, as I have changed the hostname to AI-Light01, AI-Light02 and so onâŠ
then I donât need the chip ID. I just put the hostname in command,
so in my case it should look like
mosquitto_pub -u pi -P xxxxxxxx -t â/test/switch/AI-Light01/relay/colorâ -m â#FF0000â
Is it possible to do OTA between firmwares as long as they both support OTA, like if I have Xose PĂ©rez firmware, can I then do an OTA to install your @stelgenhof firmware?
Super! Nice you figured it out
Never tried that before but I think it should work fine since my firmware uses the same code base.
When I ran âBuildâ in PlatformIO I got these error messages.
/Users/darijo/Documents/Arduino/PlatformIO/AiLight-master/src/light.ino: In function 'void
_ lightMQTTCallback(uint8_t, const char*, const char*)â:_
/Users/darijo/Documents/Arduino/PlatformIO/AiLight-master/src/light.ino:52:19: error: 'MQT
T_LIGHT_ACTION_RESTARTâ was not declared in this scope
mqttSubscribe(MQTT_LIGHT_ACTION_RESTART);
^
/Users/darijo/Documents/Arduino/PlatformIO/AiLight-master/src/light.ino:58:21: error: 'MQT
T_LIGHT_ACTION_RESTARTâ was not declared in this scope
mqttUnsubscribe(MQTT_LIGHT_ACTION_RESTART);
^
/Users/darijo/Documents/Arduino/PlatformIO/AiLight-master/src/light.ino:81:23: error: 'MQT
T_LIGHT_ACTION_RESTARTâ was not declared in this scope
if (strcmp(topic, MQTT_LIGHT_ACTION_RESTART) == 0) {
^
I followed your ReadMe, but Iâm not sure what to put here.
MQTT_LIGHT_STATE_TOPIC // The MQTT state topic for Home Assistant
MQTT_LIGHT_COMMAND_TOPIC // The MQTT command topic for Home Assistant
I just wrote, not sure thatâs OK
#define MQTT_LIGHT_STATE_TOPIC â/house/libe/sensorâ
#define MQTT_LIGHT_COMMAND_TOPIC â/house/libe/statusâ
Also Iâm not sure about this âUpdate the âupload_portâ variable in your platformio.ini file with the âhostnameâ value from the Serial Monitor.â when do I do that after I have flashed the firmware and turned on the bulb?
Where do I set what hostname I would like the bulb to have, like âAI-Light01â?
seems to be a cool firmware, will def flash my bulbs with it, I have 2 right now and I have ordered 10 more.
Can you please update your local clone of the repository? My apologies, as this part of the code incidentally was left behind. Please be aware that I will still make changes and improvements to the firmware. I try to avoid these issues as much as possible of course!
As for the MQTT topics, anything is fine as long as it is the same in Home Assistant and the firmware. The state topic is used for communicating the current state to HASS; the command topic is used for responding to commands from HASS. Mine are set as follows:
The hostname will default look something like this âAiLight_####.localâ, where #### is a unique identifier based on the ESP8266 Chip ID. If you have your light still connected to the FTDI cable, then you can see this hostname in your terminal session.
I am aware this version is not quite âplug and playâ, so I appreciate your feedback for me to improve the firmware. The Espurna firmware is more advanced, since it has a webinterface that enables you to see the firmware details and set all configuration variables.
Still get the same error message after I download from https://github.com/stelgenhof/AiLight (I pressed âClone or downloadâ and then âDownload ZIPâ). Iâm using Mac, has that something to do with it?
/Users/darijo/Documents/Arduino/PlatformIO/AiLight/src/light.ino: In function 'void lightMQTTCallback(uint8_t, const char*,
const char*)â:
/Users/darijo/Documents/Arduino/PlatformIO/AiLight/src/light.ino:52:19: error: âMQTT_LIGHT_ACTION_RESTARTâ was not declared
in this scope
mqttSubscribe(MQTT_LIGHT_ACTION_RESTART);
^
/Users/darijo/Documents/Arduino/PlatformIO/AiLight/src/light.ino:58:21: error: âMQTT_LIGHT_ACTION_RESTARTâ was not declared
in this scope
mqttUnsubscribe(MQTT_LIGHT_ACTION_RESTART);
^
/Users/darijo/Documents/Arduino/PlatformIO/AiLight/src/light.ino:81:23: error: âMQTT_LIGHT_ACTION_RESTARTâ was not declared
in this scope
if (strcmp(topic, MQTT_LIGHT_ACTION_RESTART) == 0) {
^
You are absolutely right. I must have overlooked that part. It is some code left behind while I was testing it. Iâve updated it on Github. Can you update again by either downloading it again or issuing a âgit pullâ command in your local repository?
Iâve tested it myself and the firmware compiles now.
yes! itâs working now. Will try to flash the bulb tomorrow.
Is it possible to set custom hostname for the bulb, like AI-Light01.local, AI-Light02.local⊠and not âAiLight_####.localâ as you described above.