🔥 Advanced Heating Control

Yes, thanks. Fixed it and tested by myself. Checkout the link again, please.

Strange… It still doesnt work. i double checked it with the link etc. but its the same behave as in my last reply. Logs:

Source: components/zha/core/channels/hvac.py:300 
First occurred: 08:53:35 (32 occurrences) 
Last logged: 20:55:29

Error executing service: <ServiceCall climate.set_temperature (c:01GVBNXET8C58Y37FKAN3CHWYP): entity_id=['climate.lumi_lumi_airrtc_agl001_thermostat_4'], temperature=20.0, hvac_mode=heat>
Error executing service: <ServiceCall climate.set_temperature (c:01GVBP5K4GK11W1YNCQTM3SF1V): entity_id=['climate.lumi_lumi_airrtc_agl001_thermostat_4'], temperature=20.0, hvac_mode=heat>
Error executing service: <ServiceCall climate.set_temperature (c:01GVBP7T4Z3226PHZ56TXANKVW): entity_id=['climate.lumi_lumi_airrtc_agl001_thermostat_4'], temperature=20.0, hvac_mode=heat>
Error executing service: <ServiceCall climate.set_temperature (c:01GVBP7T4X5JWX9MBERYMKRRZ6): entity_id=['climate.lumi_lumi_airrtc_agl001_thermostat_6'], temperature=20.0, hvac_mode=heat>
Error executing service: <ServiceCall climate.set_temperature (c:01GVBP80VNDJYP3A5GGP5MEBH6): entity_id=['climate.lumi_lumi_airrtc_agl001_thermostat_3'], temperature=20.0, hvac_mode=heat>
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/asyncio/tasks.py", line 456, in wait_for
    return fut.result()
