I recently wrote a custom addon that enable esp-now integration for your esp-home devices. This add direct communication capability and you can use it along side with existing homeassistant.
So in case your wifi router disconnects, or your raspberry pi stops working, your home automations will still be able to work.
that’s great,
it was a missing part of the ESPHome project that would be very handy for a lot of people!
why don’t you submit a PR for the next ESPHome release?
Hi. Good work. I am working on same idea. I have a lot of espnow devices. And i won’t to create espHome gateway. That will bind with this esphome devices and send proper information to home-assistant. Any ideas how to do it?
In my case I need two esp modules. One for esphome api to send data to HomeAssistant. Another to receive data from espnow devices
I have a similar idea and plan to use the esp-now protocol for battery powered esphome nodes.
According to some stats I read esp-now only needs around 20% of CPU time compared to connecting to a WiFi access point with WPA2.
So in theory a charge of battery will last 5 times longer with this protocol. At least one esphome node (not battery powered) would be needed to work as the access point for the esp-now devices and forwads their messages via the classic WiFi to home assistant.
Only thing here is that this wouldn’t work with the native api of esphome because technically home assistant connects to the esphome nodes…
I build a setup up with a existing esphome node (still connected “normally” via wifi and api) and added a new esphome node without wifi but only esp-now. I put logging on both sides to VERBOSE but can’t see anything happen regarding esp-now.
The device d1button features a button and only uses esp-now for connections:
What has got my attention was that i coud get it to work along side with Home Assistant. A Single device can be both connected to Home Assistant while listenning to espnow messages at the same time. So if HA somehow turned off, things will continue to work, you just wont be able to control your devices using HA frontend.
And the boot up time is extremely fast. It can wakeup, send a few messages, and go back to sleep in just a blink of an eye. I’ve made a few sensors with espnow, let see how it performs… only time will tell.
By the way there are a small update to the library. It can now send data as argument. For example:
EspRC.on("bedroom light", [](String state) {
if (state.equals("on")) {
// do something
} else {
// do some thing else
}
});
EspRC.on("bedroom temp", [](Int value) {
// Do something with int value
});
EspRC.send("bedroom light", "on");
EspRC.send("bedroom temp", 28);
What version of esphome are you using for your custom addon @iphong?
I tried with stable (1.14.5 at the moment) and never where able to get esp-now working with it…
A beta (1.15.0b3) is also available as well as the dev branch
same problem. Home Assistant part working perfect, espnow part doesn’t work at all. When using esp_rc.h logger doesn’t working.
Try to catch espnow messages with simple espnow code from arduino and see that first device send espnow messages. But another devices doesn’t respond for that. Also in logs doesn’t see espnow initialization.
which then updated the espressif platform package to latest, running esphome again with the same config will now really using the latest arduino version
Sorry but am asking to be spoon fed, I have just started with Home Automation with hassio just in last couple of weeks and have been playing with EPS8266 and 32 for a little more,I am all for EPS-Now for battery operated projects.
So just to be short am trying to build a battery operated Temperature & Humidity system (which in future will be converted to automate heating and cooling by zones) for all rooms in the new house that i have moved into so i can get back to the builder with my temperature readings before the warranty runs out. Currently i do have few esp8266 with DHT11 working with hassio using influxdb for data logging but they all have to connect to the router to communicate with hassio.
When i saw this post i was thrilled but being so new automation and on a time crunch am pleading for some help on how can i use EPS-Now with the above project so i can bypass the router and connect esp8266 and esp32 to battery and put them in deep sleep to conserve battery so hope fully it could last me for a while before i need to change them.