#BTHome receiver and ESPNow+BTHome receiver and transmitter

34 messages · Page 1 of 1 (latest)

junior flower
#

Meet project Beethowen, my latest development that mplements ian energy efficient component to transfer data over ESP-NOW Communication Protocol over BTHome protocol, and bthome_receiver component that enables anonymous reception on an ESP32 ESPHome node from remote devices.

Beethowen could enable 3-9 years of smart home sensor lifespan and easy development to everyone.
https://medium.com/@attila.farago.hu/implementing-low-energy-smart-devices-with-several-years-of-independence-970077900cf4

Github open source repository: https://github.com/afarago/esphome_component_bthome

Any comments, suggestions are welcome -- this is a quite new concept for me and as development is in progress and might not come in the best structure yet.

cursive sedge
#

Interesting, I like that you have used bthome over espnow, and that could be a great start to getting espnow actually merged into the codebase.

copper kettle
#

Instead of having a bthome_receiver ESPHome node, users can leverage today our bluetooth proxy, and use the BTHome integration in HA to process the BLE packages

#

very cool

#

btw

brave hamlet
#

That definitely sounds as a cool idea to reuse BTHome serialization with another transport! I'm wondering though what benefits ESP-NOW offers over BLE? AFAIK, ESP-NOW uses Wi-Fi frequencies so I'd imagine its main advantage is router-less communication with Wi-Fi speed/range (or so), but that doesn't seem to give any benefits when optimizing for power consumption. 🤔 Or am I missing something?

buoyant plinth
#

Very similar to BLE in that way.

frigid frost
#

So what’s the advantage of implementing espnow on an esp32, vs using the also-existing BLE peripheral? Is it range? Bluetooth is limited to around 30m as I understand, espnow should get quite a bit more than that, possibly at the expense of battery life.

buoyant plinth
#

espnow range is pretty good from what I've heard.

cursive sedge
#

It can also work from esp8266 to esp32

junior flower
#

benefits of ESP-NOW over BLE are

  • ESP8266 (potential for any old e.g. Shelly gen 1 device)
  • on ESP32 we could explore WIFI_PROTOCOL_LR for 800m-1000m range. 😉
junior flower
frigid frost
#

There are lots of discussions about making entities on one node available to other nodes without going through HA. At the moment that is done very piecemeal - e.g. BLE nodes can pair, and make e.g. a temperature and humidity available in ESPHome. It would be great to be able to define a "remote entity" with an identifier of some sort (hand waving) that gets updated through "some remote protocol" (seems like an opportunity for an interface here).
Then the entity could be "uninitialised" if no updates have come in since boot, or potentially stale if there has been a large gap in updates.
But this also looks like an opportunity for a generic proxy functionality. Either as a binary blob, and the details of the transport are provided in an envelope, that could carry ESPNow/BTHome messages, or BLE/broadcast messages, or LoRa/whatever messages.
Then the node could optionally have a parser for those message formats, which could be fed into any locally defined entities that match the identifier.

brave hamlet
# buoyant plinth Very similar to BLE in that way.

I get that, but now if we forget about WiFi and just compare ESP-NOW and BLE - my uneducated guess assumes that ESP-NOW consumes more energy [because it uses the Wi-Fi radio module that is more powerful than BLE]. So I'm trying to understand if I'm missing something here?

brave hamlet
junior flower
cobalt burrow
#

A very common use case is when you have a lot of BTHome temp sensors and want to use Thermostats implemented in ESPHome having to relay the data through HA is an extra point of failure.
HA only needs to deal with control of the Thermostat entities only. And even with HA down, the Thermostats continue to operate by hardware.

#

bthome_receiver should be also natilvely supported by ESPHome, just like Xiaomi BLE and the many other Bluetooth sensors - so people could have an option for that too.

arctic hawk
#

One question: does this new BTHome protocol include encryption? Or just sends the data unencrypted. I want to test it on remote for opening a garage door, but security is needed for reasons :).

copper kettle
#

BTHome supports encryption

#

in the standard

frigid frost
#

it doesn't seem like BTHome is suitable for any control messages, though? Only broadcasting of state.

copper kettle
#

correct

arctic hawk
#

So a simple button_pressed = true can be transmitter true it right?

copper kettle
frigid frost
#

Yeah, my apologies. I thought you were making the controller use bthome, not a trigger. Perfectly suitable for a trigger.

junior flower
#

Good news, had some time and added/verified ESP32 support. 😎
Some fine tuning went to the configuration structure.

Plans include:

  • looking into the ESPHome 16-byte encryption soon, until then a simple 2-byte identified is added.
  • auto-forward received packages to HA (using BTHome integration and HA-API)
  • BTHome events, though how to expose them through esphome is not clear - perhaps a direct HA-API call would be the best option

Here are the simplified configuration files/options.

#

Does anyone have ideas on reducing the cycle time / any analysis of an ESP8266 or ESP32 shortest boot time over ESPHome?
As of now I have with a d1 mini ESP8266 - boot+bmp085 temp reading+ADC reading+wifi wakeup+espnow send = ~280 ms.

I'd be keen to reduce that to below 200 ms if possible.

earnest skiff
#

Came across this when trying to set up plain ordinary BTHome over BLE... do I understand correctly that this code or something like it will do the trick? #1122252736398897262 message

#

(In my case I want to use it for HA Glow, so an ESP32 is already necessary)

junior flower
#

This component can receive BTHome over BLE locally