asyncio.exceptions.CancelledError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/core.py", line 1826, in catch_exceptions
    await coro_or_task
  File "/usr/src/homeassistant/homeassistant/core.py", line 1845, in _execute_service
    await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 213, in handle_service
    await service.entity_service_call(
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 686, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 961, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 726, in _handle_entity_call
    await result
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 613, in async_service_temperature_set
    await entity.async_set_temperature(**kwargs)
  File "/usr/src/homeassistant/homeassistant/components/zha/climate.py", line 462, in async_set_temperature
    success = await thrm.async_set_heating_setpoint(
  File "/usr/src/homeassistant/homeassistant/components/zha/core/channels/hvac.py", line 265, in async_set_heating_setpoint
    if not await self.write_attributes(data):
  File "/usr/src/homeassistant/homeassistant/components/zha/core/channels/hvac.py", line 300, in write_attributes
    res = await self.cluster.write_attributes(data, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/zigpy/zcl/__init__.py", line 567, in write_attributes
    return await self.write_attributes_raw(attrs, manufacturer)
  File "/usr/local/lib/python3.10/site-packages/zigpy/zcl/__init__.py", line 573, in write_attributes_raw
    result = await self._write_attributes(attrs, manufacturer=manufacturer)
  File "/usr/local/lib/python3.10/site-packages/zigpy/quirks/__init__.py", line 301, in _write_attributes
    return await super()._write_attributes(
  File "/usr/local/lib/python3.10/site-packages/zigpy/zcl/__init__.py", line 324, in request
    return await self._endpoint.request(
  File "/usr/local/lib/python3.10/site-packages/zigpy/endpoint.py", line 237, in request
    return await self.device.request(
  File "/usr/local/lib/python3.10/site-packages/zigpy/device.py", line 313, in request
    return await asyncio.wait_for(req.result, timeout)
  File "/usr/local/lib/python3.10/asyncio/tasks.py", line 458, in wait_for
    raise exceptions.TimeoutError() from exc
asyncio.exceptions.TimeoutError

and

Source: components/automation/__init__.py:566 
Integration: Automatisierung (documentation, issues) 
First occurred: 20:54:30 (1 occurrences) 
Last logged: 20:54:30

Error while executing automation automation.heating_control: Error rendering data template: ValueError: Template error: float got invalid input 'None' when rendering template '{{ off_temperature | float }}' but no default was specified```

Do your climate entities own an attribute min_temp? If yes, try reload the automations again in de developer menu.

Ya it has min_temp but its 7°C instead of 5. It doesnt save when i change the value to 5…

Oh, sry. The old link points to a wrong source. That wasn’t the updated version. Here you are.

1 Like

Well that worked perfectly. Thank you very much :slight_smile: Have a nice start of the week.

Sorry if I have not correctly understood from your previous replies but I have an Aqara TRV in ZHA that does not have any current attribute in the UI that includes ‘calibration’ or ‘offset’ but the device does have a cluster attribute named local_temperature_calibration.

Does this mean I can not use the external temperature sensor feature in your blueprint?
attributes

Yes, since ZHA only supports devices which are strictly orientated to the zigbee standard, you have to wait for a custom quirk which provides an input number for calibration like the other TRV implementations do.
You need an additional automation / blueprint especially made for your device and that case till somebody enhance that custom quirk.

Think you posted that automation a time ago.

So I’m new to blueprints and it might be I did something wrong - but I can’t get it to work.

I configured the blueprint and everything is showing up under Automations as expected. But the Automation never runs.

I took a look in the logs and found this:
Error rendering variables: TemplateError: Use of 'is_state' is not supported in limited templates

Honesly I don’t really know what to do to get it running. Any help is appreciated.

1 Like

Thank you for your feddback! Indeed there was an issue with choosing the holiday scheduler. I’d fixt it and did a fast test. Just reimport the blueprint and test it. A small feedback would be great. Thanks!

Thanks for the fast feedback and fix. I updated the YAML and it works now :+1:

1 Like

So the Blueprint is running but as soon as I enable holiday mode it gives the following error:

Error rendering variables: ValueError: Template error: as_timestamp got invalid input 'None' when rendering template '{{ (as_timestamp(state_attr(active_scheduler,'next_event')) - as_timestamp(now())) / (60 * 60) <= presence_time_window }}' but no default was specified

1 Like

Has your holiday scheduler entries when it has to be on or is it empty? Seems the attribute ‘next_event’ is not given.

But yes, I will add a default value when there is no next_event in the scheduler. But an empty scheduler makes no sense. The automation sets the trvs to min_temp when nobody is at home.

It’s empty indeed.
My usecase was not for holidays but office / homeoffice days.
If I’m in the office the heating will be min_temp based on my availability, true. But there are days I’m working from home but not in the office - so my HA thinks I’m at home but I still don’t want the office to be heated. Hence I was thinking I’d push a button to enable “holiday mode” and the heating won’t turn on.

1 Like

Ok, thank for your explanation. I’ve updated the blueprint with a default value. Waiting for your feedback! :wink:

Does the party mode keep the heating on even if the defined persons are not at home? The use case is that when my spouse and I are out of the house but some other non-Home Assistant users are in the home e.g. kids, babysitter, grandparents, etc that we’d like the heating to keep working according to the set schedule.

Yes, this is how it works. If the input boolean for party mode is on the the heating will set to comfort temperature no matter if anybody is home or not.
I did a quick test and it works for me. If you have any issue please post the trace and configuration. Maybe I can help.

Okay, maybe my use case is a little different?
I was thinking of something like “If the input boolean for guest mode is on the heating will work to the set schedule no matter if anybody is home or not”. The situation is if someone is staying at my home for multiple days (or weeks) and I am not at home so I don’t want the comfort temperature on at all times and would prefer to manage the heating using my normal schedule.

Here is a test version for you. I’ve added a new option for an input_boolean for guest mode. If it’s on the person entities will be ignored and the heating is only related to the scheduler. Waiting for your feedback. If everything works as expected I will merge it to the main version.

The idea behind party mode is that you want to heat longer than the scheduler is programmed. Its the case if you stay awake longer as expected. Maybe you trigger it with a timer or something like this.

Thank you, I finally was able to use the blueprint and setup my TRV automation but it did not set the comfort temperature as expected. I did not switch on the Guest mode yet (Winter mode is on), I am just testing out the core functionality so far.

I can see that the schedule triggerred at the right time and this triggered the automation but the comfort temperature was not set.