Vicare (viessmann) disconnecting

Hi @rtuck99
I have an hybrid Viessmann system (heat pump and gas heater).
So in ViCare I have setup three things:

  1. Viessmann bridge [varazze]
  2. heat pump (Vitocal 200s) [pdc200]
  3. gas heater (Vitodens 24kW) [caldaia24kW]

It works and I can see the values of my system.

As I have a photovoltaic system, during summer I switch the gas heater OFF as the DHW is supplied by the electric heat pump only.

But, as soon as I switch off the gas heater, I get the following error messages every 2 or three minutes:

2023-07-17 08:55:35.895 [WARN ] [ar.vicare.internal.VicareServiceImpl] - Unable to request features from IoT API

	at com.qubular.vicare.internal.VicareServiceImpl.getFeatures(VicareServiceImpl.java:233) ~[?:?]

	at com.qubular.openhab.binding.vicare.internal.VicareBridgeHandler.lambda$getFeatures$8(VicareBridgeHandler.java:236) ~[?:?]

	at com.qubular.openhab.binding.vicare.internal.VicareBridgeHandler.handleBridgedRefreshCommand(VicareBridgeHandler.java:181) ~[?:?]

	at com.qubular.openhab.binding.vicare.internal.VicareDeviceThingHandler.syncHandleCommand(VicareDeviceThingHandler.java:169) ~[?:?]

	at com.qubular.openhab.binding.vicare.internal.VicareDeviceThingHandler.lambda$handleCommand$3(VicareDeviceThingHandler.java:159) ~[?:?]

2023-07-17 08:55:35.893 [WARN ] [ar.vicare.internal.VicareServiceImpl] - Unable to request features from IoT API

	at com.qubular.vicare.internal.VicareServiceImpl.getFeatures(VicareServiceImpl.java:233) ~[?:?]

	at com.qubular.openhab.binding.vicare.internal.VicareBridgeHandler.lambda$getFeatures$8(VicareBridgeHandler.java:236) ~[?:?]

	at com.qubular.openhab.binding.vicare.internal.VicareBridgeHandler.handleBridgedRefreshCommand(VicareBridgeHandler.java:181) ~[?:?]

	at com.qubular.openhab.binding.vicare.internal.VicareDeviceThingHandler.syncHandleCommand(VicareDeviceThingHandler.java:169) ~[?:?]

	at com.qubular.openhab.binding.vicare.internal.VicareDeviceThingHandler.lambda$handleCommand$3(VicareDeviceThingHandler.java:159) ~[?:?]

2023-07-17 08:55:35.953 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'vicare:bridge:varazze' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Unable to communicate with Viessmann API: java.io.IOException: Unable to request features from IoT API

2023-07-17 08:55:35.961 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'vicare:heating:varazze:caldaia24kW' changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)

2023-07-17 08:55:35.966 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'vicare:heating:varazze:caldaia24kW' changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE

2023-07-17 08:55:35.969 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'vicare:heating:varazze:pdc200' changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)

2023-07-17 08:55:35.995 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'vicare:heating:varazze:pdc200' changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE

2023-07-17 08:55:36.434 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'vicare:bridge:varazze' changed from OFFLINE (COMMUNICATION_ERROR): Unable to communicate with Viessmann API: java.io.IOException: Unable to request features from IoT API to ONLINE

Apparently, the binding doesn’t like the fact that the gas heater is switched off and therefore disconnects also the bridge… and then reconnects it and so on…

Is there anyway to modify the binding so that if one of the two things is off, the bridge remains active?

thanks

Hi,

When the gas heater is off, is it completely shut off at the mains?
The exception seems odd, I would expect if the API returns 404 it would be logged with a different error, it’s almost like the request is timing out instead.

I guess the Viessman service calls back to the heater in order to service the request, and does not get a timely response because it is off.

In summer when my boiler is off, I leave it powered on as it still provides hot water, so I don’t ever experience this.

If this is the case, perhaps it is best to disable the Thing within OpenHAB while it is off, that way it won’t bother polling the state.

