Webasto Unite Wallbox change 1/3 Phase Operation and Current Limit from HA (now Ampure/Vestel)

Problem: Webasto Unite only has one Modbus input option: Webasto_Unite_Charging_Current. This is valid for 1-phase and 3-phase operation. The 1/3-phase operation can only be changed from the Wallbox Web UI. This only allows two different power outputs for the Wallbox:

  • 1-phase: Power ranging from 1.38 to 7.36 kW
  • 3-phase: Power ranging from 4.14 to 22 kW

I want to charge as much solar power as possible into the car, so I need the whole power range from 1.38 up to 22 kW. I want to be able to change 1/3-phase operation from HA without having to visit the Wallbox Web UI.

*I have only tested this on the Webasto Unite Wallbox, not with Vestel/Ampure.


Solution: Reverse engineering how the changes in the Web UI take place, I was able to create shell commands to execute the changes from HA.


First, you need to create these shell commands in configuration.yaml:

shell_command:
  schnellladen_session: curl --silent --cookie "PHPSESSID=295a3717ec16ac5b8bebf3e21ca7f311" --data "username=USERNAME&pass=PASSWORD&button_login=LOG+IN" http://192.168.2.102/
  schnellladen_ein: curl --silent --cookie "PHPSESSID=295a3717ec16ac5b8bebf3e21ca7f311" --data "currentLimiterPhaseSelection=1&currentLimiterValue=16&button_current_limiter_settings=Daten+absenden" http://192.168.2.102/index_main.php >/dev/null
  schnellladen_aus: curl --silent --cookie "PHPSESSID=295a3717ec16ac5b8bebf3e21ca7f311" --data "currentLimiterPhaseSelection=0&currentLimiterValue=16&button_current_limiter_settings=Daten+absenden" http://192.168.2.102/index_main.php >/dev/null

Replace

  • USERNAME with your username
  • PASSWORD with your password
  • 192.168.2.102 with the local IP address of your Wallbox.

Both USERNAME and PASSWORD need to be URL encoded if they contain special characters, which you can do here: https://www.urlencoder.io/

The PHPSESSID can be any random string as far as I know, but it has to be the same for all shell commands. You can leave it as it is.


Now you can create your automations from this. For starters, I used a simple switch input_boolean.schnellladen to change from 1/3-phase operation.

Switch to 1-phase:

alias: Webasto Schnellladen Aus
description: ""
triggers:
  - trigger: state
    entity_id:
      - input_boolean.schnellladen
    from: "on"
    to: "off"
conditions: []
actions:
  - action: shell_command.schnellladen_session
    data: {}
  - action: shell_command.schnellladen_aus
    data: {}
mode: single

Switch to 3-phase:

alias: Webasto Schnellladen Ein
description: ""
triggers:
  - trigger: state
    entity_id:
      - input_boolean.schnellladen
    from: "off"
    to: "on"
conditions: []
actions:
  - action: shell_command.schnellladen_session
    data: {}
  - action: shell_command.schnellladen_ein
    data: {}
mode: single

To check if this works, you can refresh the Wallbox Web UI and see if the 1/3-phase operation has changed.


Have fun with your own automations!

2 Likes

This helped me a lot :slight_smile:

Unfortunately the new firmware includes a token as the first argument …
By the way I have a Vestel EVC04-E11WDM-S

I modified GitHub - JElchison/curl-auth-csrf: Python tool that mimics cURL, but performs a login and handles any Cross-Site Request Forgery (CSRF) tokens. Useful for scraping HTML normally only accessible when logged in. to send a post and also extracted the token from the “after login” page. With this I can basically set any Web-UI field that I want, allowing me to dynamically switch from 1 to 3 phases. This requires stopping the charging session , switching the phases and turning it back on.

I’ll publish my changes here GitHub - kr0ner/curl-auth-csrf: Python tool that mimics cURL, but performs a login and handles any Cross-Site Request Forgery (CSRF) tokens. Useful for scraping HTML normally only accessible when logged in.

