Skip to content

Instantly share code, notes, and snippets.

@MoritzBuetzer
Created December 21, 2020 08:17
Show Gist options
  • Save MoritzBuetzer/6441d4045f989ef57aed915250bb4020 to your computer and use it in GitHub Desktop.
Save MoritzBuetzer/6441d4045f989ef57aed915250bb4020 to your computer and use it in GitHub Desktop.
REST Integration for V-Zug Home Appliances in Home Assistant
- platform: rest
resource: http://[DEVICE_IP]/ai?command=getDeviceStatus
name: 'V-Zug CookTopInduktion V6000'
authentication: digest
username: !secret vzug.username
password: !secret vzug.password
json_attributes:
- DeviceName
- Serial
- Inactive
- Status
- Program
- ProgramEnd
- platform: template
sensors:
vzug_cooktopinduktion_devicename:
friendly_name: 'V-Zug CookTopInduktion V6000 DeviceName'
value_template: "{{ state_attr('sensor.v_zug_cooktopinduktion_v6000', 'DeviceName') }}"
vzug_cooktopinduktion_serial:
friendly_name: 'V-Zug CookTopInduktion V6000 Serial'
value_template: "{{ state_attr('sensor.v_zug_cooktopinduktion_v6000', 'Serial') }}"
vzug_cooktopinduktion_inactive:
friendly_name: 'V-Zug CookTopInduktion V6000 Inactive'
value_template: "{{ state_attr('sensor.v_zug_cooktopinduktion_v6000', 'Inactive') }}"
vzug_cooktopinduktion_status:
friendly_name: 'V-Zug CookTopInduktion V6000 Status'
value_template: "{{ state_attr('sensor.v_zug_cooktopinduktion_v6000', 'Status') }}"
vzug_cooktopinduktion_program:
friendly_name: 'V-Zug CookTopInduktion V6000 Program'
value_template: "{{ state_attr('sensor.v_zug_cooktopinduktion_v6000', 'Program') }}"
vzug_cooktopinduktion_end:
friendly_name: 'V-Zug CookTopInduktion V6000 End'
value_template: "{{ state_attr('sensor.v_zug_cooktopinduktion_v6000', 'ProgramEnd')['End'] }}"
vzug_cooktopinduktion_endtype:
friendly_name: 'V-Zug CookTopInduktion V6000 End'
value_template: "{{ state_attr('sensor.v_zug_cooktopinduktion_v6000', 'ProgramEnd')['EndType'] }}"
@EagleAdam
Copy link

EagleAdam commented Jan 17, 2023

Hi all, I just found this thread, owner of a V4000 dishwasher as well. In browsing around I found another thread where they managed to get a bit more data out of the vzug appliances.

I found the following:
http://172.16.0.xx/hh?command=getCommand&value=ECO_MGMT_ENERGY_PROGRAM&_=1673954407332
http://172.16.0.xx/hh?command=getCommand&value=ECO_MGMT_WATER_PROGRAM&_=1673954407333
http://172.16.0.xx/hh?command=getCommand&value=ECO_MGMT_ENERGY_AVG&_=1673954407334
http://172.16.0.xx/hh?command=getCommand&value=ECO_MGMT_WATER_AVG&_=1673954407335
http://172.16.0.xx/hh?command=getCommand&value=ECO_MGMT_ENERGY_TOTAL&_=1673954407337
http://172.16.0.xx/hh?command=getCommand&value=ECO_MGMT_WATER_TOTAL&_=1673954407338

Calling these gives me a json response:
{"type":"status","description":"Total consumption","command":"ECO_MGMT_ENERGY_TOTAL","value":"346 kWh","alterable":false}

Using this code I can get the value in HA:

  - scan_interval: 300
    resource: http://172.16.0.98/hh?command=getCommand&value=ECO_MGMT_ENERGY_TOTAL
    sensor:
      name: v_zug_totalenergy
      json_attributes:
        - command
        - value

and

template:
  - sensor:
      - name: v_zug_dishwasher_totalenergy
        state: "{{ state_attr('sensor.v_zug_totalenergy', 'value') }}"

