Giter Site home page Giter Site logo

swingerman / ha-dual-smart-thermostat Goto Github PK

View Code? Open in Web Editor NEW
95.0 4.0 15.0 357 KB

The `dual_smart_thermostat` is an enhaced verion of generic thermostat implemented in Home Assistant. It uses several sensors and dedicated switches connected to a heater and air conditioning under the hood.

Home Page: https://github.com/swingerman/ha-dual-thermostat

License: Apache License 2.0

Shell 0.41% Python 99.54% Dockerfile 0.04% JavaScript 0.01%
home-automation thermostat hacs

ha-dual-smart-thermostat's Introduction

Howdy!

Nice to see you!

visitors follow on Twitter

Full-stack web developer focusing on performance and optimization with 8 years of experience building web sites SPA's CMS from zero to production including DevOps, back end, and front end architecture. I love working with PHP, GO, Angular or React with a high focus on user reactive UI, microservices orchestrated by Kubernetes. Enjoying working on solutions that bring great value to people and are built on the latest technologies. Worked on mission-critical services that are used by millions of people. Communication and collaboration are key for my productivity and believe are important to progression, growth, and delivering valuable software. Optimization is my passion


Talking aobut personal stuff:

  • 😎 Β Working on the next big thing!
  • ❀️ Β love optimizing stuff
  • πŸ€– Β love to automate stuff
  • πŸ’¬ Β Let's talk about business

Languages

PHP GO JavaScript TypeScript SQL Flutter Python

Frameworks

React Angular Bootstrap

Technologies

AWS Docker Kubernetes Linux Node.js CPanel GCS Analytics Ads DNS


My GitHub stats


This week I spent my time on:

TypeScript   8 hrs 2 mins    β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–“   98.85 %
JSON         4 mins          β–’β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘   00.97 %
JavaScript   0 secs          β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘   00.18 %

ha-dual-smart-thermostat's People

Contributors

alvarocarrera avatar dancingcactus avatar dependabot[bot] avatar grantland avatar jwillemsen avatar lord-ne avatar nickrout avatar ollo69 avatar swingerman avatar vlebourl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ha-dual-smart-thermostat's Issues

Openings timeout not working

I have configured the openings like this:

  openings:
    - entity_id: binary_sensor.bedroom_door
      timeout: 00:00:59
    - entity_id: binary_sensor.terrace_door
      timeout: 00:00:59
    - entity_id: binary_sensor.terrace_window
      timeout: 00:00:59

However as soon as I open one of the doors/windows the AC is turned off (there may be a delay of a few seconds but that is probably a delay of the sensor reading itself). The delay of 59 seconds is not taken into account.
Have I configured it wrong or is this a bug?

Define custom presets

I don't know if it's possible but it would be great if we can define custom presets. For example the generic_thermostat has activity_temp and the activity preset shows in the Lovelace climate cards as a choice, but dual-smart-thermostat doesn't have that preset. So it would be great to define a custom name preset for example like this:

activity:
    temperature: 26.7

or

some_descriptive_preset:
    temperature: 26.7

This will allow to easily switch the temperature between descriptively name presets
Thank you

"hot_tolerance" not woking as expected when in heat_cool mode

Hi,

I've discovered an issue when setting the thermostat in heat_cool mode.
A bit of context first. Until now I've been using ha-dual-smart-thermostat for a room where there's only a heater without issue. I've configured it to reach 20ΒΊC with both "hot_tolerance" and "cold_tolerance" set to 0.3. (full config below). It's been woking as expected, when temperature falls below 19.7ΒΊC the heater starts and when it reaches 20.3 the heater stops, see the graph:
image

Seeing it is working perfectly I'm in the process of implementing it on other rooms in my home using the advantage of heat_cool mode for an HVAC appliance. The issue I've encountered is that this behaviour is not the same. I've configured other thermostat with "target_temp_low: 21" for winter and "target_temp_high: 24" for summer with hot and cold tolerance set to 0.3 as before. My idea is that the thermostat brings online the heater when the temperature is below 20.7ΒΊC and shut it off when temp is above 21.3ΒΊC and the AC should switch on when temp reaches 24.3ΒΊC and shut off when it falls below 23.7ΒΊC. The problem is that the thermostat is not doing that. I've not been able to test the "summer" setting yet but in "winter" setting the thermostat seems to be activating the heater when temp is below 20.7ΒΊC but it shuts the heater off on the next cycle of the temp sensor, at around 20.9ΒΊC. My guess is that tolerances are not working properly. See the screenshot(I configured the thermostat around 14:30)
image

