Binding request: Viessmann (API/ViCare - not vitotronic)

Hi @rogrun,
great binding. I am experimenting a few days and it’s awesome.
Currently there is one issue which I cannot solve. When using the setSchedule for heatingcircuit I get a bad request error (details see below). I traced the logs and found following:

20:28:00.065 [TRACE] [g.viessmann.internal.api.ViessmannApi] - API: Post request json is {"newSchedule":" {"mon":[{"start":" .....

I guess the quotas are not correct and the payload itself do not need to be send in quotas.
It should be changed to

'{"newSchedule": {"mon":[{"start":" .....

Or am I wrong? If so, what else could be the problem?

I join marbon87 and would like to invite you to a virtual beer. :beers:
Thanks…

complete trace:

20:28:00.063 [INFO ] [openhab.event.ItemCommandEvent       ] - Item 'ViessmannDevice_HeatingscheduleCircuit0' received command  {"mon":[{"start":"06:00","end":"10:00","mode":"normal","position":0},{"start":"16:00","end":"21:30","mode":"normal","position":1}],"tue":[{"start":"06:00","end":"10:00","mode":"normal","position":0},{"start":"16:00","end":"21:30","mode":"normal","position":1}],"wed":[{"start":"06:00","end":"10:00","mode":"normal","position":0},{"start":"16:00","end":"21:30","mode":"normal","position":1}],"thu":[{"start":"06:00","end":"10:00","mode":"normal","position":0},{"start":"16:00","end":"21:30","mode":"normal","position":1}],"fri":[{"start":"06:00","end":"10:00","mode":"normal","position":0},{"start":"16:00","end":"21:30","mode":"normal","position":1}],"sat":[{"start":"06:00","end":"10:00","mode":"normal","position":0},{"start":"20:00","end":"21:30","mode":"normal","position":1}],"sun":[{"start":"06:00","end":"10:00","mode":"normal","position":0},{"start":"16:00","end":"21:30","mode":"normal","position":1}]}
20:28:00.064 [INFO ] [openhab.event.ItemStatePredictedEvent] - Item 'ViessmannDevice_HeatingscheduleCircuit0' predicted to become  {"mon":[{"start":"06:00","end":"10:00","mode":"normal","position":0},{"start":"16:00","end":"21:30","mode":"normal","position":1}],"tue":[{"start":"06:00","end":"10:00","mode":"normal","position":0},{"start":"16:00","end":"21:30","mode":"normal","position":1}],"wed":[{"start":"06:00","end":"10:00","mode":"normal","position":0},{"start":"16:00","end":"21:30","mode":"normal","position":1}],"thu":[{"start":"06:00","end":"10:00","mode":"normal","position":0},{"start":"16:00","end":"21:30","mode":"normal","position":1}],"fri":[{"start":"06:00","end":"10:00","mode":"normal","position":0},{"start":"16:00","end":"21:30","mode":"normal","position":1}],"sat":[{"start":"06:00","end":"10:00","mode":"normal","position":0},{"start":"20:00","end":"21:30","mode":"normal","position":1}],"sun":[{"start":"06:00","end":"10:00","mode":"normal","position":0},{"start":"16:00","end":"21:30","mode":"normal","position":1}]}
20:28:00.064 [TRACE] [ssmann.internal.handler.DeviceHandler] - ChannelUID: {setScheduleUri=https://api.viessmann.com/iot/v1/equipment/installations/xxxx/gateways/xxxxx/devices/0/features/heating.circuits.0.heating.schedule/commands/setSchedule, setScheduleParams=newSchedule, feature=heating.circuits.0.heating.schedule, command=setSchedule}
20:28:00.065 [TRACE] [ssmann.internal.handler.DeviceHandler] - Received StringType Command for Channel org.openhab.core.thing.binding.builder.ChannelBuilder$ChannelImpl@7937cdeb
20:28:00.065 [TRACE] [g.viessmann.internal.api.ViessmannApi] - API: Post request json is '{"newSchedule":" {"mon":[{"start":"06:00","end":"10:00","mode":"normal","position":0},{"start":"16:00","end":"21:30","mode":"normal","position":1}],"tue":[{"start":"06:00","end":"10:00","mode":"normal","position":0},{"start":"16:00","end":"21:30","mode":"normal","position":1}],"wed":[{"start":"06:00","end":"10:00","mode":"normal","position":0},{"start":"16:00","end":"21:30","mode":"normal","position":1}],"thu":[{"start":"06:00","end":"10:00","mode":"normal","position":0},{"start":"16:00","end":"21:30","mode":"normal","position":1}],"fri":[{"start":"06:00","end":"10:00","mode":"normal","position":0},{"start":"16:00","end":"21:30","mode":"normal","position":1}],"sat":[{"start":"06:00","end":"10:00","mode":"normal","position":0},{"start":"20:00","end":"21:30","mode":"normal","position":1}],"sun":[{"start":"06:00","end":"10:00","mode":"normal","position":0},{"start":"16:00","end":"21:30","mode":"normal","position":1}]}"}'
20:28:00.065 [INFO ] [openhab.event.ItemStateChangedEvent  ] - Item 'ViessmannDevice_HeatingscheduleCircuit0' changed from {"mon":[{"start":"06:00","end":"10:00","mode":"normal","position":0},{"start":"16:00","end":"21:30","mode":"normal","position":1}],"tue":[{"start":"06:00","end":"10:00","mode":"normal","position":0},{"start":"16:00","end":"21:30","mode":"normal","position":1}],"wed":[{"start":"06:00","end":"10:00","mode":"normal","position":0},{"start":"16:00","end":"21:30","mode":"normal","position":1}],"thu":[{"start":"06:00","end":"10:00","mode":"normal","position":0},{"start":"16:00","end":"21:30","mode":"normal","position":1}],"fri":[{"start":"06:00","end":"10:00","mode":"normal","position":0},{"start":"16:00","end":"21:30","mode":"normal","position":1}],"sat":[{"start":"06:00","end":"10:00","mode":"normal","position":0},{"start":"20:00","end":"21:30","mode":"normal","position":1}],"sun":[{"start":"06:00","end":"10:00","mode":"normal","position":0},{"start":"16:00","end":"21:30","mode":"normal","position":1}]} to  {"mon":[{"start":"06:00","end":"10:00","mode":"normal","position":0},{"start":"16:00","end":"21:30","mode":"normal","position":1}],"tue":[{"start":"06:00","end":"10:00","mode":"normal","position":0},{"start":"16:00","end":"21:30","mode":"normal","position":1}],"wed":[{"start":"06:00","end":"10:00","mode":"normal","position":0},{"start":"16:00","end":"21:30","mode":"normal","position":1}],"thu":[{"start":"06:00","end":"10:00","mode":"normal","position":0},{"start":"16:00","end":"21:30","mode":"normal","position":1}],"fri":[{"start":"06:00","end":"10:00","mode":"normal","position":0},{"start":"16:00","end":"21:30","mode":"normal","position":1}],"sat":[{"start":"06:00","end":"10:00","mode":"normal","position":0},{"start":"20:00","end":"21:30","mode":"normal","position":1}],"sun":[{"start":"06:00","end":"10:00","mode":"normal","position":0},{"start":"16:00","end":"21:30","mode":"normal","position":1}]}
20:28:00.069 [INFO ] [openhab.event.ItemStateChangedEvent  ] - Item 'ViessmannConnectBridge_CountAPICalls' changed from 76 to 77
20:28:00.417 [TRACE] [g.viessmann.internal.api.ViessmannApi] - API: Response took 351 msec: {"viErrorId":"req-db53ba0442284b1aa25b09484fc2ff5e","statusCode":400,"errorType":"BAD_REQUEST","message":"Request has wrong structure in URL or provided parameters","extendedPayload":{"reason":"Invalid request payload JSON format"}}
20:28:00.418 [WARN ] [g.viessmann.internal.api.ViessmannApi] - ViError: Request has wrong structure in URL or provided parameters | Reason: Invalid request payload JSON format

Hi @sledge2712

I’ll look around for this issue in the next few days. I’m a bit busy at the moment.

Best Ronny

Hi @sledge2712 ,

I fixed this issue. Please download the new version and put it into the addons folder.
Let me know if it works. So that I can publish this into the Smarthome/J Repo

https://lu-media.de/org.smarthomej.binding.viessmann-3.2.11-SNAPSHOT.jar

@sledge2712 and @marbon87 thanks for the beer :beer:

1 Like

Hi @rogrun ,
perfect…

2022-04-04 07:14:00.971 [TRACE] [smann.internal.handler.DeviceHandler] - ChannelUID: {setScheduleUri=https://api.viessmann.com/iot/v1/equipment/installations/xx/gateways/xxx/devices/0/features/heating.circuits.0.heating.schedule/commands/setSchedule, command=setSchedule, feature=heating.circuits.0.heating.schedule, setScheduleParams=newSchedule}
2022-04-04 07:14:00.971 [TRACE] [smann.internal.handler.DeviceHandler] - Received StringType Command for Channel org.openhab.core.thing.binding.builder.ChannelBuilder$ChannelImpl@1a5a8ac4
2022-04-04 07:14:00.971 [TRACE] [.viessmann.internal.api.ViessmannApi] - API: Post request json is '{"newSchedule":{"mon":[{"start":"05:00","end":"10:00","mode":"normal","position":0},{"start":"16:00","end":"21:30","mode":"normal","position":1}],"tue":[{"start":"06:00","end":"10:00","mode":"normal","position":0},{"start":"16:00","end":"21:30","mode":"normal","position":1}],"wed":[{"start":"06:00","end":"10:00","mode":"normal","position":0},{"start":"16:00","end":"21:30","mode":"normal","position":1}],"thu":[{"start":"06:00","end":"10:00","mode":"normal","position":0},{"start":"16:00","end":"21:30","mode":"normal","position":1}],"fri":[{"start":"06:00","end":"10:00","mode":"normal","position":0},{"start":"16:00","end":"21:30","mode":"normal","position":1}],"sat":[{"start":"06:00","end":"10:00","mode":"normal","position":0},{"start":"20:00","end":"21:30","mode":"normal","position":1}],"sun":[{"start":"06:00","end":"10:00","mode":"normal","position":0},{"start":"16:00","end":"21:30","mode":"normal","position":1}]}}'
2022-04-04 07:14:01.726 [TRACE] [.viessmann.internal.api.ViessmannApi] - API: Response took 754 msec: {"data":{"success":true,"reason":"COMMAND_EXECUTION_SUCCESS"}}

Thanks for this quick reply and fixing the issue.
Send me your paypal-adress so I can support the project a little bit…
Regards

@rogrun : question from a newcomer to hab : can I expect this great work to be « officialzed » at openhab portal level (vs loading from your web site ) ?
Thanks Community.

I’m on the 3.3 milestone version and do see this binding under " Other Addons".
Does that help?

Sorry but I do not find it (I still run 3.2).
What’s the precise name of the binding please ?

Thanks !

I think in this case you have to add the URL in the following settings menue: https://download.smarthomej.org/addons.json

How do I change the slope and shift of a circuit’ heating curve? I tried with a stepper widget but the value is reset after some time.

2022-05-14 20:16:59.481 [INFO ] [openhab.event.ItemCommandEvent ] - Item ‘ViessmannWarmepumpe_HeatingcurveCircuit0shift’ received command -1

2022-05-14 20:16:59.484 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item ‘ViessmannWarmepumpe_HeatingcurveCircuit0shift’ predicted to become -1

2022-05-14 20:16:59.500 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item ‘ViessmannWarmepumpe_HeatingcurveCircuit0shift’ changed from -2 to -1

2022-05-14 20:17:57.498 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item ‘ViessmannWarmepumpe_HeatingcurveCircuit0shift’ changed from -1 to -2

did you find a solution? I would like to set the DHW Temperature, but is will reset:

2022-07-05 20:07:19.135 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'ViessmannDevice0_DHWmaintemperature' received command 40
2022-07-05 20:07:19.140 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'ViessmannDevice0_DHWmaintemperature' predicted to become 40
2022-07-05 20:07:19.162 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'ViessmannDevice0_DHWmaintemperature' changed from 50 °C to 40 °C
2022-07-05 20:10:08.922 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'ViessmannDevice0_DHWmaintemperature' changed from 40 °C to 50 °C

@rogrun
Do you have any idea or some examples to set things in rules?

I just gave it a try and it is working as expected. No change as I can see. How do you set the new value?

2022-07-06 21:25:44.868 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'VIE_DHWmaintemperature' received command 49
2022-07-06 21:25:44.874 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'VIE_DHWmaintemperature' predicted to become 49
2022-07-06 21:25:44.879 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'VIE_DHWmaintemperature' changed from 50 °C to 49 °C

Did you install the newest version of the binding (3.2.13)?

yes, 3.2.13 is installed

in my rule, I have this:
ViessmannDevice0_DHWmaintemperature.sendCommand(50)

hmm and this is always the same behaviour?

It looks like someone changed the value on your system afterwards.
What happes when you set the new value and immediately disable the viessmann bridge on your system?
Can you see the change here or in the app?
https://vitoguide.viessmann.com/

this happens always, and I don’t see a change in the app, the website or at the Heat Pump. I think the value changes back when the binding is reading the value by API from the server.

But when you set the new value from OH you can see the change in the app?
Can you change the operating modes from OH? Does it also change back?

no, I don’t see the value. It is the same with “perating mode - DHW and heating (Circuit: 0) active”, this is also restored to the old value.

So you are able to read but not to write? Is this correct?
Did it ever work then?
I think you should open an own topic where you describe your problem detailed.

@ChrisM Please open a new topic and link me at the post

There is a bug. I’ll try to fix it as soon as possible, but I don’t have much time at the moment