jmcollin78 / versatile_thermostat

A full featured Thermostat for Home Assistant: presets, window, motion, presence and overpowering management
MIT License
327 stars 34 forks source link

Can't set standalone presets in HA 2024.04.3 #444

Closed chriske closed 7 months ago

chriske commented 7 months ago

I'm trying to: Set temperatures for not central managed thermostat.

image

As you can see, HA won't set it, because of a type issue. I tried with 23,0 and 23.0 but getting the same issue. Also tried to modify the values directly for the entities, but the issue is the same.

I installed your integration yesterday for 2024.04.2 and I was able to set presets for the central component. Today after the update I tried to create a new thermostat with it's own presets, but I run into this issue.

jmcollin78 commented 7 months ago

Hello @chriske ,

I will try with 2024.04.2 to see if something change. It keep you in touch. What is not normal in your screen copy, is that all temperature are empty. And because the error log says "NoneType" I guess you try to send an empty temperature on some Number entity.

Maybe you can try to put some value to all other temperature.

chriske commented 7 months ago

Hello @chriske ,

I will try with 2024.04.2 to see if something change. It keep you in touch. What is not normal in your screen copy, is that all temperature are empty. And because the error log says "NoneType" I guess you try to send an empty temperature on some Number entity.

Maybe you can try to put some value to all other temperature.

Hi! Thanks for the response! I tried to populate every input but I'm getting the same issue for every one.

jmcollin78 commented 7 months ago

Hello, I have tested with HA 2024.4.3 and all is working fine on my side. Something went wrong on your environment (all temperature are empty which is not possible). I suggest to check logs. There is surely some messages explaining what goes wrong.

I will close the issue because it is not a VTherm issue but please post the logs messages here when you have.

chriske commented 7 months ago

Hi there!

Thanks for checking!

Here are the logs when I try to set any temperature:

2024-04-16 18:30:38.074 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140282818477248] float() argument must be a string or a real number, not 'NoneType' Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 239, in handle_call_service response = await hass.services.async_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2543, in async_call response_data = await coro ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2580, in _execute_service return await target(service_call) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 971, in entity_service_call single_response = await _handle_entity_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1043, in _handle_entity_call result = await task ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/number/init.py", line 112, in async_set_value await entity.async_set_native_value(native_value) File "/config/custom_components/versatile_thermostat/number.py", line 462, in async_set_native_value old_value = float(self._attr_native_value) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: float() argument must be a string or a real number, not 'NoneType'

As far as I can see, the exception's origin is the number.py class

chriske commented 7 months ago

One more clue:

I tried to create a new VTherm, and now I choosed to not use the min and max temperatures from central config. Now my temperatures are populated and I can change them:

image

After this experiment, I changed my previously posted VTherm's settings to not copy the central temperatures and it started to work.

jmcollin78 commented 7 months ago

Ooooh this is a great news. What do you mean by " I choosed to not use the min and max temperatures from central config" ? Can you send me screen copy of how you do that (because it seems related to the issue) ?

I changed my previously posted VTherm's settings to not copy the central temperatures

Does that means that you uncheck this checkbox (in french sorry) ?

Capture d’écran 2024-04-17 à 08 15 40

chriske commented 7 months ago

Ooooh this is a great news. What do you mean by " I choosed to not use the min and max temperatures from central config" ? Can you send me screen copy of how you do that (because it seems related to the issue) ?

I changed my previously posted VTherm's settings to not copy the central temperatures

Does that means that you uncheck this checkbox (in french sorry) ?

Capture d’écran 2024-04-17 à 08 15 40

Exactly :) thanks!

jmcollin78 commented 7 months ago

And for the min/max what have you done ?

chriske commented 7 months ago

These are my settings for the central configuration:

image

jmcollin78 commented 7 months ago

This was not my question. You said, you have done something with the min and max temperature. For me they are defined here: Capture d’écran 2024-04-17 à 09 39 35

But maybe there is a misunderstanding somewhere.

chriske commented 7 months ago

Yes, it seems we misunderstood each other somewhere. So, I will summarize everything I have done:

First, I created a central configuration where I set up the outdoor thermometer, the minimum and maximum temperatures, and the step. To the presets created this way, I set the appropriate temperatures. After that, I made 2 VTherms, of the climate type, and set each to use the central configuration. These are working nicely. Following that, I created a third VTherm, for which I set that I wanted to define my own presets, but I left the "use additional central configuration" switch turned on in the underlyings menu. If the new VTherm is created this way, then I cannot set the temperatures for the presets, that’s when I get the above exception. If I turn off "use additional central configuration" afterwards, then I can set the temperatures in the presets created for the VTherm.

This is how it works: image

brunoleon commented 7 months ago

Hello,

I'm facing the same issue, and I did two videos to try to explain the behavior.

TLDR: if you do select "Use additional central main configuration" when creating a device, you won't be able to use device specific presets afterwards.

https://github.com/jmcollin78/versatile_thermostat/assets/2236444/b3e2c143-552a-46e8-80ee-ad3244689e54

https://github.com/jmcollin78/versatile_thermostat/assets/2236444/7dadf402-e40e-4fe9-a906-79dbf264a316

jmcollin78 commented 7 months ago

Thanks @brunoleon for the reproduction case. I will able to reproduce and to fix now !

jmcollin78 commented 7 months ago

https://github.com/jmcollin78/versatile_thermostat/releases/tag/6.2.3

chriske commented 7 months ago

Thank you for the fix and your support!