Three issues:

  1. The value is a string, could someone help me learn how to convert it to an interger?
  2. From what I can tell, each value requires a separate REST call. Any idea how to "elegantly" put this into a config file?
  3. I think the number at the end of the URL is a unix timestamp

@adibu
Copy link

adibu commented Jan 26, 2023

Hi,

looking into the same parameters - want to read out total (and if possible current) energy and water consumtion from my machines to feed it in the energy monitor.

Your issues:

  1. This might be a starting point for string to value: and
  1. Yes most likely a unix epoch - however I learned that the API ignores values that are not implemented if added but you might play around and query historic values, if they change its a valid value parameter and the device stores historic states which would be nice.

My issues:

  • both are Adora V2000 series, both on latest firmware

  • I get an error {"error":{"code":400.03}}

  • this issue expands on commands:
    /hh?command=getCommands
    /hh?command=getCommand
    /hh?command=doTurnOff

  • some commands work such as:
    /hh?command=getCategories
    /hh?command=getProgram
    /hh?command=getZHMode
    /ai?command=getModelDescription
    /hh?command=getCategory&value=EcoManagement
    /ai?command=getDeviceStatus
    /ai?command=getLastPUSHNotifications

Any ideas?

@phoebos02
Copy link

phoebos02 commented Jan 31, 2023

  1. The value is a string, could someone help me learn how to convert it to an interger?

Hi all

I have a V4000 since some days and I gave all of it a bit of additional love. Here's my current config:

rest:
  - scan_interval: 20
    resource: http://192.168.2.2/ai?command=getDeviceStatus
    sensor:
      name: vzug_dishwasher
      json_attributes:
        - DeviceName
        - Serial
        - Inactive
        - Status
        - Program
        - ProgramEnd
        - EndType
  - scan_interval: 60
    resource: http://192.168.2.2/hh?command=getCommand&value=ECO_MGMT_ENERGY_PROGRAM
    sensor:
      name: vzug_dishwasher_last_energy
      value_template: "{{value_json.value[:-3].replace(',','.') | float(0) }}" # strip kWh
      unit_of_measurement: "kWh"
  - scan_interval: 120
    resource: http://192.168.2.2/hh?command=getCommand&value=ECO_MGMT_ENERGY_AVG
    sensor:
      name: vzug_dishwasher_avg_energy
      value_template: "{{ value_json.value[:-7].replace(',','.') | float(0) }}" # strip kWh/Ch.
      unit_of_measurement: "kWh"
  - scan_interval: 60
    resource: http://192.168.2.2/hh?command=getCommand&value=ECO_MGMT_ENERGY_TOTAL
    sensor:
      name: vzug_dishwasher_tot_energy
      value_template: "{{value_json.value[:-3].replace(',','.') | float(0) }}" # strip kWh
      unit_of_measurement: "kWh"
  - scan_interval: 60
    resource: http://192.168.2.2/hh?command=getCommand&value=ECO_MGMT_WATER_PROGRAM
    sensor:
      name: vzug_dishwasher_last_water
      value_template: "{{ value_json.value[:-1].replace(',','.') | float(0) }}" # strip l
      unit_of_measurement: "l"
  - scan_interval: 120
    resource: http://192.168.2.2/hh?command=getCommand&value=ECO_MGMT_WATER_AVG
    sensor:
      name: vzug_dishwasher_avg_water
      value_template: "{{ value_json.value[:-5].replace(',','.') | float(0) }}" # strip l/Ch.
      unit_of_measurement: "l"
  - scan_interval: 60
    resource: http://192.168.2.2/hh?command=getCommand&value=ECO_MGMT_WATER_TOTAL
    sensor:
      name: vzug_dishwasher_tot_water
      value_template: "{{ value_json.value[:-1].replace(',','.') | float(0) }}" # strip l
      unit_of_measurement: "l"

template:
  - sensor:
      - name: vzug_dishwasher_devicename
        state: "{{ state_attr('sensor.vzug_dishwasher', 'DeviceName') }}"
      - name: vzug_dishwasher_serial
        state: "{{ state_attr('sensor.vzug_dishwasher', 'Serial') }}"
      - name: vzug_dishwasher_inactive
        state: "{{ state_attr('sensor.vzug_dishwasher', 'Inactive') }}"
      - name: vzug_dishwasher_program
        state: "{{ state_attr('sensor.vzug_dishwasher', 'Program') }}"
      - name: vzug_dishwasher_status
        state: "{{ state_attr('sensor.vzug_dishwasher', 'Status') }}"
      - name: vzug_dishwasher_program_end
        state: "{{ state_attr('sensor.vzug_dishwasher', 'ProgramEnd').End }}"
      - name: vzug_dishwasher_program_end_type
        state: "{{ state_attr('sensor.vzug_dishwasher', 'ProgramEnd').EndType }}"

@Tehral
Copy link

Tehral commented Feb 13, 2023

hi guys I am a bit confused.
I should just be able to add a sensors.yaml with the last code from phoebos02
include it in the configuration and then it should work?

Or am I understanding this wrong?

@Tehral
Copy link

Tehral commented Feb 13, 2023

  1. The value is a string, could someone help me learn how to convert it to an interger?

Hi all

I have a V4000 since some days and I gave all of it a bit of additional love. Here's my current config:

rest:
  - scan_interval: 20
    resource: http://192.168.2.2/ai?command=getDeviceStatus
    sensor:
      name: vzug_dishwasher
      json_attributes:
        - DeviceName
        - Serial
        - Inactive
        - Status
        - Program
        - ProgramEnd
        - EndType
  - scan_interval: 60
    resource: http://192.168.2.2/hh?command=getCommand&value=ECO_MGMT_ENERGY_PROGRAM
    sensor:
      name: vzug_dishwasher_last_energy
      value_template: "{{value_json.value[:-3].replace(',','.') | float(0) }}" # strip kWh
      unit_of_measurement: "kWh"
  - scan_interval: 120
    resource: http://192.168.2.2/hh?command=getCommand&value=ECO_MGMT_ENERGY_AVG
    sensor:
      name: vzug_dishwasher_avg_energy
      value_template: "{{ value_json.value[:-7].replace(',','.') | float(0) }}" # strip kWh/Ch.
      unit_of_measurement: "kWh"
  - scan_interval: 60
    resource: http://192.168.2.2/hh?command=getCommand&value=ECO_MGMT_ENERGY_TOTAL
    sensor:
      name: vzug_dishwasher_tot_energy
      value_template: "{{value_json.value[:-3].replace(',','.') | float(0) }}" # strip kWh
      unit_of_measurement: "kWh"
  - scan_interval: 60
    resource: http://192.168.2.2/hh?command=getCommand&value=ECO_MGMT_WATER_PROGRAM
    sensor:
      name: vzug_dishwasher_last_water
      value_template: "{{ value_json.value[:-1].replace(',','.') | float(0) }}" # strip l
      unit_of_measurement: "l"
  - scan_interval: 120
    resource: http://192.168.2.2/hh?command=getCommand&value=ECO_MGMT_WATER_AVG
    sensor:
      name: vzug_dishwasher_avg_water
      value_template: "{{ value_json.value[:-5].replace(',','.') | float(0) }}" # strip l/Ch.
      unit_of_measurement: "l"
  - scan_interval: 60
    resource: http://192.168.2.2/hh?command=getCommand&value=ECO_MGMT_WATER_TOTAL
    sensor:
      name: vzug_dishwasher_tot_water
      value_template: "{{ value_json.value[:-1].replace(',','.') | float(0) }}" # strip l
      unit_of_measurement: "l"

template:
  - sensor:
      - name: vzug_dishwasher_devicename
        state: "{{ state_attr('sensor.vzug_dishwasher', 'DeviceName') }}"
      - name: vzug_dishwasher_serial
        state: "{{ state_attr('sensor.vzug_dishwasher', 'Serial') }}"
      - name: vzug_dishwasher_inactive
        state: "{{ state_attr('sensor.vzug_dishwasher', 'Inactive') }}"
      - name: vzug_dishwasher_program
        state: "{{ state_attr('sensor.vzug_dishwasher', 'Program') }}"
      - name: vzug_dishwasher_status
        state: "{{ state_attr('sensor.vzug_dishwasher', 'Status') }}"
      - name: vzug_dishwasher_program_end
        state: "{{ state_attr('sensor.vzug_dishwasher', 'ProgramEnd').End }}"
      - name: vzug_dishwasher_program_end_type
        state: "{{ state_attr('sensor.vzug_dishwasher', 'ProgramEnd').EndType }}"

