Skip to content

Commit bd3a397

Browse files
committed
viessmann charger api: first draft for a template...
... mostly just looking for some feedback. Based on the api investigation at evcc-io#19639 (comment) * why does `getmode` trigger two identical http requests? * authentication via oauth2 using only the viessmann client id * user guidance to figure out the installation id, gateway serial and device id * should/can we configure a longer interval between updates? If so, how? Viessmann has an api limit of ~1 request per minute ``` chargers: - name: viessmann type: template template: viessmann installation_id: 23XXXXX # all digits gateway_serial: 76XXXXXXXXXXXXXX # all digits device_id: 0 target_temperature: 47 token: eyJ..... ``` ``` ./evcc --log trace -c ~/.evcc/evcc.yaml --database ~/.evcc/evcc.db charger viessmann ... [viessmann] TRACE 2025/03/25 19:35:15 GET https://api.viessmann.com/iot/v2/features/installations/23XXXXX/gateways/76XXXXXXXXXXXXXX/devices/0/features/heating.dhw.oneTimeCharge [viessmann] TRACE 2025/03/25 19:35:16 { "data": { ... } } [viessmann] TRACE 2025/03/25 19:35:16 GET https://api.viessmann.com/iot/v2/features/installations/23XXXXX/gateways/76XXXXXXXXXXXXXX/devices/0/features/heating.dhw.oneTimeCharge [viessmann] TRACE 2025/03/25 19:35:16 { "data": { ... } } ... Charge status: B Enabled: false Features: [Heating IntegratedDevice] ``` ``` ./evcc --log trace -c ~/.evcc/evcc.yaml --database ~/.evcc/evcc.db charger viessmann --enable [viessmann] TRACE 2025/03/25 13:28:51 {"temperature": 47} -- { "data": { "success": true, "message": null, "reason": "COMMAND_EXECUTION_SUCCESS" } } [viessmann] TRACE 2025/03/25 13:28:52 { } -- { "data": { "success": true, "message": null, "reason": "COMMAND_EXECUTION_SUCCESS" } } ``` ``` ./evcc --log trace -c ~/.evcc/evcc.yaml --database ~/.evcc/evcc.db charger viessmann --disable -- { "data": { "success": true, "message": null, "reason": "COMMAND_EXECUTION_SUCCESS" } } ```
1 parent 9587510 commit bd3a397

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed

Diff for: templates/definition/charger/viessmann.yaml

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
template: viessmann
2+
products:
3+
- brand: Viessmann
4+
description:
5+
generic: Viessmann (SG Ready)
6+
group: heating
7+
# requirements:
8+
# evcc: ["sponsorship"]
9+
params:
10+
# TODO mark parameters as required
11+
- name: installation_id # TODO guide user on how to get this value
12+
- name: gateway_serial # TODO guide user on how to get this value
13+
- name: device_id # TODO guide user on how to get this value
14+
- name: token # TODO get with client id via oauth2
15+
- name: target_temperature
16+
description:
17+
de: Zieltemperatur für Einmal-Warmwasser-Zubereitung (°C), max=60
18+
en: Target temperator for onetimecharge (°C), max=60
19+
default: 45
20+
type: int
21+
render: |
22+
type: sgready
23+
getmode:
24+
source: http
25+
uri: https://api.viessmann.com/iot/v2/features/installations/{{.installation_id}}/gateways/{{.gateway_serial}}/devices/{{.device_id}}/features/heating.dhw.oneTimeCharge
26+
headers:
27+
- content-type: application/json
28+
- authorization: Bearer {{.token}}
29+
jq: '.data.properties.active.value | if . == false then 1 elif . == true then 2 else . end'
30+
# false -> oneTimeCharge is disabled -> normal mode -> 1
31+
# true -> oneTimeCharge is enabled -> boost mode -> 2
32+
setmode:
33+
source: switch
34+
switch:
35+
- case: 1 # normal
36+
set:
37+
source: http
38+
uri: https://api.viessmann.com/iot/v2/features/installations/{{.installation_id}}/gateways/{{.gateway_serial}}/devices/{{.device_id}}/features/heating.dhw.oneTimeCharge/commands/deactivate
39+
method: POST
40+
headers:
41+
- content-type: application/json
42+
- authorization: Bearer {{.token}}
43+
body: >
44+
{ }
45+
- case: 2 # boost
46+
set:
47+
source: sequence
48+
set:
49+
- source: http
50+
uri: https://api.viessmann.com/iot/v2/features/installations/{{.installation_id}}/gateways/{{.gateway_serial}}/devices/{{.device_id}}/features/heating.dhw.temperature.temp2/commands/setTargetTemperature
51+
method: POST
52+
headers:
53+
- content-type: application/json
54+
- authorization: Bearer {{.token}}
55+
body: >
56+
{"temperature": {{.target_temperature}}}
57+
- source: http
58+
uri: https://api.viessmann.com/iot/v2/features/installations/{{.installation_id}}/gateways/{{.gateway_serial}}/devices/{{.device_id}}/features/heating.dhw.oneTimeCharge/commands/activate
59+
method: POST
60+
headers:
61+
- content-type: application/json
62+
- authorization: Bearer {{.token}}
63+
body: >
64+
{ }

0 commit comments

Comments
 (0)