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

[1.9.x] - MaxPriceForCharging (awattar) should use "config / get" and "config / set" mqtt paths #2803

Closed
ChristophCaina opened this issue Nov 21, 2023 · 7 comments
Labels
invalid This doesn't seem right

Comments

@ChristophCaina
Copy link

When you enable the Price based charging in your Wallbox, you can set the 'MaxPriceForCharging' from the Display.
The topic for this is: openWB/global/awattar/MaxPriceForCharging

The Topic should rather be use the /config/get (get the current value) and /config/set (set the current value) paths like:

openWB/config/get/global/MaxPriceForCharging
openWB/config/set/global/MaxPriceForCharging

This would make it easier to expose / use it externaly without using the Display, for example for integrations such as
https://github.com/a529987659852/openwbmqtt

@benderl
Copy link
Collaborator

benderl commented Dec 11, 2023

All topics are separated in to openWB/... and openWB/set/....
Use the first one for reading and the second for publishing a new value.

@Bucky2k
Copy link
Contributor

Bucky2k commented Jan 6, 2024

Found this issue exactly for the same purpose: Feed a new max price threshold to the openWB. So I guess it's up to someone creating a pull request? Unfortunately I have no experience at all (incl. OpenWB ruleset) on how to extend and modify the MQTT structure

Setting the existing topic via MQTT is shown in the display / OpenWB front end, but is overwritten to the previous value shortly after

EDIT: Maybe I am writing nonsense here - I guess I have to first activate the MQTT bridge bidirectionally?
EDIT2: No, just the standard MQTT server of openWB is sufficient, using openWB/set/awattar/MaxPriceForCharging...

@Bucky2k
Copy link
Contributor

Bucky2k commented Jan 6, 2024

@ChristophCaina Enabling TLS for Mosquito on Home Assistant side seems to be an endeavor in itself. Can you confirm, that the openWB initiated bridge and "enable external control" will allow to modify the max charging price? Or can I save the effort, as it's not working anyway?

@ChristophCaina
Copy link
Author

Sorry, I can't confirm this.
I don't use a Bridge and my HomeAssistant is using the mqtt Broker of the Wallbox directly.

I haven't continued to try the above Information since I don't use this Feature by myself and didn't had the time to Work on the Integration

@Bucky2k
Copy link
Contributor

Bucky2k commented Jan 6, 2024

Thanks, but I am highly confused right now anyway... Somehow I found a way to set the MaxPriceForCharging, but didn't find the option before in the MQTT Exporer. This one works just using the always on MQTT server of the wallbox: openWB/set/awattar/MaxPriceForCharging

@ChristophCaina
Copy link
Author

ok - now I could have a look into the whole thing again.
The problem I do have (and why I initially created the topic) is, that the openWB integration is using the topic openWB/global/awattar/MaxPriceForCharging to get the current information / value.

the problem here is, that the SET Topic has a different structure / path.

For example, here's the code to Send a number to the OpenWB and get it:

 for description in NUMBERS_GLOBAL_COPY:
        description.mqttTopicCommand = f"{mqttRoot}/config/set/{str(description.mqttTopicChargeMode)}/{description.mqttTopicCommand}"
        description.mqttTopicCurrentValue = f"{mqttRoot}/config/get/{str(description.mqttTopicChargeMode)}/{description.mqttTopicCurrentValue}"

but it would require a complete change of this code to catch, if you want to set a new value for the awattar price...

I would need to read the openWB/global/awattar/MaxPriceForCharging to get the value
and would need to use the openWB/set/awattar/MaxPriceForCharging to write it...

while all other relevant changes would still use the same /config/get and config/set
structure.

I might be able to adapt this - but the idea was, that the openWB should use a 'standard' for everything ...

@benderl
Copy link
Collaborator

benderl commented Feb 15, 2024

This is in fact the standard for openWB. In openBW/config/ all data for fixed configurations are processed. The "MaxProceForCharging" is a dynamic setting that is changed often. So it is not a more or less "fixed" configuration, but a dynamic setting.

@benderl benderl closed this as completed Feb 15, 2024
@benderl benderl added the invalid This doesn't seem right label Feb 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

3 participants