Skip to content

MQTT CAN Filter: add option to publish expressions in individual topics#488

Open
hurzhurz wants to merge 1 commit intomeatpiHQ:mainfrom
hurzhurz:canflt-rx-individual
Open

MQTT CAN Filter: add option to publish expressions in individual topics#488
hurzhurz wants to merge 1 commit intomeatpiHQ:mainfrom
hurzhurz:canflt-rx-individual

Conversation

@hurzhurz
Copy link
Contributor

This adds options to publish the expressions from the CAN filter as individual topics, and optionally, with the retain flag set:

image

This for example results in such a message:

  • topic: wican/xxxxxxxxxxxx/can/rx/SoC
  • payload: 56.000000

The reason is that some applications don't like to get multiple different values spread across multiple messages under the same shared "rx" topic.
Also sometimes the retain flag can be helpful to keep the last known state (but it wouldn't be reasonable to use it for the "rx" topic).

My personal use case is to get the live SoC for EVCC while charging by capturing broadcast frames.
Therefore I use EVCC's custom vehicle type and MQTT plugin.
While the MQTT plugin would allow it to extract the actual value from the json payload of the rx-topic-messages, it isn't happy when it tries to process a message for the SoC that doesn't contain that value. With individual topics, it is ensured that it only gets the right messages for each type.
Also the retain flag helps to get the last known state if the vehicle is sleeping (CAN bus silent).

@hurzhurz hurzhurz requested a review from meatpiHQ as a code owner July 28, 2025 16:25
Copy link
Owner

@meatpiHQ meatpiHQ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change RX Individual Enable to something more indictive like "Per-Filter MQTT Topics" or something more appropriate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants