In this case the sensor.nursery_temperature is a z-wave sensor sitting in a corner of our nursery. Each of the switches is actually a switch template that calls some Broadlink RF codes to turn my Dyson device onto heat or cool. I can paste more of the templating if that would be helpful as well.
Thanks for sharing and thanks for the dualmode_generic component.
My “heater” and “cooler” is the same unit and it´s not just on/off to have it working nicely.
It sits in a small entry where the temperature gets to hot and to cold so the internal sensor stops it from heating or cooling when the small entry reaches the set target temperature.
I figured if I raise the target temperature with approx. 6°C on a cloudy day (lets say from 22 to 28) I get a nice 22°C around the rest of the house.
This works until the sun decides to show up and in this case the house gets way to hot so I needed a way to use an external sensor with some logic to control the set temperature.
This package is what I ended up doing and it´s still far from perfect since it does not cover all events that can happen but It works for now.
The climate.daikin is my “fake” heater exposed to google and climate.daikinxrh30 is the real heater.
I share for now if anybody else is interested and I will update if I make some changes in the future.
I know there are probably some amateur errors and this can for sure be done in a much cleaner way but here it comes:
Hello @zacs, thanks for the good work, I really like this auto option, it should be part of the generic thermostat I think…
I looked at your code to check if the Away Mode was an option, and I found that: Removed PRESET_AWAY as I don't need it, may reimplement it later
Still a chance to get this option back one day? That’s the only option I’m missing.
Thanks!
Sorry for not seeing this earlier, but away_temp is definitely supported in the component. If you want to try it out, let me know if you run into issues!
To use it just add away_temp as one of the config variables when you ad the component.
Awesome work, thanks. I already set up to control my server room temperature via a Broadlink RM4 mini and a portable AC/Heater.
This thing has a remote control with temperature settings, and I grabbed all the IR codes for all temperature levels and all fan speeds for heating and cooling.
Would it be somehow possible to map the different temperature codes within the thermostat, and getting more fine grained temperature control? I mapped some temperature values to switches like this:
But obviously I am able to map only one switch to the “cool” and “heat” functions so if the temperature set on the unit is too high, under certain circumstances the result will not be the expected. Am I missing something, or is that not possible?
The notion of multiple heaters/coolers is not supported. However, the logic of the entity should lend itself to just using the most powerful switch. It’s going to run until it hits the setpoint either way, the only difference in using the 20C vs 24C is probably efficiency, I would think. If you’re never making the setpoint lower than 24C though, you can of course use that switch.
To give you an example, when I used this with a Dyson heater and a Broadlink, I sent IR codes that made the heater go to 80 or 90 degrees when the heater “turned on,” because I honestly didn’t care. I knew that the component would turn the heater off as soon as it got the set point (which was obviously below 80 degrees).
Thanks, now I found something else. If I change the configuration of the thermostat and hit reload on Dualmode_generic (under YAML configuration reload) it breaks, and comes back only after a HA restart. I’m trying to find out why the AC is not switched off when the target temperature is below the threshold value (with more than 0.5 C). If I set the thermostat to Off, the AC shuts down, but seems to stay on forever with just being in AC mode.
2021-07-29 10:26:42 INFO (MainThread) [homeassistant.components.climate] Setting up climate.dualmode_generic
2021-07-29 10:26:42 ERROR (MainThread) [homeassistant.components.climate] Error adding entities for domain climate with platform dualmode_generic
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 383, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 588, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 665, in add_to_platform_finish
await self.async_added_to_hass()
File "/config/custom_components/dualmode_generic/climate.py", line 390, in async_added_to_hass
_async_startup()
TypeError: _async_startup() missing 1 required positional argument: 'event'
2021-07-29 10:26:42 ERROR (MainThread) [homeassistant.components.climate] Error while setting up dualmode_generic platform for climate
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 258, in _async_setup_platform
await asyncio.gather(*pending)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 383, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 588, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 665, in add_to_platform_finish
await self.async_added_to_hass()
File "/config/custom_components/dualmode_generic/climate.py", line 390, in async_added_to_hass
_async_startup()
TypeError: _async_startup() missing 1 required positional argument: 'event'`
Should the thermostat survive a YAML reload, or is this expected?
I also had an issue on startup. Can someone help me?
Error doing job: Exception in callback DualModeGenericThermostat.async_added_to_hass.<locals>._async_startup(<Event homeassistant_start[L]>) at /config/custom_components/dualmode_generic/climate.py:382
Traceback (most recent call last):
File "/usr/local/lib/python3.9/asyncio/events.py", line 80, in _run
self._context.run(self._callback, *self._args)
File "/usr/src/homeassistant/homeassistant/core.py", line 835, in _onetime_listener
self._hass.async_run_job(listener, event)
File "/usr/src/homeassistant/homeassistant/core.py", line 452, in async_run_job
return self.async_run_hass_job(HassJob(target), *args)
File "/usr/src/homeassistant/homeassistant/core.py", line 433, in async_run_hass_job
hassjob.target(*args)
TypeError: _async_startup() takes 0 positional arguments but 1 was given
Looks like a related (but opposite) error to the one reported above. What version of HA are you running? I’m guessing the old code needs to be updated so that _async_startup behaves in a more modern way, but I haven’t looked at the docs. I have a test HA instance I can use to debug sometime in the next week or so.
@zacs I’ve been using your component for a little while, and I’m very happy with it. Thank you.
I’m having a problem I wonder if you can advise me on. For context, I’m dealing with a separate integration that crashes a lot, so I have to reboot Home Assistant on a fairly regular basis. Hopefully this will settle down soon, but…
When HASS reboots and loads the dualmode generic thermostat, I notice that it does not set the heater and cooler switches based on the current temperature state. I use input binary helpers as my on-off switches, which remember their state across reboots.
So for instance, if the heat was on when HASS crashed, but a few minutes pass before the reboot with the heat running, then the temperature might be above the heat set point at reboot. The heat switch doesn’t get set to off during restart and the heat keeps running, getting warmer and warmer. I wake up at 3 am with my bedroom at 90 degrees F.
I’ve considered some sort of automation to try to bump the thermostat up and down after restart to make sure it sets the heater switch to off, but I wonder if there is an initialize step in the thermostat that could set the switch to the correct state based on the current temperature.
Yah you definitely shouldn’t have to write an automation to deal with that. Does the switch ever correct itself (like a minute or five after reboot)?
I am considering taking a fresh fork of generic_thermostat and re-applying all the patches here. I originally forked it over two years ago, so I expect your issue may also be related to the async_startup item mentioned above.
I will of course post here if I am able to make the time to update it. Time is hard to come by these days .
Since the hot season i’m struggling with one parameter.
In the winter the away_temp is set to 18°C and the target temp to 22 In the summer the target temp is still ok with 22, but an higher away temp is expected, as in this configuration :
Before leaving the house the AC is off with a 21°C temp, and then leaving the AC is on as the away temp is 18°C !
I’m afraid I’ve not used the component for a few years now, so I won’t be any help. If you file an issue on Github, there are some very smart folks who take a look every now and then, and sometimes submit fixes. Cheers!
Hi man, I have a heat pump that only has two switches, one for ON/OFF and the other for Heat/Cool. I would need to find a way that allows me, through the thermostat, to change the mode using the dedicated switch and to turn on or off with the other in both modes.