KartoffelToby / better_thermostat

This custom component for Home Assistant will add crucial features to your climate-controlling TRV (Thermostatic Radiator Valves) to save you the work of creating automations to make it smart. It combines a room-temperature sensor, window/door sensors, weather forecasts, or an ambient temperature probe to decide when it should call for heat and automatically calibrate your TRVs to fix the imprecise measurements taken in the radiator's vicinity.
https://better-thermostat.org
GNU Affero General Public License v3.0
847 stars 128 forks source link

Multiple temperature sensors for one climate.entity (Air conditioning) #1375

Closed tamet83 closed 3 months ago

tamet83 commented 3 months ago

What is the feature?

Would be useful have multiple temperature sensors to properly use air conditioning systems.

Description

In our home, we have a centralized air conditioning system consisting of a single internal motor that manages multiple air outlets in four rooms. The thermostat that detects the ambient temperature is placed in an area where there is no cold air outlet. I would like to use Better Thermostat by using the temperature sensors present in each room to obtain the average value to be used as a reference for the entity created with Better Thermostat in Home Assistant. However, I noticed that only one temperature sensor can be entered in the configuration settings. I tried to create one through the helpers that averaged the four sensors present in the house, but it is not recognized as a thermostat.

My proposals are as follows:

Allow the use of sensors created through the helper as a temperature sensor. Allow the entry of multiple temperature sensors in the settings and possibly provide the ability to use them by averaging or selecting the maximum/minimum.

Thanks in advance for any help.

Additional Information

penroseg commented 3 months ago

I worked around this by using a Group with only Temp sensors in it and it is recognised (and did the same for Door-Windows sensors). I am not 100% sure this is what you are trying to achieve but thought I'd mention it. image

And then I set the Group helper as Mean image

tamet83 commented 3 months ago

I did the same thing but seems not working. It doesn’t give me the grouped sensor as selectable option. I’ll try doing it again. Thanks anyway!

penroseg commented 3 months ago

Try putting just one sensor in the group at a time and ensure it is there and working before building up from there. It might also be worth checking in the States tab of Developer Tools that the underlying sensors are all showing as Temperature device class.

I tested there by adding an entity that was a different device class. When only devices with the Temperature device class are in the group the group shows a similar device class and is available to select in BT. If any entity in the group is a different device class the device class is removed from the grouped entity so it won't be available for selection.

This is what it looks like with just sensors with a Temperature device class included. image

This is with a different device class sensor added to the group image

tamet83 commented 3 months ago

IMG_0676 I have Aqara temperature sensor which gives temperature and humidity. I selected only the temp sensor but it didn’t work. It stands as measurement and I don’t know if it’s right. I’ll try again as you suggested! Thank you!

penroseg commented 3 months ago

Hmm. It seems to be missing the Device Class.

I have an Aqara Temp & Humidity sensor in there and below is what it shows. Mine is the square one (WSDCGQ11LM model) so not sure if the same as you have. Also, I am using Zigbee2MQTT as the controller so not sure if you are using the same or inbuilt ZHA (or even an Aqara hub). image

penroseg commented 3 months ago

You might be able to Customise the entity to include the Device Class. I used to do this in YAML. Most of this has moved to the UI (you can change the class of door/window sensor etc from there) but my Aqara temp ones don't give an option to change from the UI. All this is described here: https://www.home-assistant.io/docs/configuration/customizing-devices/

At the bottom of that you can see that there is still an option to use the Customize.yaml file which you might need to resort to. I had a quick look online and found this which is not exactly your issue but the fix/workaround may work for you. Check out post #5 from DavidFW1960. https://community.home-assistant.io/t/google-assistant-and-temperature-sensors/143912/5

I'd also include the Unit of Measure so would do something like the below with your own entity names.

sensor.aqara_temperature:
  friendly_name: "Aqara Temperature"
  device_class: temperature
  unit_of_measurement: "°C"

sensor.aqara_humidity:
  friendly_name: "Aqara Humidity"
  device_class: humidity
  unit_of_measurement: "%"
tamet83 commented 3 months ago

Hi,

thank you so much. I solved defining the device_class.