for the needed entry chargemode.pv_charging.max_soc json pathfinder say
x.chargemode.pv_charging.max_soc
i tried a lot of things didn´t find the key how to use the json entry
my last try without success
incoming automation:
## von openWB Mac Soc
- id: openwb2_maxsoc_auswahl
alias: "openWB2 MaxSoc Auswahl"
description: "receive max soc from openwb2"
trigger:
- platform: mqtt
topic: "openWB/vehicle/template/charge_template/1/chargemode/pv_charging/max_soc"
action:
service: input_number.set_value
data_template:
entity_id: input_number.openwb2_maxsoc
value: "{{ trigger.payload }}"
mode: single
outgoing automation:
## in openWB Max SOC setzen
- id: openwb2_maxsoc
alias: "openWB2 MaxSoc"
description: "send max soc to openwbw"
trigger:
platform: state
entity_id: input_number.openwb2_maxsoc
action:
service: mqtt.publish
data:
topic: "openWB/set/vehicle/template/charge_template/1/chargemode/pv_charging/max_soc"
retain: true
payload_template: "{{ states('input_number.openwb2_maxsoc') | int(0) }}"
mode: single
how can i do that?
2nd question
is it possible to use a entity eg. car_id (number of selected car) instead of the fixed number 1 in
topic: openWB/vehicle/template/charge_template/1
If you do that, you will need to determine which car_id the topic represents in order to store the received max_soc value in the correct Input Number. Here’s one way to do that:
{% set car_id = trigger.topic.split('/')[-1] %}
Use the value of car_id to determine which Input Number to use.
thank you lot for you quick answer
i´ve tried different things so the last try was that with the longer (wrong) topic
the incoming automation works fine - can you help me with the outgoing automation?
Please consider marking my post above with the Solution tag. It will automatically place a checkmark next to the topic’s title which signals to other users that this topic’s original question was resolved. This helps other users find answers to similar questions.
first - hopefully my english is good enough
the same as incoming topic the outgoing is also short and need json enhancement for .chargemode.pv_charging.max_soc
openWB/set/vehicle/template/charge_template/1 …json(xx)
when i use the long topic syntax (as above) then i make a new wrong entry - i can see in mqtt explorer but the wallbox don´t recognize
with the car_id there was a misunderstood
i want to use the car_id to make the automation more dynamic and avoid double or tripple automations
like openWB/set/vehicle/template/charge_template/{{states(‘car_id’)}}
Your second automation is designed to take the value of an Input Number and send it to the Open Wallbox device.
I’m unfamiliar with Open Wallbox so I don’t know how it lets you change its max_soc value. Simply publishing a max_soc value to openWB/set/vehicle/template/charge_template/1 is unlikely to work.
To help you with this, I would first need to familiarize myself with Open Wallbox’s programming interface. Do you have a link to its programming information that’s written in English?
I doubt it. The states() function expects to be supplied with an entity_id. If the value of car_id is not an entity_id then the states() will return none.
Unfortunately, I don’t know what is the correct MQTT topic because I have no knowledge or experience with open Wallbox and the information I found for it doesn’t explain how to set the max_soc parameter.
I also searched the forum and found this example but it uses a different MQTT topic from what you suggested:
Now that you know that I am not an open Wallbox expert, and my suggestions might be incorrect, you may wish to try this version:
you don´t have to spent your time with openWB
i also use this integration
as in my above automation the topic for publishing is
topic: “openWB/set/vehicle/template/charge_template/1/chargemode/pv_charging/max_soc”
and i want to replace the number 1 with {{states(‘sensor.openWB_chargepoint_4_fahrzeug_id’)}}
so i have
topic: “openWB/set/vehicle/template/charge_template/{{states(‘sensor.openWB_chargepoint_4_fahrzeug_id’)}}/chargemode/pv_charging/max_soc”