thank you so much.

I can confirm this works like a charm.

Webasto Unite with firmware v2.99.11-1.0.109.0

Hi. I have VESTEL EVC04 too, and want it “connect” to HA. I am beginner with HA. Tried setup OCPP, but didn connect Vestel.

Please can you advise me some “lama instruction”, how to setup.
(vestel charger is connected via wifi, and asccessible via url)

modbus.yaml

# Protocol requirements
# The Webasto Unite charging station acts as a slave device in Modbus TCP/IP communication.
# Charging station should be in the same network with the master device, or proper routing should be applied to provide communication between slave and master devices in different sub networks.
# Each charging station should have a different IP address. There can only be one active Modbus master connection at any time.
# Parameter Modbus TCP
# Each Wallbox Unite must be given a unique IP.
# Parameter                     Value 
# IP-address:                   Any IP address; All Webasto Unite on the same subnet (e.g., xxx.xxx.xxx.xxx)
# Modbus Port:                  502
# Modbus Unit ID:               255

- name: Vestel
  type: tcp
  timeout: 5
  host: 192.168.178.124
  port: 502
  sensors:
    #- name: Vestel_Serial_Number
    #  unique_id: Vestel_Serial_Number
    #  slave: 255
    #  input_type: input
    #  address: 100
    #  data_type: string
    #  count: 25
      
    #- name: Vestel_Charge_Point_ID
    #  unique_id: Vestel_Charge_Point_ID
    #  slave: 255
    #  input_type: input
    #  address: 130
    #  data_type: string
    #  count: 50
      
    #- name: Vestel_Charge_Point_Brand
    #  unique_id: Vestel_Charge_Point_Brand
    #  slave: 255
    #  input_type: input
    #  address: 190
    #  data_type: string
    #  count: 10
      
    #- name: Vestel_Charge_Point_Model
    #  unique_id: Vestel_Charge_Point_Model
    #  slave: 255
    #  input_type: input
    #  address: 210
    #  data_type: string
    #  count: 5
      
    #- name: Vestel_Firmware_Version
    #  unique_id: Vestel_Firmware_Version
    #  slave: 255
    #  input_type: input
    #  address: 230
    #  data_type: string
    #  count: 50
      
    #- name: Vestel_Date
    #  unique_id: Vestel_Date
    #  slave: 255
    #  input_type: input
    #  address: 290
    #  data_type: uint32
      
    #- name: Vestel_Time
    #  unique_id: Vestel_Time
    #  slave: 255
    #  input_type: input
    #  address: 294
    #  data_type: uint32
      
    - name: Vestel_Charge_Point_Power
      unique_id: Vestel_Charge_Point_Power
      slave: 255
      input_type: input
      address: 400
      data_type: uint32
      offset: 0
      scale: 1
      precision: 2
      state_class: measurement
      unit_of_measurement: W
      
    - name: Vestel_Number_of_Phases
    # 0:1-phase, 1:3-phases
      unique_id: Vestel_Number_of_Phases
      slave: 255
      input_type: input
      address: 404
      data_type: uint16

    - name: Vestel_Number_Phases_Switch
    # 0:1-phase, 1:3-phases
      unique_id: Vestel_Number_Phases_Switch
      slave: 255
      input_type: holding
      address: 405
      data_type: uint16

    - name: Vestel_Charge_Point_State
  # 0: "Available",
  # 1: "Preparing",
  # 2: "Charging",
  # 3: "SuspendedEVSE",
  # 4: "SuspendedEV",
  # 5: "Finishing",
  # 6: "Reserved",
  # 7: "Unavailable",
  # 8: "Faulted",
      unique_id: Vestel_Charge_Point_State
      slave: 255
      input_type: input
      address: 1000
      data_type: uint16
      
    #- name: Vestel_Charging_State
  # 0: Not Charging, State Ax, Bx, Dx or C1 1: Charging, state C2      
    #  unique_id: Vestel_Charging_State
    #  slave: 255
    #  input_type: input
    #  address: 1001
    #  data_type: uint16
      
    - name: Vestel_Equipment_State
  # 0: Initializing
  # 1: Running
  # 2: Fault
  # 3: Disabled
  # 4: Updating      
      unique_id: Vestel_Equipment_State
      slave: 255
      input_type: input
      address: 1002
      data_type: uint16

    - name: Vestel_Cable_State
  # 0: Cable not connected 1: Cable connected, vehicle not connected 2: Cable connected, vehicle connected 3: Cable connected, vehicle connected, cable locked
      unique_id: Webasto_Cable_State
      slave: 255
      input_type: input
      address: 1004
      data_type: uint16
      
    - name: Vestel_EVSE_Fault_Code
  # 0: No fault
  # Other: Fault code      
      unique_id: Vestel_EVSE_Fault_Code
      slave: 255
      input_type: input
      address: 1006
      data_type: uint16
      
    - name: Vestel_Charging_Current_L1
      unique_id: Vestel_Charging_Current_L1
      slave: 255
      input_type: input
      address: 1008
      data_type: uint16
      device_class: current
      offset: 0
      scale: 0.001
      precision: 0
      state_class: measurement
      unit_of_measurement: A

    - name: Vestel_Charging_Current_L2
      unique_id: Vestel_Charging_Current_L2
      slave: 255
      input_type: input
      address: 1010
      data_type: uint16
      device_class: current
      offset: 0
      scale: 0.001
      precision: 0
      state_class: measurement
      unit_of_measurement: A

    - name: Vestel_Charging_Current_L3
      unique_id: Vestel_Charging_Current_L3
      slave: 255
      input_type: input
      address: 1012
      data_type: uint16
      device_class: current
      offset: 0
      scale: 0.001
      precision: 0
      state_class: measurement
      unit_of_measurement: A
      
    - name: Vestel_Charging_Voltage_L1
      unique_id: Vestel_Charging_Voltage_L1
      slave: 255
      input_type: input
      address: 1014
      data_type: uint16
      device_class: voltage
      state_class: measurement
      unit_of_measurement: V
      
    - name: Vestel_Charging_Voltage_L2
      unique_id: Vestel_Charging_Voltage_L2
      slave: 255
      input_type: input
      address: 1016
      data_type: uint16
      device_class: voltage
      state_class: measurement
      unit_of_measurement: V
      
    - name: Vestel_Charging_Voltage_L3
      unique_id: Vestel_Charging_Voltage_L3
      slave: 255
      input_type: input
      address: 1018
      data_type: uint16
      device_class: voltage
      state_class: measurement
      unit_of_measurement: V

    - name: Vestel_Active_Power_Total
      unique_id: Vestel_Active_Power_Total
      slave: 255
      input_type: input
      address: 1020
      data_type: uint32
      device_class: power
      state_class: measurement
      unit_of_measurement: W
      
    - name: Vestel_Active_Power_L1
      unique_id: Vestel_Active_Power_L1
      slave: 255
      input_type: input
      address: 1024
      data_type: uint32
      device_class: power
      state_class: measurement
      unit_of_measurement: W
      
    - name: Vestel_Active_Power_L2
      unique_id: Vestel_Active_Power_L2
      slave: 255
      input_type: input
      address: 1028
      data_type: uint32
      device_class: power
      state_class: measurement
      unit_of_measurement: W
      
    - name: Vestel_Active_Power_L3
      unique_id: Vestel_Active_Power_L3
      slave: 255
      input_type: input
      address: 1032
      data_type: uint32
      device_class: power
      state_class: measurement
      unit_of_measurement: W

    - name: Vestel_Meter_Reading
      unique_id: Vestel_Meter_Reading
      slave: 255
      input_type: input
      address: 1036
      data_type: uint32
      device_class: energy
      state_class: total_increasing
      offset: 0
      scale: 0.1
      precision: 2
      unit_of_measurement: kWh

    - name: Vestel_Session_Max_Current
      unique_id: Vestel_Session_Max_Current
      slave: 255
      input_type: input
      address: 1100
      data_type: uint16
      device_class: current
      state_class: measurement
      unit_of_measurement: A

    - name: Vestel_EVSE_Min_Current
      unique_id: Vestel_EVSE_Min_Current
      slave: 255
      input_type: input
      address: 1102
      data_type: uint16
      device_class: current
      state_class: measurement
      unit_of_measurement: A

    - name: Vestel_EVSE_Max_Current
      unique_id: Vestel_EVSE_Max_Current
      slave: 255
      input_type: input
      address: 1104
      data_type: uint16
      device_class: current
      state_class: measurement
      unit_of_measurement: A

    - name: Vestel_Cable_Max_Current
      unique_id: Vestel_Cable_Max_Current
      slave: 255
      input_type: input
      address: 1106
      data_type: uint16
      device_class: current
      state_class: measurement
      unit_of_measurement: A

    - name: Vestel_Charged_Energy
      unique_id: Vestel_Charged_Energy
      slave: 255
      input_type: input
      address: 1502
      data_type: uint32
      device_class: energy
      state_class: total
      offset: 0
      scale: 0.001
      precision: 3
      unit_of_measurement: kWh

    #- name: Vestel_Session_Start_Time
    #  unique_id: Vestel_Session_Start_Time
    #  slave: 255
    #  input_type: input
    #  address: 1504
    #  data_type: uint32

    #- name: Vestel_Session_Duration
    #  unique_id: Vestel_Session_Duration
    #  slave: 255
    #  input_type: input
    #  address: 1508
    #  data_type: uint32
    #  device_class: duration
    #  state_class: measurement
    #  unit_of_measurement: s

    #- name: Vestel_Session_End_Time
    #  unique_id: Vestel_Session_End_Time
    #  slave: 255
    #  input_type: input
    #  address: 1512
    #  data_type: uint32
      
    - name: Vestel_Failsafe_Current
    # R/W: Can be set in the Unite WebUI (Standard:6A)
    # Charging power will fall back to 6A, if ALive Register 6000 not triggered with 1 within each 20 seconds 
      unique_id: Vestel_Failsafe_Current
      slave: 255
      input_type: holding
      address: 2000
      data_type: uint16
      device_class: current
      state_class: measurement
      unit_of_measurement: A
    # Failsafe charging current during communication failure

    #- name: Vestel_Failsafe_Timeout
    # R/W: No need to change (Standard: 20 seconds)
    #  unique_id: Vestel_Failsafe_Timeout
    #  slave: 255
    #  input_type: holding
    #  address: 2002
    #  data_type: uint16
    # Communication timeout for switching to Failsafe charging current. If the timeout has occurred and the TCP socket is still active, TCP socket restarts. If set, Failsafe period is timeout/2, otherwise 20 sec.
      
    - name: Vestel_Charging_Current
    # R/W: 0-5A=Charging paused, 6-32A=Charging with set Amps
      unique_id: Vestel_Charging_Current
      slave: 255
      input_type: holding
      address: 5004
      data_type: uint16
      device_class: current
      state_class: measurement
      unit_of_measurement: A
    # Dynamic charging current

  switches:
    - name: Vestel_Alive_Register
    # R/W
      unique_id: Vestel_Alive_Register
      slave: 255
      write_type: holding
      address: 6000
      command_on: 1
      command_off: 0
      verify:
        delay: 5
    # EMS (Master) writes 1 EVSE (Slave) writes 0 (EVSE checks this register at a period of (Failsafe Timeout)/2 for a value of 1, and sets it to 0. Period cannot go less than 3 seconds)

    - name: Vestel_3_Phase_Charging
    # R/W
      unique_id: Vestel_3_Phase_Charging
      slave: 255
      write_type: holding
      address: 405
      command_on: 1
      command_off: 0
      verify:
        delay: 5