Yes. It’s shut off at the mains. The reason is to save as much electricity as possible. Why to keep on if I don’t use it :wink:

Maybe you can try with yours to see if you get the same result. Just to make sure it’s not something in my setup.

I think that the binding should cope with a situation where one of Things is temporarily offline/switched off.
It should set only that Thing to an OFFLINE state and retry every a predefined time to see if it comes back, while now it is setting to OFFLINE all the Things and the BRIDGE.

what do you think?

Yes, bridge should be online and only not reachable things set to offline.
That’s how other bindings do it and it’s the preferred way.

Maybe you can try with yours to see if you get the same result. Just to make sure it’s not something in my setup.

I just tried this, I don’t get the same result, with mine the API returns (depending on the endpoint the old version of the endpoint returns 502 Bad Gateway (which is what I’d expect) the new version returns 400 Bad Request (I don’t think this is appropriate). However the response extended payload in both cases contains 404 reason “GATEWAY_OFFLINE”.
This produces different log messages to what you have got.

I suspect for whatever reason in your case the API is timing out. Unfortunately the provided log appears to be missing some information as standard log4j should identify the type of exception thrown - I’m not sure why this is perhaps you can adjust your logging configuration.

I think that the binding should cope with a situation where one of Things is temporarily offline/switched off.
It should set only that Thing to an OFFLINE state and retry every a predefined time to see if it comes back, while now it is setting to OFFLINE all the Things and the BRIDGE.

I would agree if the API is actually responding, (and my own test confirms that there is an issue here which I will address) but if it is timing out then the Bridge should definitely be marked as offline - there is no way to tell the difference between the API bridge not responding due to a failure of the remote service or if it’s due to failure to poll the heating device, and IMO if Viessmann’s service handled it properly they would mark the device as bad at their end and respond in timely fashion (as they appear to do with my own boiler).

Raised an issue re error handling, although as I’ve said I don’t think this will address it for you based on my current understanding of what you are experiencing.

Hi @rtuck99
the bridge goes OFFLINE when I switch the mains OFF of the boiler.
I don’t understand why the API should timeout ONLY when the boiler is switched off…
I tried to increase the log level of your binding to DEBUG, but the messages are the same.

Please tell me if I need to make some tests to try to better identify the issue.

This is what is happening as soon as I switch OFF the boiler:

2023-07-22 09:46:59.910 [WARN ] [ar.vicare.internal.VicareServiceImpl] - Unable to request features from IoT API, server returned 400, : DEVICE_COMMUNICATION_ERROR

2023-07-22 09:46:59.918 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'vicare:bridge:varazze' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Unable to communicate with Viessmann API: java.io.IOException: Unable to request features from IoT API, server returned 400, : DEVICE_COMMUNICATION_ERROR

2023-07-22 09:46:59.925 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'vicare:heating:varazze:caldaia24kW' changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)

2023-07-22 09:46:59.928 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'vicare:heating:varazze:pdc200' changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)

2023-07-22 09:46:59.931 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'vicare:heating:varazze:caldaia24kW' changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE

2023-07-22 09:46:59.965 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'vicare:heating:varazze:pdc200' changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE

2023-07-22 09:47:00.006 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'vicare:bridge:varazze' changed from OFFLINE (COMMUNICATION_ERROR): Unable to communicate with Viessmann API: java.io.IOException: Unable to request features from IoT API, server returned 400, : DEVICE_COMMUNICATION_ERROR to ONLINE

2023-07-22 09:49:00.043 [WARN ] [ar.vicare.internal.VicareServiceImpl] - Unable to request features from IoT API, server returned 400, : DEVICE_COMMUNICATION_ERROR

2023-07-22 09:49:00.049 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'vicare:bridge:varazze' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Unable to communicate with Viessmann API: java.io.IOException: Unable to request features from IoT API, server returned 400, : DEVICE_COMMUNICATION_ERROR

2023-07-22 09:49:00.053 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'vicare:heating:varazze:caldaia24kW' changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)

2023-07-22 09:49:00.056 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'vicare:heating:varazze:pdc200' changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)

