Hello everyone,
I am using ESPHome with the packet_transport ESP-NOW backend. My setup includes one hub device and multiple nodes. The nodes successfully receive sensor values from the hub when the hub sends data proactively.
However, I need the opposite flow as well:
I want the hub to periodically broadcast (every few seconds) the current state of a GPIO switch to all nodes, so each node can stay synchronized with the hub.
My questions are:
How can I make the hub push the latest switch state using packet_transport at a fixed interval?
Is there a built-in mechanism for publishing a switch state (similar to sensor update intervals)?
Do I need to wrap the switch state inside a virtual sensor and publish it via packet_transport.sensors:?
Is there any recommended way to ensure all nodes always stay synchronized with the hub’s switch state, even if they reboot?
Below is a simplified version of my hub configuration:
espnow:
id: espnow_component
channel: 5
peers:
- ${mac_node}
I noticed that binary sensors sent via packet_transport only transmit their state when it changes, unlike normal sensors which can send their value periodically.
Binary sensors only updating on state-change is exactly the problem.
In ESP-NOW setups this behavior is not acceptable, because nodes that reboot or miss packets never receive the current state unless it changes again.
Regular sensors support periodic updates. Binary sensors don’t — and that creates a permanent desync between hub and nodes.
We need a way for packet_transport binary sensors to push their state on an interval, same as normal sensors. Without periodic transmission, binary states cannot stay synchronized across devices.
If update_interval is added to binary_sensor, the problem will be fully resolved. Periodic retransmission would allow nodes to always receive the current state, even without a state change.
I doubt they will change binary sensor from event-driven to polling, but you can try… Better option would be parameter for packet_transport to broadcast all sensors independently if the state has changed or not.
For now I believe you have to go with less ideal solutions.