Skip to content

Issue with "retained" MQTT messages #48

@makkie2002

Description

@makkie2002

I have been using your code for several months now without issues 😄, until today😟.

This is the issue:

  • I am feeding in the grid power data (from the Belgian P1 port) through MQTT.
  • I have the "retain" flag on for these messages (for some now-unknown reason).
  • If now my grid-meter is not updating the MQTT messages anymore, the script restarts after the 60s timeout, it subscribes to the MQTT topic, it receives the (old) retained value and sends it to Victron ...
  • In my case the Victron got fully confused and was discharging the battery at full power ....

So maybe to solve this issue we could check if after restarting the service the first received value is ignored, so that we are sure that we are not dealing with retained messages ...

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions