esphome / feature-requests

ESPHome Feature Request Tracker
https://esphome.io/
404 stars 26 forks source link

ESP-Now integration #275

Open megane999 opened 5 years ago

megane999 commented 5 years ago

Describe the problem you have/What new integration you would like Integration of ESP-NOW protocol

Please describe your use case for this integration and alternatives you've tried: Just use separated esp on this protocol, but didn't know how to use esp-now with esp-home

Additional context

Ulrar commented 1 year ago

I wonder if you could (ab)use this for switches, by transmitting a specific value on a sensor for on and another for off, and reacting on those values on the other side to trigger lights and such

RubenKelevra commented 1 year ago

I think supporting ESP-Mesh is much more interesting. It creates an self-organizing mesh network which supports more than 1000 nodes (10 connections per node). In comparison ESP-Now is pretty basic, as it only allows point to point connections which needs to be known first.

I think prioritizing ESP-Mesh over this, makes sense.

afarago commented 1 year ago

Development of BTHome + ESPNow combination in progress - any comments/ideas are more than welcome. https://github.com/afarago/esphome_component_bthome

Unfortunately ESPNow does not yet support secure communication (there is a flaw in the current implementation).

Ulrar commented 1 year ago

This seems focused on forwarding BTHome, is there any way to use the ESPNow bits independently so they can be used to pass arbitrary stuff from one esp to another ?

Now that ESPHome has a way to turn wifi off, it'd be really cool to be able to use ESPNow instead to control devices that aren't actively connected. Like a passive light bulb controlled by a shelly behind the switch, to use a random example I'm not at all very much looking for

afarago commented 1 year ago

Most of the esp-now implementations need to accomplish several round-trips as they convey complex data.

This solution focuses on creating packets on one side and consuming data on a central hub.

This allows one to transmit approx 50-70 individuals measurements with a single packet. That means less risks, faster operation and less Coulombs consumed...

Kimotu commented 1 year ago

@afarago BT = Bluetooth. So bluetooth is required for its use? Or does it also compile on esp8266 (which do not have bluetooth) and can be used to transmit data via esp-now from sensor to hub?

afarago commented 1 year ago

The beauty of Beethoven is that it works on ESP8266 and ESP32 as well. You might want to check out the provided example yamls.

I do need to add more emphasis to that in the documentation ;)

evlo commented 1 year ago

I just skimmed it for now, but I do not see any option to pass click or other events, probably could be send as state "clicked" maybe?

I did migrate most of my stuff to esp32 so I can communicate using BLE, but I will try to find out some time to try your stuff, at least i could use all the esp8266s that are left somehow.

Would be pretty awesome for libre tuya stuff, that supports only wifi and being able to send message from cheap switch to cheap bulb directly might be useful, although maybe eespnow is really a thing and bekens do not support that?

_use case for the switch to light control over bluetooth is shown here https://github.com/wifwucite/esphome-ble-controller#integration-with-ble_client-light-and-switch-example_ so something similar with virtual binary switch should be doable with yours, but i understand that your focus is low power sensors

Kimotu commented 11 months ago

@afarago where can I open bug reports or report issues concerning your component? Neither do I know how to manually send values (beethowen_transmitter.send) compiles without any errors, but does not seem to send something. I have to enable auto_send: true and even when using connect_persistent: true the component searches continously all channels for bth receiver and prints warnings about long time operations and blocks of 20-30ms.

afarago commented 11 months ago

@afarago where can I open bug reports or report issues concerning your component? Neither do I know how to manually send values (beethowen_transmitter.send) compiles without any errors, but does not seem to send something. I have to enable auto_send: true and even when using connect_persistent: true the component searches continously all channels for bth receiver and prints warnings about long time operations and blocks of 20-30ms.

Thanks for taking the time to try and test it. I have enabled the issues tab for the repo, feel free to add it there as well for easier tracking. During these weeks I could spend less time with the project, so there will be delay in my reaction. If you are tech savvy, and find the problem, you can also create a fix and a PR.

Potential idea to check: the send action takes the complete_only config variable into account - therefore if enabled only sends packet when all inputs receive a value. I have tested it with success on ESP8266, have had very little time to check ESP32 yet.

gmag11 commented 11 months ago

Development of BTHome + ESPNow combination in progress - any comments/ideas are more than welcome. https://github.com/afarago/esphome_component_bthome

Unfortunately ESPNow does not yet support secure communication (there is a flaw in the current implementation).

You can always encrypt payload before building espnow packet. Using shared secret key is not that difficult.

Using chachapoly algorithm is light enough for esp8266

mastersf commented 2 months ago

good idea