I’m not super familiar with ESPHome but browsing through the docs I’d wonder if it might work as-is. Have you tried flashing it to a HASP?
So ESPHome would require the code to be re-written from its editor. or the current Arduino or C code updated with the ESPHome API. But all the sensors, buttons, pages, etc are created by the device, then over the ESPHome API and HA discovery they show up in HA. The automations could even live on the device in ESPHome. Reading about the webpage functionality of ESPHome might present an issue, but possible. Also it looks like you can point the OTA client to a GitHub repository for updates. It’ll be a while, but I might try to convert it.
Interesting. Although I don’t have any Sonoffs, I haven’t had any problems with the API or HA discovery and component control. Reading the docs about deep sleep, it would seem what you’re describing is expected behavior. While in deep sleep it won’t respond to network traffic. HA “pings” the ESPHome to see if it’s available and if it catches the device in deep sleep, HA will report it unavailable.
What I meant is that the existing ESPHome ESP8266/Arduino code might work on the existing HASP PCB, if configured correctly for things like the Nextion RX/TX pins and setting D6 high to turn on the LCD, etc.
I really don’t have much interest in pursuing this myself, as the core architectural principle for this project has been to provide an MQTT-to-Nextion gateway device which is a use case that extends outside of Home Assistant. However, it seems like the existing hardware might work without modification for those looking to have a physical device usable w/ ESPHome. If that’s interesting to you, I’d suggest trying it!
Ok. Agreed, the existing hardware should work. I knew MQTT was an integral part of this project. I have a few other MQTT devices such as a temperature sensor and a few RGB LED light strips and my implementation of those always felt like a hack, though it “worked”. My driving goal was to remove MQTT from my setup after finding ESPHome and converting my existing devices to it. HASP is the last remaining device I have using MQTT. While there is nothing wrong with that, I also like the concept ESPHome implemented where each device is its own server and HA talks to it. That way if one device fails, HA sees it and reports accordingly. There’s no middle-man broker to go through or to fail and take down all devices.
Yes they say it’s expected and yes it makes them completely useless. My first attempt was a soil moisture meter. What good does it do if my moisture content is only viewable for 5 seconds every hour? Yes I can still trigger an automation off of this but it’s nice to have a page that shows me a summary of the moisture sensors all at one time if I feel like checking them (which is how I’d like to do it for now). MQTT retain messages are the way around it.
You can still handle lost MQTT clients (birth/last will messages) and get unavailable states in HA that way. Of all of the things I’ve had go upside down regarding HA, the MQTT broker hasn’t and it seems to be quite lightweight.
@luma
Thank you for your hard work. I’m new to Home Assistant (but not at all new to home automation) and can’t wait to build a few of these!
Do you happen to have models for double and triple Decora faceplates with the Decora cutouts on the right? I have a couple locations in mind where this will work best.
Yes but this is not going to be a problem with HASP.
esphome API is not perfect, neither is MQTT. Different tools for different jobs. The API advantages are listed Native API Component — ESPHome
The more I look into this the less I’m interested in it. To be clear - it’s an amazing effort and Otto is a genius and I don’t want to suggest this isn’t an outstanding project. However, the protocol isn’t a “standard” in any real sense of the word. The docs link to the implementation as the spec, which was last edited 11 days ago, meaning the “spec” is simply whatever the project uses today. This is perfectly OK within the scope of his project, but would be a nightmare for anyone else trying to integrate from another project.
MQTT is an actual standard, supported by thousands of independently developed systems, and that can only happen because the standard is well-specified. It really isn’t the same thing.
I’ll be honest, I didn’t read into the spec. I just started using it and saw how ridiculously easy it was to have an ESP chip do what I wanted it to do. It takes a lot of the programming knowledge required out of using and implementing an ESP sensor, light, etc into HA. I love programming these chips and making them do what I want, ESPHome just makes it “simpler”. All of this can also be done with MQTT as I have done with a few lights and sensors in my house along with this panel, but like I mentioned before, they always seem like a hack and maybe that’s because I never read into the MQTT spec fully to see how to configure topics properly.
Esphome can use mqtt, the api and mqtt are alternatives.
I just setup my first plate and I’m running into an issue. I’m able to setup the device and it connects with Mqtt and I can interact with it, but as soon as I restart it it won’t connect back to Mqtt and the settings are lost. It does maintain the wifi settings however.
Any idea?
Last reset: Fatal exception:0 flag:4 (SOFT_RESTART) epc1:0x00000000 epc2:0x00000000 epc3:0x00000000 excvaddr:0x00000000 depc:0x00000000
That’s unexpected Do you have another WeMos D1 on hand to try swapping with another module? Wondering if it might be a bad EEPROM…
I finally installed my first HAsp (after having it sit around since I purchased it as a Xmas present for myself last Dec.) and just wanted to say thank you for all the time and effort that went into creating a project like this and another big thank you for sharing it with us.
Keep up the good work!
Thanks I build another one, and that one worked. I’m guessing it’s a bad Wemos. When I have some desolder I will replace it.
Finished my Switchplate this weekend.
The layout still needs some tweaking. Especially the fonts I used aren’t working as I wanted them.
I also need to print the housing again but my heater cartridge of my 3D printer gave up after the print.
Thanks!
If anybody’s interested I could try to make a more generalized version which would work for anybody.
For the music player and the weather/clock page it won’t be much of a deal but the toggle page I would have to make something different.
Uh yea! That’s awesome.
I’m more or less done with weather page. I changed out the text forecast to actually display icons for 3 days. Only thing that’s left is to link all icons to the states. I used the darksky icon sensor but i have no idea how I can get all states the sensor has. For now I only got the states which reflect the current weather situation…like rain, partly-cloudy and…rain
So if one could point me in the right direction it would be much appreciated.