I've been having a look to the code and I think I've find at least part of the problem. (I'm no developer and last time I wrote code was in college in C++ so take this with a grain of salt ;) ). What I found is that tolerances for heat_cool mode are checked on lines 877 and 878 on climate.py using "target_temp_low" and "target_temp_high" as argument but when in heat mode are checked w/o argument, thus checking the same value. I believe on heat_cool mode the heating or cooling mode should be taken into account maybe something like this:
if self._is_heater_active:
too_cold = self._is_too_cold("_target_temp_low")
too_hot = self._is_too_hot("_target_temp_low")
elif self._is_cooler_active:
too_cold = self._is_too_cold("_target_temp_high")
too_hot = self._is_too_hot("_target_temp_high")
else:
too_cold = self._is_too_cold("_target_temp_low")
too_hot = self._is_too_hot("_target_temp_high")

I'm attaching my config for both thermostats so hopefully you can reproduce the issue:

  • platform: dual_smart_thermostat
    name: termostato_dormitorio
    heater: switch.radiador_dormitorio
    target_sensor: sensor.sensor_dormitorio_temperature
    openings:

    • binary_sensor.ventana_de_la_escalera_contact
    • binary_sensor.puerta_de_casa_contact
      target_temp: 20
      cold_tolerance: 0.3
      hot_tolerance: 0.3
      min_cycle_duration:
      seconds: 30
      initial_hvac_mode: heat
      away:
      temperature: 15
      home:
      temperature: 17
      comfort:
      temperature: 20
  • platform: dual_smart_thermostat
    name: termostato_salon
    heater: switch.calefaccion_salon
    cooler: switch.refrigeracion_salon
    target_sensor: sensor.sensor_salon_temperature
    openings:

    • binary_sensor.ventana_de_la_escalera_contact
    • binary_sensor.puerta_de_casa_contact
      heat_cool_mode: true
      target_temp_low: 17
      target_temp_high: 27
      cold_tolerance: 0.3
      hot_tolerance: 0.3
      min_cycle_duration:
      minutes: 10
      initial_hvac_mode: heat_cool
      away:
      target_temp_low: 15
      target_temp_high: 30
      home:
      target_temp_low: 17
      target_temp_high: 27
      comfort:
      target_temp_low: 21
      target_temp_high: 24

Feature request: dehumidifier mode

I use thermostat controls to control humidity instead of temperature, e.g. where the sensor entity is a humidity sensor, and the switch entities are a humidifier and a dehumidifier.

image

This all works perfectly with the existing logic. However it would be really nice if there could be an humidifier_mode: true setting that would have the following purely cosmetic changes:

  • Display the unit of measure as "%", (i.e. Percent Humidity)
  • Show "Humidifying"/"Dehumidifying" instead of "Heating"/"Cooling"
  • Show a relevant icon (e.g. mdi:water-percent) instead of the snowflake/flame.

Temperature not showing up on thermostat

I have set up a number of thermostats in configuration.yaml, as follows. They all appear in my dashboard correctly. I have a number of temperature sensors, appropriately named, configured using mqtt-io running on raspberry pi devices.

However, having seen temperatures for each of the sensors I have so far installed (lounge, studio and family) appearing in their related thermostat individually, I am only seeing one temperature at present on themostats on my dashboard.

MQTT Explorer shows valid messages being received. Also, when I check the HA entities I can see the correct values are being received.

Any ideas why this might be happening?

UPDATE: A few hours and a restart later only the Family Room temp is showing, although all three of the installed thermostats are generating data which can be seen by HA.

climate:

  • platform: dual_smart_thermostat
    name: Study
    heater: switch.study_heater
    cooler: switch.study_cooler
    target_sensor: sensor.study_temperature
    min_temp: 6
    max_temp: 30
    ac_mode: false
    target_temp: 17
    target_temp_high: 26
    target_temp_low: 23
    cold_tolerance: 0.3
    hot_tolerance: 0
    min_cycle_duration:
    seconds: 5
    keep_alive:
    minutes: 3
    initial_hvac_mode: "heat_cool" # hvac mode will reset to this value after restart
    away: # this preset will be available for all hvac modes
    temperature: 13
    target_temp_low: 12
    target_temp_high: 14
    home: # this preset will be available only for heat or cool hvac mode
    temperature: 21
    comfort:
    temperature: 18
    precision: 0.1
    target_temp_step: 0.5
  • platform: dual_smart_thermostat
    name: Bed 1
    heater: switch.bed1_heater
    cooler: switch.bed1_cooler
    target_sensor: sensor.bed1_temperature
    min_temp: 6
    max_temp: 30
    ac_mode: false
    target_temp: 17
    target_temp_high: 26
    target_temp_low: 23
    cold_tolerance: 0.3
    hot_tolerance: 0
    min_cycle_duration:
    seconds: 5
    keep_alive:
    minutes: 3
    initial_hvac_mode: "heat_cool" # hvac mode will reset to this value after restart
    away: # this preset will be available for all hvac modes
    temperature: 13
    target_temp_low: 12
    target_temp_high: 14
    home: # this preset will be available only for heat or cool hvac mode
    temperature: 21
    comfort:
    temperature: 18
    precision: 0.1
    target_temp_step: 0.5
  • platform: dual_smart_thermostat
    name: Bed 2
    heater: switch.bed2_heater
    cooler: switch.bed2_cooler
    target_sensor: sensor.bed2_temperature
    min_temp: 6
    max_temp: 30
    ac_mode: false
    target_temp: 17
    target_temp_high: 26
    target_temp_low: 23
    cold_tolerance: 0.3
    hot_tolerance: 0
    min_cycle_duration:
    seconds: 5
    keep_alive:
    minutes: 3
    initial_hvac_mode: "heat_cool" # hvac mode will reset to this value after restart
    away: # this preset will be available for all hvac modes
    temperature: 13
    target_temp_low: 12
    target_temp_high: 14
    home: # this preset will be available only for heat or cool hvac mode
    temperature: 21
    comfort:
    temperature: 18
    precision: 0.1
    target_temp_step: 0.5
  • platform: dual_smart_thermostat
    name: Bed 3
    heater: switch.bed3_heater
    cooler: switch.bed3_cooler
    target_sensor: sensor.bed3_temperature
    min_temp: 10
    max_temp: 28
    ac_mode: false
    target_temp: 17
    target_temp_high: 26
    target_temp_low: 23
    cold_tolerance: 0.3
    hot_tolerance: 0
    min_cycle_duration:
    seconds: 5
    keep_alive:
    minutes: 3
    initial_hvac_mode: "heat_cool" # hvac mode will reset to this value after restart
    away: # this preset will be available for all hvac modes
    temperature: 13
    target_temp_low: 12
    target_temp_high: 14
    home: # this preset will be available only for heat or cool hvac mode
    temperature: 21
    comfort:
    temperature: 18
    precision: 0.1
    target_temp_step: 0.5
  • platform: dual_smart_thermostat
    name: Bed 4
    heater: switch.bed4_heater
    cooler: switch.bed4_cooler
    target_sensor: sensor.bed4_temperature
    min_temp: 6
    max_temp: 30
    ac_mode: false
    target_temp: 17
    target_temp_high: 26
    target_temp_low: 23
    cold_tolerance: 0.3
    hot_tolerance: 0
    min_cycle_duration:
    seconds: 5
    keep_alive:
    minutes: 3
    initial_hvac_mode: "heat_cool" # hvac mode will reset to this value after restart
    away: # this preset will be available for all hvac modes
    temperature: 13
    target_temp_low: 12
    target_temp_high: 14
    home: # this preset will be available only for heat or cool hvac mode
    temperature: 21
    comfort:
    temperature: 18
    precision: 0.1
    target_temp_step: 0.5
  • platform: dual_smart_thermostat
    name: Family Room
    heater: switch.family_heater
    cooler: switch.family_cooler
    target_sensor: sensor.family_temperature
    min_temp: 10
    max_temp: 28
    ac_mode: false
    target_temp: 17
    target_temp_high: 26
    target_temp_low: 23
    cold_tolerance: 0.3
    hot_tolerance: 0
    min_cycle_duration:
    seconds: 5
    keep_alive:
    minutes: 3
    initial_hvac_mode: "heat_cool" # hvac mode will reset to this value after restart
    away: # this preset will be available for all hvac modes
    temperature: 13
    target_temp_low: 12
    target_temp_high: 14
    home: # this preset will be available only for heat or cool hvac mode
    temperature: 21
    comfort:
    temperature: 18
    precision: 0.1
    target_temp_step: 0.5
  • platform: dual_smart_thermostat
    name: Office
    heater: switch.office_heater
    cooler: switch.office_cooler
    target_sensor: sensor.office_temperature
    min_temp: 6
    max_temp: 30
    ac_mode: false
    target_temp: 17
    target_temp_high: 26
    target_temp_low: 23
    cold_tolerance: 0.3
    hot_tolerance: 0
    min_cycle_duration:
    seconds: 5
    keep_alive:
    minutes: 3
    initial_hvac_mode: "heat_cool" # hvac mode will reset to this value after restart
    away: # this preset will be available for all hvac modes
    temperature: 13
    target_temp_low: 12
    target_temp_high: 14
    home: # this preset will be available only for heat or cool hvac mode
    temperature: 21
    comfort:
    temperature: 18
    precision: 0.1
    target_temp_step: 0.5
  • platform: dual_smart_thermostat
    name: Studio
    heater: switch.studio_heater
    cooler: switch.studio_cooler
    target_sensor: sensor.studio_temperature
    min_temp: 6
    max_temp: 30
    ac_mode: false
    target_temp: 17
    target_temp_high: 26
    target_temp_low: 23
    cold_tolerance: 0.3
    hot_tolerance: 0
    min_cycle_duration:
    seconds: 5
    keep_alive:
    minutes: 3
    initial_hvac_mode: "heat_cool" # hvac mode will reset to this value after restart
    away: # this preset will be available for all hvac modes
    temperature: 13
    target_temp_low: 12
    target_temp_high: 14
    home: # this preset will be available only for heat or cool hvac mode
    temperature: 21
    comfort:
    temperature: 18
    precision: 0.1
    target_temp_step: 0.5
  • platform: dual_smart_thermostat
    name: Lounge
    heater: switch.lounge_heater
    cooler: switch.lounge_cooler
    target_sensor: sensor.lounge_temperature
    min_temp: 6
    max_temp: 30
    ac_mode: false
    target_temp: 17
    target_temp_high: 26
    target_temp_low: 23
    cold_tolerance: 0.3
    hot_tolerance: 0
    min_cycle_duration:
    seconds: 5
    keep_alive:
    minutes: 3
    initial_hvac_mode: "heat_cool" # hvac mode will reset to this value after restart
    away: # this preset will be available for all hvac modes
    temperature: 13
    target_temp_low: 12
    target_temp_high: 14
    home: # this preset will be available only for heat or cool hvac mode
    temperature: 21
    comfort:
    temperature: 18
    precision: 0.1
    target_temp_step: 0.5

At the current time, I am seeing a temp from a device which is not running, while others that are running are not showing!

image

Dual termostat heat and cool with only one switch

Hello,m i have aeroterm machine, with radian floor, I have a solenoid valve and a thermometer in each room. I config a dual termostac for each room, but only can change from off to heat mode, because y only have one switch for heat and cold, is the same switch.

Is it possible to configure hot and cold mode with a single switch?

or i hve to config one termostac to cool mode and another to heat mode.

thanks

Unable to set temperature using lovelace or scheduler component

I have been using the Dual Smart Thermostat since a few months ago and I really love it. Recently I noticed something changed but I haven't been able to figure out what the problem is.

I have been using the custom scheduler component to set different temperatures at different times. It was working fine, but now I am not able to set temperature, only to choose the mode. I am not sure if it is a problem of the Dual Smart Thermostat component or the scheduler component to be honest, or even if it was a change on Home Assistant which made start showing this behaviour.

However, I also have found that if I don't set target_temp_low or target_temp_high in the config, I cannot make any changes on the temperatures later on using lovelace.

I tried installing previous versions of this component and the scheduler component as well, but the issue still remained, so I'm guessing that there may be a change within Home Assistant that now changed the behaviour of one of these components.

Feature request: target_sensor not only sensor entity

I'm planning to use this as an extension to a less capable physical thermostat (heat only)
But as the dual_smart_thermostat need the target_sensor to be a thermometer with state as temp I have to go the way around to create a template sensor to extract the actual temperature from my climate entity.
Would like to either allow climate entities as target_sensor, or that you can specify any input formula you want.
E.g. target_sensor: "{{ state_attr('climate.thermostat_hallway', 'current_temperature') }}"

Developer tools - YAML configuration reloading makes current temperature "n/a"

Hello,

my installation is:

Home Assistant 2022.11.4
Supervisor 2022.10.2
Operating System 9.0
Frontend 20221108.0 - latest
-
Home Assistant Dual Smart Thermostat component v0.7.1

This is my config:

climate:
  - platform: dual_smart_thermostat
    name: Test Fake Thermostat
    heater: switch.fake_thermostat_switch
    cooler: switch.fake_thermostat_switch
    target_sensor: sensor.sonoff_zb_temp1_temperature
    openings:
      - binary_sensor.sonoff_zb_ds2_ias_zone
    min_temp: 10
    max_temp: 28
    ac_mode: false
    target_temp: 20
    target_temp_high: 26
    target_temp_low: 19
    cold_tolerance: 0.3
    hot_tolerance: 0
    min_cycle_duration:
      seconds: 5
    keep_alive:
      minutes: 3
    initial_hvac_mode: "off" # hvac mode will reset to this value after restart
    away: # this preset will be available for all hvac modes
      temperature: 15
      target_temp_low: 14
      target_temp_high: 16
    home: # this preset will be available only for heat or cool hvac mode
      temperature: 21
    precision: 0.1
    target_temp_step: 0.5

After reloading the component via "Developer tools - YAML configuration reloading - DUAL_SMART_THERMOSTAT", the current temp becomes n/a.

What fixes this:

  • completely restarting HA,
  • an update of temperature sensor.

Request: Added features and extra planning on device logevity

First, thanks for the awesome work! I have been working to get to the point that I could use something like this and the card works well.

I use smart outlets that have kWh and Watt monitoring and I can display that as a prat of the "Simple Thermostat" card that I use. In order to increase the life-span of the AC unit, I previously setup automations that watch for a given temp and if it is after a certain time and if the AC compressor is not running as the wattage value is between 20-60w of power use. This will make sure that the compressor works more efficiently and will last longer in the unit.

I suggest adding a way to monitor the plugs wattage consumption to see if the power meets a window of 20-60w and then allow the switch to turn off. If this can already be done in a different manner, I am not sure how to do it.

Another feature that would be good is if the "off" button is pressed or the mode is set to "off", it should turn off the switch/s that are being used on the thermostat to control the AC/heat. I tried this a couple of times last night and it would only turn off the switch if the temperature conditions were met.
image

Feature request: fan mode

It is possible to add fan hvac mode? It will be nice to have if someone have air condition with fan option.

Power consumtion is not working

Carrier Wi-Fi Smart AC has sensor.[climate_name]_total_energy_consumption and sensor.[climate_name]_realtime_power but no one is retrieving the real data

image

Can I use this with thermostats instead of switches?

I'm assuming that ha-dual-smart-thermostat directly starts the heater and cooler.

I'm wondering if it could control thermostats for the heaters and coolers.

My use case is that I would like the AC to start when it's hot and the heat to start when it's cold, but not have them fight each others.

Minimum cycle time

So I have both generic smart thermostats and dual smart thermostats and the minimum_cycle_time is not working on any of them my config for them all looks the same, any idea what I have done wrong?

climate:

  • platform: dual_smart_thermostat
    name: Left Fridge
    heater: switch.left_fridge_heat
    cooler: switch.left_fridge_cool
    target_sensor: sensor.left_fridge_temperature
    min_temp: 0
    max_temp: 40
    target_temp: 20
    target_temp_high: 24
    target_temp_low: 18
    cold_tolerance: 0.3
    hot_tolerance: 0.3
    min_cycle_duration:
    minutes: 5
    away_temp: 16
    keep_alive:
    minutes: 1
    precision: 0.1

Error in getting auto mode to work, seems to only work in either heat, or cool mode

Anytime I try to set the thermostat to auto to control both my AC unit and my heater is throws out an error:

Oct 18 02:08:44 1119n-ha-001 homeassistant[872]: #033[31m2022-10-17 22:08:44.566 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [2625121392] '>=' not supported between instances of 'NoneType' and 'float'
Oct 18 02:08:44 1119n-ha-001 homeassistant[872]: Traceback (most recent call last):
Oct 18 02:08:44 1119n-ha-001 homeassistant[872]:   File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 202, in handle_call_service
Oct 18 02:08:44 1119n-ha-001 homeassistant[872]:     await hass.services.async_call(
Oct 18 02:08:44 1119n-ha-001 homeassistant[872]:   File "/usr/src/homeassistant/homeassistant/core.py", line 1738, in async_call
Oct 18 02:08:44 1119n-ha-001 homeassistant[872]:     task.result()
Oct 18 02:08:44 1119n-ha-001 homeassistant[872]:   File "/usr/src/homeassistant/homeassistant/core.py", line 1775, in _execute_service
Oct 18 02:08:44 1119n-ha-001 homeassistant[872]:     await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
Oct 18 02:08:44 1119n-ha-001 homeassistant[872]:   File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 207, in handle_service
Oct 18 02:08:44 1119n-ha-001 homeassistant[872]:     await service.entity_service_call(
Oct 18 02:08:44 1119n-ha-001 homeassistant[872]:   File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 678, in entity_service_call
Oct 18 02:08:44 1119n-ha-001 homeassistant[872]:     future.result()  # pop exception if have
Oct 18 02:08:44 1119n-ha-001 homeassistant[872]:   File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 931, in async_request_call
Oct 18 02:08:44 1119n-ha-001 homeassistant[872]:     await coro
Oct 18 02:08:44 1119n-ha-001 homeassistant[872]:   File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 715, in _handle_entity_call
Oct 18 02:08:44 1119n-ha-001 homeassistant[872]:     await result
Oct 18 02:08:44 1119n-ha-001 homeassistant[872]:   File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 613, in async_service_temperature_set
Oct 18 02:08:44 1119n-ha-001 homeassistant[872]:     await entity.async_set_temperature(**kwargs)
Oct 18 02:08:44 1119n-ha-001 homeassistant[872]:   File "/config/custom_components/dual_smart_thermostat/climate.py", line 589, in async_set_temperature
Oct 18 02:08:44 1119n-ha-001 homeassistant[872]:     await self._async_control_climate()
Oct 18 02:08:44 1119n-ha-001 homeassistant[872]:   File "/config/custom_components/dual_smart_thermostat/climate.py", line 662, in _async_control_climate
Oct 18 02:08:44 1119n-ha-001 homeassistant[872]:     await self._async_control_heat_cool(time, force)
Oct 18 02:08:44 1119n-ha-001 homeassistant[872]:   File "/config/custom_components/dual_smart_thermostat/climate.py", line 793, in _async_control_heat_cool
Oct 18 02:08:44 1119n-ha-001 homeassistant[872]:     too_cold = self._is_too_cold("_target_temp_low")
Oct 18 02:08:44 1119n-ha-001 homeassistant[872]:   File "/config/custom_components/dual_smart_thermostat/climate.py", line 988, in _is_too_cold
Oct 18 02:08:44 1119n-ha-001 homeassistant[872]:     return target_temp >= self._cur_temp + self._cold_tolerance
Oct 18 02:08:44 1119n-ha-001 homeassistant[872]: TypeError: '>=' not supported between instances of 'NoneType' and 'float'#033[0m

And here is my config that I'm using to try to drive it:

climate:
  - platform: dual_smart_thermostat
    unique_id: "c135dffc-8fae-4ef0-b3f8-0aa2c1af8c2f"
    name: Bedroom Thermostat
    ac_mode: false
    cooler: input_boolean.input_boolean_bedroom_fan
    heater: input_boolean.input_boolean_bedroom_convector
    target_sensor: sensor.bedroom
    target_temp: 72
    initial_hvac_mode: "heat_cool"
    min_cycle_duration:
      seconds: 5
    cold_tolerance: 0.3
    hot_tolerance: 0.3
    min_temp: 40
    max_temp: 85
    comfort_temp: 72

Any help would be MUCH appreciated... this is exactly the dual mode type of thermostat I need with separate heating and cooling units!

Tolerance / precision behavior seems wrong

In heating mode, if I have the tolerance set to 1F and the precision to 0.1F, and the setpoint to 68F, it turns on at 66.9F, but turns off right away when it gets to 67.1F. I would expect it to turn on at 66.9F, and turn off at 68F.

AC not being turned off after successfully being turned on

Hello,
Im controlling my Midea AC through an USB dongle with ESPHome, when I set the thermostat to cool it was able to turn on the AC.

Living room AC changed to Heat/Cool triggered by service Home Assistant Core Integration: Generic turn on

Unfortunately it doesn't seems to be able to switch it off after I set the target temp lower the current temp or change the thermostat mode to off. Is this a bug or AC's are not being supported?

Error setting up dual_smart_thermostat at boot

Hi!

The integration is working perfectly, but at boot I have this error logged by home assistant:

2022-04-07 10:40:35 ERROR (MainThread) [homeassistant.components.climate] Error while setting up dual_smart_thermostat platform for climate
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 257, in _async_setup_platform
    await asyncio.gather(*pending)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 382, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 614, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 798, in add_to_platform_finish
    await self.async_added_to_hass()
  File "/config/custom_components/dual_smart_thermostat/climate.py", line 272, in async_added_to_hass
    async_track_state_change_event(
  File "/usr/src/homeassistant/homeassistant/helpers/event.py", line 251, in async_track_state_change_event
    if not (entity_ids := _async_string_to_lower_list(entity_ids)):
  File "/usr/src/homeassistant/homeassistant/helpers/event.py", line 524, in _async_string_to_lower_list
    return [mstr.lower() for mstr in instr]
  File "/usr/src/homeassistant/homeassistant/helpers/event.py", line 524, in <listcomp>
    return [mstr.lower() for mstr in instr]
AttributeError: 'NoneType' object has no attribute 'lower'

Could it be due to the fact that some entities are not yet available (e.g. heater, target_sensor or openings)? Is thre any workaround?

Thanks!

sleep mode dont pass configuration.yaml.

i can define all modes:

away: # this preset will be available for all hvac modes
      temperature: 13
      target_temp_low: 12
      target_temp_high: 14
    home: # this preset will be available only for heat or cool hvac mode
      temperature: 21
    comfort:
      temperature: 22
    eco:
      temperature: 19
    away:
      temperature: 17
    #sleep:
    #  temperature: 19

but if configure sleep mode, HA show error for sleep mode.

min_cycle_duration not working

When setting min_cycle_duration to either seconds: 120 or minutes: 2 I get the same results with my cooling turning off/on every few seconds if the temperature is close to the setpoint.

Is there something I'm missing? I copied it straight from the example config and it still doesn't work as intended.

Switch gets randomly turned on and off

I'm trying to wrap my head around the behavior this component seems to take. Before is my config.
` platform: dual_smart_thermostat

name: Virtual Bedroom
heater: switch.bedroom_ac_heat
cooler: switch.bedroom_ac_cool
target_sensor: sensor.bedroom_temperature_sensor_temperature
min_temp: 55
max_temp: 80
ac_mode: false
target_temp: 68
target_temp_high: 73
target_temp_low: 68
cold_tolerance: 0.5
hot_tolerance: 0.5
min_cycle_duration:
  minutes: 2
initial_hvac_mode: "heat_cool"
away_temp: 60
precision: 0.1`

For some reason, despite the temperature being outside the target temp and tolerance, the component keeps turning the switch on and off repeatedly. See log of the switch.

Screenshot_20220401-153729_Home Assistant

Any ideas why this would be happening? Is it an issue with my config? What's weird to me is that it's toggling the switch faster than the minimal cycle duration. Any help would be greatly appreciated.

Invalid Config with 'heat_cool_mode'

Hello,

I have used this thermostat with heating an cooling for a few months and it had been great. I wanted to tweak some config settings and am having the following error when I try to introduce 'heat_cool_mode' in my configuration.yaml. I am hoping I can get some help with this; maybe my syntax is wrong or I am missing something.

Invalid config for [climate.dual_smart_thermostat]: [heat_cool_mode] is an invalid option for [climate.dual_smart_thermostat]. Check: climate.dual_smart_thermostat->heat_cool_mode. (See ?, line ?).

My config is as follows (I commented out some settings to reduce variables).

climate:                                                                                    # https://www.home-assistant.io/integrations/generic_thermostat
  - platform: dual_smart_thermostat
    name: Pool Hall Thermostat
    heater: switch.plug_e
    cooler: switch.plug_j_switch
    target_sensor: sensor.pool_hall_temperature
    heat_cool_mode: true
    #min_temp: 50
    #max_temp: 80
    #heat_cool_mode: true # @todo causes error?
    #target_temp_low: 50
    #target_temp_high: 80
    #min_cycle_duration:
    #  minutes: 10

I am using Home Assistant 2023.8.1 and Dual Thermostat 0.54.5.

Thanks!
Nick

How to set time for openings in v0.9.0?

Good news of the new feature on 0.9.0 to set a time for openings, however I check the full configuration example and still have no idea of how to set this open time value.

Could you please suggest? Thanks a lot!

Improvements
feat: open time for openings by @swingerman in #60
You can now define a timeout for each opening by @swingerman in #61

Feature Request - open time for openings

It would be great if we could specify how long an opening is open before adjusting the thermostat.

For example, I have my back door as an opening and the ac will turn off when it's opened, but sometimes you're just opening it to go outside, not to leave it open. So instead of the ac turning on and off on and off it would be nice to set a time limit for how long the door needs to be open before any changes happen to the thermostat.

Two items heating

I have an underfloor system where I am opening a valve with your dual smart thermostat. I want also to switch at the same time the pump on. How can I add two (or more) items to the string?
Hope you can help me, thank you.

Example of what I have. I want to add switch.1_kinderkamer_cv3 to the heater:
climate:

  • platform: dual_smart_thermostat
    name: Zolder
    heater:
    switch.1_kinderkamer_cv4
    target_sensor:
    sensor.lumi_lumi_weather_0f08e207_temperature
    min_temp: 15
    max_temp: 22.5
    ac_mode: false
    target_temp: 19
    target_temp_high: 26
    target_temp_low: 23
    hot_tolerance: 0.5
    min_cycle_duration:
    seconds: 10
    keep_alive:
    minutes: 3
    initial_hvac_mode: "off"
    precision: 0.1

Feature Request: 2 stage heating

Hi, I have been looking for this for a while :) Would it be possible to add a second heater switch for a second stage with a different tolerance?

Thanks,
Eric

Only HVAC Mode is the initial set

Hi, loving this integration, finally met a need that I was trying to fix. Is it possible to select which HVAC mode the climate integration is on via the Lovelace? Using the developer tools, I can manually set the HVAC to any mode (off, cool, heat, heat_cool) but that option isn't available in Lovelace. See image below.

image

Is this something in the works? Is this a known bug I missed? Thanks in advance.

Heater entity turned on in `cool` hvac mode instead of cooler entity

For some reason, the heater entity is turned on when the thermostat is in cool mode. When in heat_cool mode, it correctly activates the cooler and heater entities. Also, the 'Cooling' and 'Heating' labels appear to be missing. 'Off' and 'Idle' are the only ones that show.

image
image

climate.yaml:

  name: Thermostat
  heater: input_boolean.fake_heat
  cooler: input_boolean.fake_ac
  target_sensor: input_number.fake_temp
  min_temp: 50
  max_temp: 80
  ac_mode: false
  # hot_tolerance: 0
  # cold_tolerance: 1
  target_temp: 70
  target_temp_low: 70
  target_temp_high: 75
  # min_cycle_duration:
  #   minutes: 5
  # initial_hvac_mode: "off"
  keep_alive:
    minutes: 1
  away_temp: 58

removing "target_temp_high" and/or "target_temp_low" from config removes "heat_cool" mode as well

If I have this config for my thermostat:

  - platform: dual_smart_thermostat
    name: Test Fake Thermostat
    heater: switch.fake_thermostat_switch_heat_gpio27
    cooler: switch.fake_thermostat_switch_cool_gpio27
    target_sensor: sensor.sonoff_zb_temp1_temperature
    # floor_sensor: sensor.floor_temp
    # max_floor_temp: 28
    openings:
      - binary_sensor.sonoff_zb_ds2_ias_zone
    min_temp: 10
    max_temp: 28
    ac_mode: false # this parameter will be ignored if cooler entity is defined.
    target_temp: 20 # If this variable is not set, it will retain the target temperature set before restart if available.
    target_temp_high: 21
    target_temp_low: 20
    cold_tolerance: 0.3
    hot_tolerance: 0
    min_cycle_duration:
      seconds: 1
    keep_alive:
      minutes: 3
    initial_hvac_mode: "heat_cool" # hvac mode will reset to this value after restart
    away: # this preset will be available for all hvac modes
      temperature: 15
      target_temp_low: 14
      target_temp_high: 16
    home: # this preset will be available only for heat or cool hvac mode
      temperature: 21
    precision: 0.1
    target_temp_step: 0.5

It has 4 hvac_modes:

hvac_modes: off, heat, cool, heat_cool
min_temp: 10
max_temp: 28
target_temp_step: 0.5
preset_modes: none, away
current_temperature: 22.9
hvac_action: idle
preset_mode: none
prev_target_temp_low: 20
prev_target_temp_high: 21
friendly_name: Test Fake Thermostat
supported_features: 18
target_temp_high: 21
target_temp_low: 20
prev_target_temp: 20

But if I remove any or all of these parameters:

    target_temp_high: 21
    target_temp_low: 20

then my thermostat loses heat_cool mode:

hvac_modes: off, heat, cool
min_temp: 10
max_temp: 28
target_temp_step: 0.5
preset_modes: none, away
current_temperature: 22.9
hvac_action: idle
preset_mode: none
friendly_name: Test Fake Thermostat
supported_features: 18
target_temp_high: 21
target_temp_low: 20
prev_target_temp_low: 20
prev_target_temp_high: 21
prev_target_temp: 20

Why is that?
I'd like it to keep heat_cool mode and not reset to config target temps, instead retaining the previous UI values - just what the config functionality claims to do.

preset mode being set on wrong entity

Hi - got a strange issue here. Looks like my preset modes are being set on the wrong entity. Notice how the "Dining Room" has two preset modes - and the boys room has none. I'm seeing this in other entities, too.
Screenshot 2023-10-17 at 9 44 37β€―AM

Here is the configuration for these two:

- platform: dual_smart_thermostat
  name: Boys Room
  heater: switch.boys_room_radiator
  cooler: switch.boys_room_air_conditioner
  target_sensor: sensor.boys_room_temperature_temperature
  min_cycle_duration: 60
  precision: .5
  min_temp: 20
  max_temp: 25
  heat_cool_mode: true
  away:
    temperature: 30
    target_temp_low: 50
    target_temp_high: 0

- platform: dual_smart_thermostat
  name: Dining Room
  heater: switch.dining_room_radiator
  target_sensor: sensor.dining_room_thermostat_temperature
  min_cycle_duration: 60
  precision: .5
  min_temp: 20
  max_temp: 25
  away:
    temperature: 15

Is this something on my end? Thanks!

Why is target temp step limited to less than or equal to 1?

Can't it be set to what you want?
I understand the normal usage of this integration is house/apartment heating but I'm using it for a BBQ and setting the temperature in 5 or 10 degrees makes more sense.
Is there any reason why this is hardcoded this way?

EDIT; I mean I use the thermostat to track the temperature inside the BBQ not in the meat

Heating mode not remembered

On restarting HA, the thermostat doesn't remember the last setting, unlike native generic thermostat device.

This leaves my heater/cooler running without limit, as the switch entities do remember their last state.

hvac_mode is "heat", but hvac_action shows "cooling"

  1. Issue: hvac_action incorrectly shows Cooling when in heat mode:

When hvac_mode is Cool, hvac_action is correctly displayed as Cooling.

  1. Another issue is when I increase the setpoint, the hvac_mode toggles between idle and cooling on every setpoint change:
    image

Same behaviour with Cool mode.

My setup is in #42.

Using AirConditioner as both heat and cold unit

I apologize for creating an issue. The discussion is not enabled for this GitHub project.

As the default air conditioner Auto HVAC mode is unable to read from external temperature sensors, I am in need of this great plugin. But I cannot figure out how I can use climate.ac_unit for both cooling if higher and heating if lower temperature than stated in the config, with setting the AC temperature. I would appreciate a config example for such usage.
Also, it would be great if this repository has an examples folder with the examples of config YAML files for different setups.
Thank you.

Preset not displayed on panel, disappears from popup when mode is selected

So I can't get the presets to work.
This is how my config looks:
- platform: dual_smart_thermostat initial_hvac_mode: "off" name: Kitchen heater: switch.hvac_w_heat cooler: switch.hvac_y_cool target_sensor: sensor.kitchen_temperature min_temp: 60 max_temp: 80 target_temp: 70 cold_tolerance: 1 hot_tolerance: 0 min_cycle_duration: seconds: 5 keep_alive: minutes: 10 away_temp: 65 eco_temp: 67 comfort_temp: 70 anti_freeze_temp: 60 precision: 1
When restarting HA, the card looks like that (no presets):
image

When opening the popup, the presets show up, but don't work:
image

As soon as I select heating, presets dissappear:
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.