For the “receiving requests” part, check out ESP8266WebServer, I’ve used that library a few times and it works well. It has a decent amount of examples for you to try.
These libraries are both part of the “Arduino compatibility library” for ESP8266: https://github.com/esp8266/Arduino/
Instructions on how to install can be found on that page.
Overall, I would suggest taking a look at PlatformIO, which is a great IDE for developing ESP8266 (and other) projects. It has a built-in library manager that you can use to easily find and install third-party libraries (for example, to implement particular sensor support).
OK, nailed it. Here the example code and two screenshots on how to make it work on Homey.
Now some sensors and devices. Not as good as the homedruino as homey won’t recognise it as sensor but if you make local code that filters the right events I think it is a pretty good replacement…
I have developed a LED dimmer using the Homeyduino based on Wemos Mini D1 which I control either from the app or a physical button. Works really great in version 1.5 rc14, I don’t dare to step over to 2.0😰
It uses the MySensors library, which does most of the heavy lifting with regards to WiFi and MQTT. I use the MQTT Broker app to provide the MQTT server.
There is a MySensors app for Homey, but I don’t think it’s being maintained anymore. I didn’t feel like using it, and instead opted for a quick-and-dirty solution:
use the Virtual Devices app to create a sensor with the capability “Helderheid/Luminance”
use the MQTT Client app to watch for updates from the light sensor node (it updates every 30 seconds) and set the measure_luminance capability of the virtual sensor device:
(the full topic used is my/esp-lightsensor/pub/0/0/1/0/37, where my/esp-lightsensor/pub is a sort of prefix, and the numbers are the MySensors encoding of the sensor type/data).
Only esp8266/32 devices? Abundantly available and dirt cheap, those ones?
But if I understand you correctly, you mean for instance mysensors is not limited to esp but could also tap in to the world of raspberry pi and the like?
As a sidenote: I could not help but notice: ESP32 Bluetooth Low Energy RSSI Sensor — ESPHome
ESP32 Bluetooth Low Energy RSSI Sensor. Esp32 has bluetooth and you can get the signalstrength (rssi) over mqtt to homey. With multiple esp32 devices you can locate where a bluetooth device is. (not all that precise, but enough to play with)
But a lot to love about esphomelib. What I like about there approach is: no programming experience required (well, editing of YAML configuration files), just playing with sensors.
I did not hear from it before, It is created/maintained by Otto Winter, an Austrian. Busy guy it seems.
Esphomelib/esphomeyaml is knee deep in the Home Assistant world. Now is that not a negative thing in principle.
But maybe Esphomelib is not the most interesting to see in that world.
Home Assistant has a “MQTT Discovery” feature, witch, from what I can see sort of automates the connection from mqtt enabled devices to usable virtual devices in Home Assistant. The configuration is done on the device itself and the topic used by the device.
And it works with:
I don’t think that MySensors has “node” support for RPi, only gateway support. In other words, you can’t use it as a sensor device, but you can use it as a device that sensor nodes can communicate with. Using an RPi as a sensor node seems a bit over-the-top anyway.
And yes, the ESP32 is a capable BLE device, although you can’t use BLE and WiFi together (they share the same internal radio and antenna). But it’s relatively easy to do some BLE stuff, turn off BLE, turn on WiFi, do WiFi stuff, and to back to BLE, in a loop.
I haven’t been able to find anything on the actual protocol that HA uses to (directly) talk to esphomelib nodes, but it might be interesting to see if a Homey app can be build for it.
First off, thanks for the sketch. I try to get it to work with a secure connection, but cannot connect to the MQQT server (MQQT broker app on Homey).
You note to connect with ‘WiFiClientSecure’ if you work with port 8883 but I am a bit confused because I don’t see you include this library on the start of the sketch with '#include <WifiClientSecure.h>. Don’t you need to include this library first to get it to work?
Thanks for the answer. I included the library in the beginning of the sketch but still i cannot connect secure 8883 (1883 unsecured all fine). A couple of questions I still have. Maybe you can help me out.
How come you didn’t included the ‘WifiClientSecure library’ in your sample code you posted and have it working?
Don’t you need to type in a ‘certificate key’ in the arduino code to verify the MQQT-client?
Are you using the Homey MQQT Broker by Menno van Grinsven?