forgot to qoute

@Tehral
Copy link

Tehral commented Feb 13, 2023

I also tried

rest:

template:

  • sensor:
    • name: oven_name
      state: "{{ state_attr('sensor.v_zug_oven', 'DeviceName') }}"
  • sensor:
    • name: oven_inactive
      state: "{{ state_attr('sensor.v_zug_oven', 'Inactive') }}"
  • sensor:
    • name: oven_status
      state: "{{ state_attr('sensor.v_zug_oven', 'Status') }}"
  • sensor:
    • name: oven_program
      state: "{{ state_attr('sensor.v_zug_oven', 'Program') }}"
  • sensor:
    • name: oven_program_end
      state: "{{ state_attr('sensor.v_zug_oven', 'ProgramEnd') }}"

@izacus
Copy link

izacus commented Apr 16, 2023

I'm not sure if this is still useful to anyone, but if I've noticed that the web UI always calls http://<ip>/hh?command=getZHMode right before calling http://<ip>/ai?command=getDeviceStatus.

If I do the same, then the amount of 501.03 errors is significantly reduced.

@chruetli
Copy link

@izacus How can I combine this "wakeup" call with the rest call?

@asowlnowl
Copy link

hi
i use the following config to get the engergy statistics:

sensor:

  • platform: rest
    name: 'V-Zug AdoraWash V4000 Eco Info'
    json_attributes_path: "$.energy"
    json_attributes:
    - total
    - lastMonth
    - lastYear
    - average
    - program
    resource: http://192.168.2.xx/hh?command=getEcoInfo

template:

  • sensor:
    • name: "V-Zug AdoraWash Energy total"
      device_class: energy
      state_class: total_increasing
      unit_of_measurement: kWh
      state: >
      {{ state_attr('sensor.v_zug_adorawash_v4000_eco_info', 'total')}}

That works with my adora wash v4000, AdoraDish V4000, Combair and Combisteamer v6000

but v-zug will change their api in the future. they will publish the new api.

@brutasse
Copy link

but v-zug will change their api in the future. they will publish the new api.

Hello @asowlnowl, is there a way to know more about this new API effort? Do you have a contact with v-zug?

@asowlnowl
Copy link

asowlnowl commented Apr 29, 2023

Hello @asowlnowl, is there a way to know more about this new API effort? Do you have a contact with v-zug?

they told me last fall that they have no eta yet. i just asked per contact form on their website for the api documentation.

@siku2
Copy link

siku2 commented Aug 22, 2023

FYI, I finally bit the bullet and created a proper integration for Home Assistant that can be installed using HACS.
The integration can be found here: https://github.com/siku2/hass-vzug

I used a lot of information in this thread for reference, so thank you all for sharing.

@phoebos02
Copy link

Nice one! Can’t wait to try it out. 👍

@adibu
Copy link

adibu commented Aug 26, 2023

Thank you for this - only had basic date before now a lot more is in the HACS integration. Great stuff!

@MoritzBuetzer
Copy link
Author

@siku2 awesome!

@simondaehler
Copy link

Awsome, Thanks
I have a AdoraDish V2000 I get the error "Einrichtung fehlgeschlage, wird erneut versucht" I guess the interface is not compatible with the V4000....

@siku2
Copy link

siku2 commented Aug 27, 2023

@simondaehler, can you create a new issue or discussion over at the repository? I would like to figure out what the issue is so the V2000 series can be supported as well, I just need a few things from your side and I don't want to clog up this thread.

@chruetli
Copy link

@siku2 I'm using your integration with an adorawash_v2000. I set it up with the very first version, so at least this one did work.

@tebeso
Copy link

tebeso commented Sep 17, 2023

I have both adorawash2000 and adoradry2000 and it works with latest version 0.31. Thanks a lot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment