Esphomelib - library to greatly simplify Home Assistant integration with ESP32

Tags: #<Tag:0x00007f204e0783f0> #<Tag:0x00007f204e078080>


This isn’t going to support miflora. miflora is a bluetooth device. And miflora support is built in to home assistant anyway.

esphomelib is for building firmware for esp8266/esp32. Nothing really to do with miflora.


I guess if there was a way to use an ESP32 as a remote bluetooth point to communicate with the MiFlora…? (and send its data back to HA via the ESP32’s wifi, when the MiFlora is too far away from the HA server for direct comms)


Yes I can see that might be useful.


Sorry my fault… I didn’t express myself in a good way. It’s indeed issue of range .I run a Intel nuc and bt is terrible … but also good bt dongles won’t cover the range I need for my placed miflora be everywhere in the house and garden. That’s were esp32 comes into game…as a Bluetooth Mqtt gateway for miflora…there are already projects for this and I can run Arduino sketch for it but thought this might be a good thing for your project too


this setup does allow you to include your own code within the ESP program so you should be able to copy the code from another arduino sketch and use it with ESPhomelib


I’m dumb stupid in programming… would you might have a look at this : if this is possible to include


Do you want your ESP32 to attach to any other sensors?

If yes, it may make sense to incorporate that code somehow into esphomelib.

Otherwise, just use the code you pointed to.


I dunno how to do this…I just want this running on a esp32 with your firmware if possible


You seem to be confused. The siddy/flora project is firmware. You can’t have two different firmwares at the same time.

True you may be able to incorporate elements of sidddy/flora into esphomelib, but unless you want to use flora and other sensors, you might as well just use flora which is ready to go.

Frankly though the flora software you point to is pretty useless in your situation (IMHO). It can only link to one miflora er esp32 so you’d need an esp32 for each of the multiple miflora you seem to have, which will get a little unwieldy and expensive.

Rather, it seems to me that this software running on, say, a raspberry pi situated near your garden would be better.

Multiple miflora<–bluetooth–>pi<–mqtt(over wifi)–>home assistant


I’m new to Esphomelib. I took a look at the docs, and it is still not clear to me, so I am asking something about lights.
I understand that it supports RGBW with transitions, but what about RGBWW (white cool and white warm), including a temperature control (balance between white cool and white warm) with transition also?


Has anybody had any success or issues with BLE Beacons?

I’m using a ESP32 Dev 01 and get instant crashes when using the example code (esphomeyaml).

[16:03:18][C][esp32_ble_beacon:049]: Setting up ESP32 BLE beacon…
[16:03:18][I][application:090]: Running thr_controller_init fail[E][esp32_ble_beacon:078]: esp_bt_controller_init failed: 259

…Followed by a core panic

Any ideas?


Hey @OttoWinter,
Thank you for your constant effort and hard work.
I updated today to 1.8.0 and was hoping there would be an update on using ESP32 with a raspberry pi.

Are there any updates on this working please?



@OttoWinter I just wanted to say great job with the project and keep up the outstanding work. I’ve got this running on 6 different ESP8266 modules, doing everything from water leak detection to temperature/humidity monitoring to controlling my garage door. It’s great to see all of the additions with the latest release.


@OttoWinter - sorry if I’ve missed this, but how do I remove old topics? I’m using the hassio addon and so can’t run a clean-mqtt unless there’s a step I’m missing?



Just found out;

For those wondering, login via ssh and run:

mosquitto_pub -t "garage_door/sensor/ultrasonic_sensor/state" -r -n


Im just trying out this firmware for the first time (using PlatformIO), but my discovery topic seems off:
Note the two slashes after sensor.

Im using the libraries in PlatformIO and this is my code:

#include "esphomelib.h"
using namespace esphomelib;
Application app;

void setup() {
    app.init_wifi("SSID", "WIFIPASS");
    app.init_mqtt("MQTTIP", "USERNAME", "PASSWORD");
    app.init_i2c(D2, D1);

    app.make_sht3xd_sensor("Woonkamer Temperatuur", "Woonkamer Luchtvochtigheid", 0x45);
void loop() { 

I tried looking at the source files, found where the topic is constructed but lost track of whats what shortly after…


Completely forgot about this thread, sorry guys, my email notifications didn’t work for some reason.

@onkytonk I’m still waiting for a) platformio to support 64-bit RPis and b) docker crosscompilation that doesn’t crash almost every time I try to build esphomeyaml with it. Until then, I cannot provide support for that, sorry. I am however looking at providing pre-compiled Windows/MacOS/linux binaries for esphomeyaml. Then the installation would be really simple.

@olivier The issue is that you define a top-level Application app; instance. You should use the already-defined one called App (uppercase A). So:

#include "esphomelib.h"
using namespace esphomelib;

void setup() {
    App.init_wifi("SSID", "WIFIPASS");
    App.init_mqtt("MQTTIP", "USERNAME", "PASSWORD");
    App.init_i2c(D2, D1);

    App.make_sht3xd_sensor("Woonkamer Temperatuur", "Woonkamer Luchtvochtigheid", 0x45);
void loop() { 


Thank you! I’ll try it out tonight.


I think I already know the answer for this (no) but I’ll ask in case i’m missing something…

Could this be used with an LDR to do pulse counting of a power meter ?

I had a similar setup on a Pi for reading my electricity consumption, which worked great, but I want to migrate it to an ESP8266.



I don’t see any reason why not. As long as the ADC reading is implemented it should be quite easy.

If you have a three pins LDR (which also includes a resistor) then you’re good to go. Otherwise, with only LDR module, have a look at below schematic.