home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.67k stars 29.95k forks source link

Vicare Water heater target temperature can‘t be set #123569

Closed ignazhabibi closed 1 month ago

ignazhabibi commented 1 month ago

The problem

I have a E3 Vitocal heatpump. The integration includes a water heater control but it just shows the current temperature. It would be extremely helpful to set the target temperature, the viessmann API offers this possibility in the basic subscription. The setting is independent from any schedules.

heating.dhw.temperature.main

Shows the target temperature value of the domestic hot water (DHW). Also provides a command to set the target temperature

What version of Home Assistant Core has the issue?

2024.8.1

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

ViCare

Link to integration documentation on our website

https://www.home-assistant.io/integrations/vicare/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 1 month ago

Hey there @cfenner, mind taking a look at this issue as it has been labeled with an integration (vicare) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `vicare` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign vicare` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


vicare documentation vicare source (message by IssueLinks)

CFenner commented 1 month ago

Can you please provide a diagnostics file, my device does not have dhw.

ignazhabibi commented 1 month ago

Sure

config_entry-vicare-75a1bf8b35a4021701a1586831e619e6.json

I already tried the mentioned command with postman - I works as expected and sets the target temperature as wanted.

ignazhabibi commented 1 month ago

My use case is to increase target temp when enough solar energy is availably via an automation. Get this error when executing

set_temp
ignazhabibi commented 1 month ago
postman
CFenner commented 1 month ago

Can’t you use one time charge for that?

Nevertheless we can add this ability to the water heater.

ignazhabibi commented 1 month ago

One time charge only heats up to the target temp of 53. I want to increase the target temp to 60 and then use one time charge so that more solar energy is used.

ignazhabibi commented 1 month ago

Setting target temp does not heat up the water. It just sets the temp when scheduled heating or one time charge is running.

CFenner commented 1 month ago

Can you set it on the water heater entity? At least the set_temperature method is implemented. Do you have a dhw secondary temperature number entity?

ignazhabibi commented 1 month ago

Can't do anything on the water heater entity except of viewing the current water temp.

water_heater

I don't find a dhw secondary temp number entity. What is this? The Viessmann API docs does not mention this data point at all.

ignazhabibi commented 1 month ago
watrer_heater_entity
CFenner commented 1 month ago

Get this error when executing

What happens when you use a entity id instead?

ignazhabibi commented 1 month ago

This works!

CFenner commented 1 month ago
watrer_heater_entity

Just had the same issue for the Miele climate entity. When temperature is null you cannot change the temperature via the UI. Try to set the temperature via the developer tools and see of the ui changes. Note that this is probably overwritten after a short time (1min).

ignazhabibi commented 1 month ago

Tried it and it is like you said.

ignazhabibi commented 1 month ago

Thanks for helping so far!

CFenner commented 1 month ago

So, the current temperature is read using the heating.dhw.sensors.temperature.hotWaterStorage data point, which you don't have. Therefore temperature is null.

CFenner commented 1 month ago

Replay from Discord:

The docs don't state device_ids to be a valid target, just entity_id. https://www.home-assistant.io/integrations/water_heater/#action-water_heaterset_temperature

Not so nice, that the option is displayed though. So if you care, you could create a frontend issue.

ignazhabibi commented 1 month ago

OK regarding the frontend issue.

I have both data points available in postman and they all return the correct current temperature. But what's the difference between the current_temperature which is set correctly and the temperature which is set to null in the entity?

heating.dhw.sensors.temperature.hotWaterStorage is deprecated and will be removed 2024-09-15 (mentioned in api response)

ignazhabibi commented 1 month ago

heating.dhw.sensors.temperature.hotWaterStorage wil be replaced by heating.dhw.sensors.temperature.dhwCylinder which also returns the correct current temperature.

However, all you would need for getting the current temperature and the command for setting a target temperature is available in heating.dhw.temperature.main as mentioned initially.

CFenner commented 1 month ago

heating.dhw.sensors.temperature.hotWaterStorage is deprecated and will be removed 2024-09-15 (mentioned in api response)

This is very valuable!

Is heating.dhw.temperature.main the target temp value or the current value? I thought it would be the target temp.

CFenner commented 1 month ago

@ignazhabibi where did you see the deprecation notice? Can you share the result?

ignazhabibi commented 1 month ago

where did you see the deprecation notice? Can you share the result?

It is part of the response when calling the Viessmann API (I used Postman for a quick check):

{ "feature": "heating.dhw.sensors.temperature.hotWaterStorage", ... "deprecated": { "removalDate": "2024-09-15", "info": "replaced by heating.dhw.sensors.temperature.dhwCylinder" } }

CFenner commented 1 month ago

But is seems not to be in the diagnostic file, that uses the .../<deviceID>/features url, right?

ignazhabibi commented 1 month ago

Is heating.dhw.temperature.main the target temp value or the current value? I thought it would be the target temp.

You are right, my mistake. This is the target temp indeed.

However, I figured out what happened in my case. I have only two small timeframes when hot water is scheduled: From 2:00 -3:00 and from 13:00 - 15:00. When the integration calls getDomesticHotWaterDesiredTemperature() from PyViCare there is a check which mode is active and when no mode is active it returns None which leads to temperature Null in the entity. When I am within of one of my timeframes, the correct target temp value is delivered. However, the setting of the target temp in the official Vicare app does not belong to a phase or mode, it is globally available and can be set independent (at least for E3 devices). So for E3 devices, from PyViCare the getDomesticHotWaterConfiguredTemperature method should be called directly (no check of active mode).

CFenner commented 1 month ago

We already have a number entity for target temp 2 (some boilers have two target ranges). I can duplicate that for temp(1) as well. Then you would have a separate entity.

CFenner commented 1 month ago

https://github.com/home-assistant/core/pull/123633

Can you verify if this works and fit's your needs?

ignazhabibi commented 1 month ago

Mmh, a new entity is nice, but would it fix the problem that the target temp is not settable via the water heater UI?

From my point of view there are two problems:

ignazhabibi commented 1 month ago

But is seems not to be in the diagnostic file, that uses the .../<deviceID>/features url, right?

It is in the diagnostic file, see line 1026

CFenner commented 1 month ago

The water heater UI is only able to set a target temp when I am in an active mode (my two short timeframes). Otherwise the temperature attribute is null which leads to this problem. The temperature attribute of the water heater should be set using getDomesticHotWaterConfiguredTemperature instead of getDomesticHotWaterDesiredTemperature() for E3 devices (I don't know how other Viessmann devices which are not using E3 behave). For E3 the target temp is globally available and does not belong to a specific mode.

For the climate entity it is similar, the target temp changes based on the selected program. This is, if one does not know about that fact, a bit weird, as the value can change depending on the time. I think it is fair to only be able to change the temp via the water heater if it is active. Also I do not know the impact if we change the behavior. The number entity should also have an action to change its value by automation.

ignazhabibi commented 1 month ago

OK, to avoid side effects this is probably the best. The new entity would be cool anyway. Think this issue can be closed then.

CFenner commented 1 month ago

@home-assistant close

CFenner commented 1 month ago

I have a E3 Vitocal heatpump.

@ignazhabibi what is the exact model?

ignazhabibi commented 1 month ago

what is the exact model?

Vitocal 250-A

ignazhabibi commented 1 month ago

@CFenner Would it be possible to also add:

heating.dhw.temperature.hysteresis Shows the hysteresis value of the Domestic Hot Water temperature in heat pumps. Also provides the command to set it

Most wanted feature in Viessmann community for the original ViCare App.