Hello, Is there any functional ESP-NOW integration with esphome?
I wanted to create a project in wich I had a ESP32 as a master conected to HA and temperature sensors as slaves so the slaves sended the temperature to the master and this one shows it to my HA and if it were posible send orders to the slaves. I don’t know if its posible?
Thanks and sorry for my english.
I don’t think you will see this any time soon. It’s hard enough getting ESP-NOW to talk to a WiFi router - you need to either scan for the router channel or use a fixed channel for all devices. And a fair bit of fiddling is required on the ESP-NOW/WiFi gateway node requiring it to run in simultaneous AP/station mode - not something that ESPHome does.
Yeah, the gateway between ESP-Now and whatever media HA is using is the problematic point.
If you try to use a WiFi ESP-Now gateway with a single ESP chip then ESP-Now and the WiFi will have to use the same channel and since it is hard coded in the ESP-Now configuration, then you have to make sure that the WiFi channel switching is disabled in the WiFi access point too, which again will make the WiFi less flexible in optimizing it’s communication.
The other solution could be to use two connected ESP chips. One running the WiFi and one running the ESP-Now, but the link between them becomes a complication to administrate.
You could also install a wired ethernet port to the ESP and then only run with one chip,but the wired ethernet ports require different configurations for each brand and there are quite a lot of brands, but they are rarely pri ted on the actual product, so it is a mess.
I have use the last solution, but I have had to piece my code together from multiple places on both the gateway and sensors, so it is not as easy as ESPHome.
Actually more than one is available as custom/external component:
And they all have the gateway issue
To me it sounds like the author is exactly looking for such a solution
Yup, but the solution that is used is hard coded WiFi channels, so no mesh WiFi and no auto selecting channels.
In this setting you might as well just use WiFi only or WiFi primary with ESP-Now as fallback.emphasized text
That’s indeed a technical requirment if you want one esp to be connected to a WPAx and working as the same time as ESP-NOW gateway.
But as you wrote one can just make use of a esp32 board with ethernet to have esp-now on whatever channel. I had like the opposite mileage like you btw. and is was super easy (typical esphome magic) to get ethernet working on my esp’s.
I’m no network specialist but have to communicate a lot with them. They never make use of “smart channel” (I think one vendor calls it that way) but always fix the channel manually. There are various reasons for it but one is probably that auto channeling mostly doesn’t work the user think it does and in reality it often degrades the reliability of a network. Often the sensing for other devices is only scheduled hourly (or even less) on the AP and can cause to hog on dense channels just because a mobile hotspot was on for a short time.
I would expect the author want’s to make use of batteries (maybe paired with solar) for the slave devices. In this case using WPAx is not recommended but ESP-Now is a valid way to minimize power consumption.
I did not have that many issues with getting my ethernet port to work, but it is hard to make a general guide for others to follow, becaus there is no standard ethernet port.
And auto channel works pretty good on most APs. It should only be the cheap ones that rely on only visible said. The decent and good ones look at signal to noise ratio on the different channels.
Where people fail is to use auto channels for multiple APs. 2 might go, but with 3 it can become a cyclic loop where one AP move to another As channel forcing that second AP to move to a third APs channel and third third AP then move to the first APs channel and so on.
With 2 and 3 APs manual setting the channels is better.
With more than 3 APs only automatic WiFi controllers are really capable of it.
WiFi controllers are able to know each APs channel and also there neighbors and their channel and signal strengths.
Adjusting more than 3 APs means adjusting the signal strength too.
The issue with having WiFi and ESP-Now on the same channel is that the battery powered devices is forced to listen to WiFi communication too.
ESP-Now is just a WiFi lite protocol.
The only thing I care about is: Does it work with esphome? And that hardware is what I buy.
In case of esp32 boards with ethernet it is simple as opening:
and choose a board from the configuration examples. In ended up with some Wireless Tag WT32-ETH01 boards which were around $10 and work just a treat.
This issue is actually more a theoretical one. Having a battery powered device awake for 1 second and in deep sleep (radio off) for like 3600 seconds (1 hour) it is probably negligible in terms of power draw. Beside if you are in a dense environment you might be able to influence the channels used by your own wpa-wifi access points but as air is a shared medium you need to accept other participants ether way
Hey, sorry for not saying anything I’ve been too busy lately, thanks for all the replys I’ve been reeading them and gonna try them to my project, I just had one question:
How do I implement this? The board with the ethernet port runs esphome and the others just the code for arduino with espnow? Sorry if this sounds kinda dumb but I’m new in this world of Home assistant and esphome.
Thanks !!
No, the board have an auxiliary ethernet port similar to this one: ENC28J60 Ethernet LAN Network Module – QuartzComponents
The module runs mqtt.
Not sure if you got an answer but, assuming your question is how do you tie espnow to wifi to home assistant, then using two ESP32s (or similar) is a pretty reliable option.
The cleanest and shortest-explanation (!) I’ve seen is over here: Super Simple ESPNow to Wi-Fi / MQTT Gateway & Why I Use Two ESP8266s - YouTube
This just needs 4 wires (RX, TX, GND and Power) to be linked between the two boards. One is free to be your espnow receiver and the other is free to wander all over the wifi and deliver espnow messages to home assistant via MQTT.
Latest and greatest work comes from @afarago and is available via custom component for esphome compatible with esp82xx and esp32
I made a small sketch that can act like a ESP NOW to MQTT Gateway. I made it for my WLED but its open enough for you to add anything.
Hi, could I still use this to control other esphome flashed lights (not using wled)?
Are they on ESPNOW? If yes then you can send a MQTT Message to this and it will broadcast on ESPNOW. May need to tweak a little. If you send me link to the code you used for esphome flashlight then I can add it in.
Should be similar to this
Is there a custom component for espnow I need to add?
I don’t have a wizmote, but I’d like to use it with esphome switches so the button could send mqtt command to the lights via espnow.
Looks like it should directly talk to HA and not ESPNOW. Unless I know what exact message is needed to be sent via ESPNOW it would be difficult for me to add. Currently it broadcasts whatever it gets via MQTT. But ofcourse I need to tweak it to work better.
Is it possible to activate esp long range mode also ?