Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undecoded messages to MQTT #210

Closed
toreamun opened this issue Jan 19, 2022 · 5 comments
Closed

Undecoded messages to MQTT #210

toreamun opened this issue Jan 19, 2022 · 5 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@toreamun
Copy link

It would be great if binary messages received from the HAN-port data stream could be published to a MQTT-topic. This would make a great fit with other solutions capable of parsing meter data from MQTT, like this Home Assistant integration: https://github.com/toreamun/amshan-homeassistant

Alternatives:

  • Alt A: The format of the published message exactly as received from the meter (with or without flag-sequence at the start/end). Messages with invalid checksum and length can also be published (the receiver can validate the checksum).
  • Alt B: Strip away the HDLC-framing and only publish the contained COSEM data in the APDU part. The data must be unescaped, and the checksum and expected frame length should be correct for the message to be published.

image

@ArnieO
Copy link
Contributor

ArnieO commented Jan 19, 2022

Not sure if I understand the request, as MQTT is implemented, and data published to the topic you specify:
I'm currently not using MQTT, so this is just to illustrate:
image

Payload format: https://github.com/gskjold/AmsToMqttBridge/wiki/Message-formats

@toreamun
Copy link
Author

Maybe I read the documentation wrong. Payload format described in https://github.com/gskjold/AmsToMqttBridge/wiki/Message-formats are JSON, not the message in same format as received from the meter. The MQTT documentation lists 4 formats (JSON, Raw full, Raw minimal and Domoticz). None of them are described as the original message from the meter. I have also looked at the MQTT source code and I cant see that any of them is what i suggest.

@ArnieO
Copy link
Contributor

ArnieO commented Jan 20, 2022

I read your initial message too rapidly, sorry!
What you request is a new option for MQTT formats, sending the raw data byte stream from the meter to MQTT (with or without HDLC framing).

So I will leave it to @gskjold to consider!

@toreamun
Copy link
Author

Yes, raw data byte stream. Both options (with or without HDLC framing) is not needed, but at least one of them would be great. Tibber Pulse sends full HDLC frame and works fine with AMSHAN custom integrationHome Assistant for Home Assistant. I am the maintainer of that integration.

@gskjold
Copy link
Member

gskjold commented Jan 20, 2022

Agree this could be useful. Will implement support to send full frame as bytes to MQTT.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants