Status : Work in progress
Description : This Skill has been created for the makers and hackers who want to build their own home automation system based on ESP8266. The purpose of this Skill is to be able to use Mycroft to send commands to all ESP8266s on the local network. The communication protocol can be selected. (For now, only http GET request and websocket has been implemented).
- Me : “Hey Mycroft, can you switch on the mood lamp ?”
- Mycroft : “It’s done, Boss.”
- Me : “Hey Mycroft, can you turn off the TV ?”
- Mycroft : “As you wish, Master.”
Github : https://github.com/Dark5ide/mycroft-core/tree/feature/esp8266/mycroft/skills/esp8266
Work on : Mycroft unit, Ubuntu 16.04
Requirement : An ESP8266, Arduino code for ESP8266
- Improve the keyword part
- MQTT protocol implementation
- Put the Arduino code of the ESP8266 on github
- Auto-recognition of a new ESP8266 on the local network
- Clean the code
- (Improve my English)
Just a little update. I changed the directory of this Skill:
Github : https://github.com/Dark5ide/esp8266-skill
- Improve the keyword part.
- MQTT protocol implementation (done)
- Put the Arduino code of the ESP8266 on github (done) : https://github.com/Dark5ide/ESP8266_Controler
- Auto-recognition of a new ESP8266 on the local network.
- Use JSON format for the information transmitted.
- Clean the code
Awesome work, @DarkSide.
Out of curiosity, what was your approach to MQTT implementation?
What do you mean by “what was my approach” ?
I used the python API paho-mqtt and it was quite simple to implement. You can use an external broker like “test.mosquito.org” or a local broker if you want. You need to set the mqtt-host in the mycroft.conf file (URL or IP).
Currently, I publish the command (turn_on, switch_off, …) on “/mycroft/module_name” (module name can be lamp, led, TV, …). But I would like to publish JSON formatted info for the next improvement of the code.
The mqtt part was directly implemented in the __init__.py file.
That’s exactly what I meant
Thanks for such excellent detail in the explanation, we don’t have any documentation on MQTT implementation in Skills at the moment, so I was really curious how you were doing it.
Glad to help
I used my Mycroft unit (the dev one) as broker on my local network but you can also use an other Raspberry Pi if you want.
If you have others questions, don’t hesitate . I’m not an expert, it was my first time with MQTT but I will answer with what I know.
I would like to submit my Skill to the mycroft-skills repository. I will try to do it in the coming days.