2023-07-22 09:49:00.060 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'vicare:heating:varazze:caldaia24kW' changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE

2023-07-22 09:49:00.066 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'vicare:bridge:varazze' changed from OFFLINE (COMMUNICATION_ERROR): Unable to communicate with Viessmann API: java.io.IOException: Unable to request features from IoT API, server returned 400, : DEVICE_COMMUNICATION_ERROR to ONLINE

2023-07-22 09:49:00.071 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'vicare:heating:varazze:pdc200' changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE

2023-07-22 09:49:00.074 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'vicare:bridge:varazze' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Unable to communicate with Viessmann API: java.io.IOException: Unable to request features from IoT API, server returned 400, : DEVICE_COMMUNICATION_ERROR

2023-07-22 09:49:00.079 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'vicare:heating:varazze:caldaia24kW' changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)

2023-07-22 09:49:00.082 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'vicare:heating:varazze:pdc200' changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)

2023-07-22 09:49:00.085 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'vicare:bridge:varazze' changed from OFFLINE (COMMUNICATION_ERROR): Unable to communicate with Viessmann API: java.io.IOException: Unable to request features from IoT API, server returned 400, : DEVICE_COMMUNICATION_ERROR to ONLINE

2023-07-22 09:49:00.087 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'vicare:heating:varazze:caldaia24kW' changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE

2023-07-22 09:49:00.096 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'vicare:heating:varazze:pdc200' changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE

2023-07-22 09:49:00.099 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'vicare:bridge:varazze' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Unable to communicate with Viessmann API: java.io.IOException: Unable to request features from IoT API, server returned 400, : DEVICE_COMMUNICATION_ERROR

2023-07-22 09:49:00.102 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'vicare:bridge:varazze' changed from OFFLINE (COMMUNICATION_ERROR): Unable to communicate with Viessmann API: java.io.IOException: Unable to request features from IoT API, server returned 400, : DEVICE_COMMUNICATION_ERROR to ONLINE

2023-07-22 09:49:00.105 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'vicare:heating:varazze:caldaia24kW' changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE

2023-07-22 09:49:00.107 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'vicare:heating:varazze:caldaia24kW' changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)

2023-07-22 09:49:00.109 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'vicare:heating:varazze:pdc200' changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)

2023-07-22 09:49:00.112 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'vicare:heating:varazze:pdc200' changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE

2023-07-22 09:49:00.125 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'vicare:bridge:varazze' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Unable to communicate with Viessmann API: java.io.IOException: Unable to request features from IoT API, server returned 400, : DEVICE_COMMUNICATION_ERROR

2023-07-22 09:49:00.127 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'vicare:bridge:varazze' changed from OFFLINE (COMMUNICATION_ERROR): Unable to communicate with Viessmann API: java.io.IOException: Unable to request features from IoT API, server returned 400, : DEVICE_COMMUNICATION_ERROR to ONLINE

2023-07-22 09:49:00.129 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'vicare:heating:varazze:caldaia24kW' changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)

2023-07-22 09:49:00.132 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'vicare:heating:varazze:pdc200' changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)

2023-07-22 09:49:00.134 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'vicare:heating:varazze:caldaia24kW' changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE

2023-07-22 09:49:00.136 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'vicare:heating:varazze:pdc200' changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE

2023-07-22 09:49:00.138 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'vicare:bridge:varazze' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Unable to communicate with Viessmann API: java.io.IOException: Unable to request features from IoT API, server returned 400, : DEVICE_COMMUNICATION_ERROR

2023-07-22 09:49:00.140 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'vicare:heating:varazze:caldaia24kW' changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)

2023-07-22 09:49:00.142 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'vicare:heating:varazze:pdc200' changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)

2023-07-22 09:49:00.144 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'vicare:heating:varazze:caldaia24kW' changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE

2023-07-22 09:49:00.146 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'vicare:bridge:varazze' changed from OFFLINE (COMMUNICATION_ERROR): Unable to communicate with Viessmann API: java.io.IOException: Unable to request features from IoT API, server returned 400, : DEVICE_COMMUNICATION_ERROR to ONLINE

