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

Retained topics sometimes removed, found solution #363

Open
H4nsie opened this issue Oct 14, 2024 · 2 comments
Open

Retained topics sometimes removed, found solution #363

H4nsie opened this issue Oct 14, 2024 · 2 comments

Comments

@H4nsie
Copy link

H4nsie commented Oct 14, 2024

I noticed when sometimes data is missing in de VW app (don't know why, but see screenshot attached; available km range and available % fuel is not displayed in the app when this happens), it is also directly missing in the raw jason, and then WeConnect-mqtt removes the topic from the broker. (My home-automation sets the values then to zero, causing problems in my sensors/scripts, I'd rather prefer retaining the old topics and values, and wait a few hours for data available again at the VW's server.)

A retained topic is removed from a broker by publishing the topic with the retain-flag and a null ('') payload. WeConnect-mqtt does this on line 544, by sending this command to the broker. I've commented out this command:

544c544
<             self.publish(topic=f'{self.prefix}{element.getGlobalAddress()}', qos=1, retain=True, payload='')
---
>             #self.publish(topic=f'{self.prefix}{element.getGlobalAddress()}', qos=1, retain=True, payload='')

Now topics are always retained. Perhaps you could make this configurable with a parameter? (--alwaysretain)?

I've tested a few days and the number of topics stay the same on my broker. Now I can confirm it working for the VW California 6.1 camper, with mosquitto version 2.0.11, Domoticz 2024.7 using domoticz-mqttmapper-plugin

IMG_4600

@LurchiStromberg
Copy link

HI!
I guess I have the same Issue since some days. WeConnect-MQTT does not update Topics anymore.
I am running an Ubuntu Server with PIP installed WeConnect-MQTT. In which Folder i can find the main file of WeConnect-MQTT to change line 544 as you suggested?

@H4nsie
Copy link
Author

H4nsie commented Dec 19, 2024

HI! I guess I have the same Issue since some days. WeConnect-MQTT does not update Topics anymore. I am running an Ubuntu Server with PIP installed WeConnect-MQTT. In which Folder i can find the main file of WeConnect-MQTT to change line 544 as you suggested?

Hi,

Your problem is unclear to me. Are topics removed or not updated?

If:

  1. Topics are removed from broker, you could use the solution above.
    Or:
  2. Topics are still at broker but not updated, then you should accept the terms from VW at the site. (See Stopped working since December (Docker) #376 )

I'm running WeConnect-MQTT in docker, so I'm unsure where the file is stored in your Ubuntu. You could do a search (as root) for weconnect_mqtt_base.py ?

Regards, Hans

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

No branches or pull requests

2 participants