erikkastelec / hass-WEM-Portal

Custom component for retrieving sensor information from Weishaupt WEM Portal
MIT License
44 stars 10 forks source link

Request: Set WarmWaterTemperature #38

Closed iridium2001 closed 1 year ago

iridium2001 commented 1 year ago

Hi @erikkastelec,

is it possible to create an input / select option for the warm water temperature?

Best regards Ingo

This should be the value according to Postman:

"ParameterID": "NormalWW", "Name": "WW-Soll~temperatur Normal", "DataType": 3, "MinValue": 0.0, "MaxValue": 100.0, "DefaultValue": "500", "IsReadable": true, "IsWriteable": true, "EnumValues": null

erikkastelec commented 1 year ago

Will add this and let you know, so you can test it (I do not have any entities with DataType 3). Are the values really between 0 and 100? I am asking because default value is not in this range.

iridium2001 commented 1 year ago

Hi Erik, the values are in the range of 0-100, which is understandable as this is a water temperature (degrees celsius). If you are limiting somehow the input range in your code, 15-70 would be totally sufficient. No idea, why the portal states 500 as a default value. I'm happy to test it!

erikkastelec commented 1 year ago

I have added the functionality to dev branch, so you can test it when you have some time. Let me know if you need any instructions on how to set everything up using dev branch code.

iridium2001 commented 1 year ago

Hi @erikkastelec , I could finally test your changes today. Unfortunately, I don't see any [update see below] effect. The slider value updates after a few seconds, but when I change number.ww_soll_temperatur_normal, this does not have any impact in the heating itself (as confirmed on the device) or in the Wemportal. Are changes in Home Assistant supposed to be written instantaneously to the portal or synced together with update of the other values from the API? Is there something that I could try in the meantime?

UPDATE: I can successfully change the "Absenk" temperature. This works as expected. For the "Normal" temp, i would speculate from the updated timestamp of the value from Postman, that the Wemportal gets also some information, but does not take over the value. By the way: the values are only considered as integers in the heating and the portal. the 0,5 steps could be removed. They however should not be the reason for the update issue with the normal Temperature.

erikkastelec commented 1 year ago

When slider changes a call with the new value is made to WEM app (instantaneously). There is no indication if the value actually changed when you make a request, so currently you get the real value on the next update of other values. I should probably add an additional request after a few seconds to update only the changed value.

What is the default value for Absenk temperature? I am asking because it is possible that the value for normal temperature should be multiplied before sending. Can you try setting it to desired value multiplied by 10 (eg. if you want to set it to 50, send 500), to determine if this could be the issue?

iridium2001 commented 1 year ago

I don't get, what is different between the two values. Absenk looks exactly like the Normal Temperature. Via Postman i can also set the NormalWW without problem, using values like 40 (not 400). As the values are not considered with decimal unit in the portal, maybe their "default" is also not really meaningful and should rather read 50.0 instead of 500. Intesrestingly, the default seems to be a string and not a number.

        "ParameterID": "NormalWW",
        "Name": "WW-Soll~temperatur Normal",
        "DataType": 3,
        "MinValue": 0.0,
        "MaxValue": 100.0,
        "DefaultValue": "500",
        "IsReadable": true,
        "IsWriteable": true,
        "EnumValues": null
    },
    {
        "ParameterID": "AbsenkWW",
        "Name": "WW-Soll~temperatur Absenk",
        "DataType": 3,
        "MinValue": 0.0,
        "MaxValue": 100.0,
        "DefaultValue": "400",
        "IsReadable": true,
        "IsWriteable": true,
        "EnumValues": null
iridium2001 commented 1 year ago

Intererstingly, using Postman, I found that the value for Normal Temperature exists twice. The correct one (which is the one we need to change) is in "module 3", next to the "absenk" value. The other one is in "module 7" next to some non-writeable values for Pressure and power output. The Name is identical, but the ParameterID is different. I'd speculate that this value is the representation of the Wemportal main page, while the other ones are from the "Warmwater" subpage. As your input in HA carries the name and not the ID, maybe this is a hint to the problem. Could it be, that your write command is changing (or trying to change) theses values in module 7?

        "ParameterID": "WW-Solltemp",
        "Name": "WW-Soll~temperatur Normal",
        "DataType": 3,
        "MinValue": 30.0,
        "MaxValue": 75.0,
        "DefaultValue": "500",
        "IsReadable": true,
        "IsWriteable": true,
        "EnumValues": null
erikkastelec commented 1 year ago

Great catch! Will fix the naming/parameterID problem tomorrow and we can see if that helps.

iridium2001 commented 1 year ago

Hi Erik this sounds fantastic. Looking forward to the next version and always grateful for your efforts. I found one parameter which is interesting in the same context. It is called "Betriebsart WW" in the portal and located on the bottom of the Warm Water subpage. It should be writeable with true/false. Might be a great option to prevent production of hot water while nobody is at home. Unfortunately, I could not find this parameter with Postman. Any idea?

erikkastelec commented 1 year ago

Changed the naming to "ParameterID-Name", as both name and parameterID are not unique. Entities should be unique now.

They probably didn't add it to the app so it can't be accessed via the api/postman. You could probably make a switch in Home Assistant that lowers the hot water temperature.

iridium2001 commented 1 year ago

Works!! Thanks a lot, @erikkastelec! Just noted that the start of the integration in Home Assistant was very slow this time. I assume this has something to do with the other timeout issues?

erikkastelec commented 1 year ago

Great, will release a new version tomorrow.

It is likely related. I should probably look if it is possible to set up the component in the background, so it doesn't slow down everything else from starting up.