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

BREAKING CHANGE: add dtu serial to mqtt status topics #304

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

madmartin
Copy link
Contributor

+++WIP+++

When two OpenDTU devices are connected to one mqtt broker, it is not possible
to distinguish the status topics between these two devices.

The status topics are composed like

<base topic>/dtu/<status item>

example:

solar/dtu/rssi -61
solar/dtu/uptime 395
solar/dtu/ip 192.168.166.189
solar/dtu/hostname OpenDTU-8E1C80
solar/dtu/rssi -59
solar/dtu/uptime 7472
solar/dtu/ip 192.168.166.192
solar/dtu/hostname OpenDTU-83B278

proposed solution:

insert dtu serial into the status topics like

<base topic>/dtu/<dtu serial>/<status item>

solar/dtu/199980113408/uptime 2838
solar/dtu/199980113408/ip 192.168.166.189
solar/dtu/199980113408/hostname OpenDTU-8E1C80
solar/dtu/199980113408/rssi -56

BUT:

what to do with the configurable LWT topic solar/dtu/status ?

I did not touch this yet. I see two options:

  • add a placeholder variable for the serial number to the configurable default, like solar / dtu/#SERIAL#/status
  • remove the LWT topic from configuration (why is this configurable anyhow?)

What do you think?

modify mqtt status topics from

<base topic>/dtu/<status item>

to

<base topic>/dtu/<dtu serial>/<status item>

Signed-off-by: Martin Dummer <[email protected]>
@tbnobody
Copy link
Owner

tbnobody commented Nov 4, 2022

It was the idea to change the base topic if you really want to use multiple devices. Downside is, that you will have your inverters on different sub topics. Don't know your exact use case.

@madmartin
Copy link
Contributor Author

madmartin commented Nov 4, 2022

So what you propose is to configure the devices like

first one:

solar-one/dtu/hostname OpenDTU-8E1C80

and the other one;

solar-two/dtu/hostname OpenDTU-83B278

?

If yes, then my opinion is: Possible, but not nice.

@madmartin
Copy link
Contributor Author

Another point: this still does not explain why the LWT (sub)topic sould be configurable. I see no benefits with that.

@tbnobody
Copy link
Owner

tbnobody commented Nov 4, 2022

Let's just say I required that in the past. We should maybe move the discussion regarding mqtt topics into the discussion settings. If I would change this and make It incompatible with the current installations I would do it only once. Saw on Twitter and from other people that some other things are not optimal as well.

@tbnobody
Copy link
Owner

tbnobody commented Nov 7, 2022

Please see #317

@ThomasCr
Copy link

for me - I prefer to change the main topic. So pls - when you want to change something, make it possible to configure it - to make everybody happy. A good example is Tasmota - there it is possible to configure the full topic!

https://tasmota.github.io/docs/MQTT/#mqtt-topic-definition

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.

3 participants