Prevent packet_transport from auto-sending when sensors update

Hi all,

I’m experimenting with the new packet_transport component. My setup looks roughly like this (the specific sensors here are only for demonstration purpose):

packet_transport:
  id: packet_transport_sx126x
  platform: sx126x
  update_interval: 600s
  encryption: !secret lora_encryption
  sensors:
    - battery_voltage
    - wifi_strength

The problem:
Data gets transmitted not only at the defined update_interval, but also whenever the listed sensors (battery_voltage, wifi_strength) are updated / update on their own. This causes extra transmissions that I don’t want.

What I would like to achieve:

  • Only transmit the current state of all sensors once ever X seconds.
  • Prevent any automatic transmissions when sensors report new values.

Is there a way to disable this automatic transmissions on value updates, so that new values are collected first and sent collectively in a single transmission?

Thank you! :slight_smile:

Currently not. The assumption was made that keeping the latency of state changes as low as possible was a priority, and the update on interval is simply a backup to compensate for the inherent unreliability of UDP.

It would be simple enough to add a config option to disable the immediate updates, and a PR for that would be welcome.

1 Like

Thank you for your help!
I added a config option for that and for now it seems to work. I’ll take a look into creating a PR for this - however, due to my limited C++ knowledge, I’m not sure if my changes have the required quality for that. :sweat_smile: I’ll check the contribution guidelines.

I’m struggling with this very same issue. I have a remote device that wakes up from deep sleep on a reed switch trigger and sends the state of the switch, temperature from a Dallas sensor and battery voltage.
Like you I just wanted to capture it once but am getting multiple transmits while the device is awake.
Can you share what the “config option” was that you used please?
I’m still learning and have limited knowledge so any help would be appreciated. Thanks.