2023-07-22 09:49:00.149 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'vicare:heating:varazze:pdc200' changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE

2023-07-22 09:49:00.151 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'vicare:bridge:varazze' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Unable to communicate with Viessmann API: java.io.IOException: Unable to request features from IoT API, server returned 400, : DEVICE_COMMUNICATION_ERROR

2023-07-22 09:49:00.153 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'vicare:heating:varazze:caldaia24kW' changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)

2023-07-22 09:49:00.155 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'vicare:heating:varazze:pdc200' changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)

2023-07-22 09:49:00.157 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'vicare:bridge:varazze' changed from OFFLINE (COMMUNICATION_ERROR): Unable to communicate with Viessmann API: java.io.IOException: Unable to request features from IoT API, server returned 400, : DEVICE_COMMUNICATION_ERROR to ONLINE

2023-07-22 09:49:00.159 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'vicare:heating:varazze:pdc200' changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE

2023-07-22 09:49:00.165 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'vicare:heating:varazze:caldaia24kW' changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE

2023-07-22 09:49:00.167 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'vicare:bridge:varazze' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Unable to communicate with Viessmann API: java.io.IOException: Unable to request features from IoT API, server returned 400, : DEVICE_COMMUNICATION_ERROR

2023-07-22 09:49:00.169 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'vicare:heating:varazze:caldaia24kW' changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)

2023-07-22 09:49:00.171 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'vicare:heating:varazze:pdc200' changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)

2023-07-22 09:49:00.173 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'vicare:heating:varazze:caldaia24kW' changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE

2023-07-22 09:50:59.854 [WARN ] [ar.vicare.internal.VicareServiceImpl] - Unable to request features from IoT API, server returned 400, : DEVICE_COMMUNICATION_ERROR

2023-07-22 09:50:59.892 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'vicare:heating:varazze:pdc200' changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE

2023-07-22 09:50:59.942 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'vicare:bridge:varazze' changed from OFFLINE (COMMUNICATION_ERROR): Unable to communicate with Viessmann API: java.io.IOException: Unable to request features from IoT API, server returned 400, : DEVICE_COMMUNICATION_ERROR to ONLINE

2023-07-22 09:53:01.011 [WARN ] [ar.vicare.internal.VicareServiceImpl] - Unable to request features from IoT API, server returned 400, : DEVICE_COMMUNICATION_ERROR

2023-07-22 09:53:01.015 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'vicare:bridge:varazze' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Unable to communicate with Viessmann API: java.io.IOException: Unable to request features from IoT API, server returned 400, : DEVICE_COMMUNICATION_ERROR

2023-07-22 09:53:01.021 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'vicare:heating:varazze:caldaia24kW' changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)

2023-07-22 09:53:01.025 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'vicare:heating:varazze:pdc200' changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)

2023-07-22 09:53:01.030 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'vicare:heating:varazze:caldaia24kW' changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE

Hi @rtuck99
I was thinking that I might try to call the API directly from my browser and see the result with the bolier ON and the boiler OFF.

Can you write to me the API call that is failing so that I can manually call it and see the result?
It could help debugging the problem.

thanks

Hi,

This log trace is not the same as the previous one -
Your previous message didn’t have any of this info in the log trace:

2023-07-22 09:49:00.043 [WARN ] [ar.vicare.internal.VicareServiceImpl] - Unable to request features from IoT API, server returned 400, : DEVICE_COMMUNICATION_ERROR

Without knowing that plus what class of the exception (it’s an IOException) I couldn’t tell what was happening.

If you are getting 400, then it is not timing out and it’s more like what I can see on my own system and I can fix this.

That’s good news then.
Looking forward to the solution :slight_smile:

Hi @rtuck99
any update on this issue?

It should be fixed in the latest 4.0.3 version

thanks.
Does the 4.0.3 version works with OH3 or works only with OH4?
I haven’t started the upgrade to OH4 yet…

Only OpenHAB 4