#Yet another ESP-Now within ESPHome

25 messages · Page 1 of 1 (latest)

gritty sky
gritty sky
#

I recreated the bridge part of this project using ESPNow as well. So that makes it easier to use, the sender YAML just has a now_mqtt. Then on another ESP32 you just add the wifi and mqtt sections like normal, then just a now_mqtt_bridge .

gritty sky
#

added RSSI

gritty sky
#

added the icon, version, and board information

gritty sky
#

Maybe my last small improvement:
Added an on_sent callback. Now you can count the number of measurements that have been sent, when all of them are sent, enter sleep.
now_mqtt: on_sent: then:

swift pelican
#

Hi, the node does not compile with a binary sensor

esphome:
  name: espnowtest
  platformio_options:
    board_build.f_flash: 40000000L
    board_build.flash_mode: dio
    board_build.flash_size: 4MB
esp32:
  board: lolin_s2_mini
  variant: ESP32S2
  framework:
    type: arduino
logger:

# import the components
external_components:
  - source:
      type: git
      url: https://github.com/u-fire/ESPHomeComponents/

# no need for api or wifi block when using just ESP-Now
now_mqtt:
# i2c:
#   sda: 7
#   scl: 6
# sensor:
#   - platform: bme280
#     id: bme
#     temperature:
#       name: "Temperature"
#     humidity:
#       name: "Humidity"
#     pressure:
#       name: "Pressure"
#     address: 0x76
binary_sensor:
  - platform: gpio
    pin: GPIO19
    name: test
gritty sky
#

I only included sensor , but it wouldn't be hard to include others I think.

bright island
#

nice ! now espresense + esphome on 1 device pls 😛

gritty sky
#

I haven't seen that project before. Let me know if it works out. I'm looking at adding the other types (binary_sensor) now.

swift pelican
young linden
#

Does this also work for sending data/commands via ESP-Now? Something like Home Assistant -> MQTT Broker -> ESP Bridge -> End ESP Device (via ESP-Now)?

gritty sky
#

No, I kept it one way. Sensor to HA. It seemed to make the most sense for a battery powered device that sleeps most of the time.

gritty sky
#

added text sensors for this

ashen tartan
gritty sky
#

Well anything is possible, but the code isn't there to do it. With a bit of copy/paste between the bridge code and the sender code, it could be done.

ashen tartan
#

I’m trying to do this

Switch as mqtt broker
Button press sends mqtt command to toggle/dim to light bulbs that are connected as nodes
Is that doable? So far i’ve only done it on tasmota with tasmesh

gritty sky
ashen tartan
#

Unfortunately that’s beyond me since i’m not much of coder 😅
Here’s hoping for new update

unkempt kraken
#

@gritty sky that is awesome!
I was also looking for a way to create a proxy to auto-accept (and generate) entities on the homeassistant side.

I really love your idea of conveying key data and using mqtt and adding this to create an mqtt entity.
I was looking into creating a "proper" bluetooth entity through the custom-components/ble_monitor service, but using mqtt as a "proxy" layer is purely ingenious in here https://github.com/afarago/esphome_component_bthome but I think your direction is better.

I would seek for a solution that can act also in a low-power sensor environment. Having one esp-now message per sensor takes quite a big delay if you want to convey >4 sensors and then go to deep-sleep.

Do you think this two could be combined somehow?

  1. pre-flight / init phase (full sensor config info)
  2. regular updates (one message with all data combined)
gritty sky
# unkempt kraken <@619068682521411584> that is awesome! I was also looking for a way to create a ...

Thanks for taking the time to check out the component.

So you're thinking about one transmission with all the sensor datapoints in one message, right? That could probably be implemented fairly easily. The component already uses a colon as a delimiter. You could probably just pick another delimiter that wraps the entire message, then parse it into an array you work through.

|message_1:data:points|message_2:data:points|

something like that.

I'm curious what the savings would be in transmission time.

unkempt kraken