[Skill/Work in progress] ESP8266

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).

Exemple :
- 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


TODO :

  • 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)

Hi everyone,

Just a little update. I changed the directory of this Skill:

Github : https://github.com/Dark5ide/esp8266-skill

TODO :

  • 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
3 Likes

Awesome work, @DarkSide.
Out of curiosity, what was your approach to MQTT implementation?

1 Like

Hello @KathyReid,

Thanks :blush:
What do you mean by “what was my approach” ? :slight_smile:

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.

1 Like

That’s exactly what I meant :slight_smile:
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.
Best, Kathy

2 Likes

Glad to help :slight_smile:

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 :wink:. 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.

2 Likes