🔥 Advanced Heating Control

Oh, I forgot the keyword binary_sensor in the example.

This should work:

trigger:
  - platform: time_pattern
    minutes: /10
action:
  - service: calendar.get_events
    data:
      start_date_time: "{{ now().replace(hour=0,minute=0,second=0,microsecond=0) }}"
      end_date_time: "{{ now().replace(hour=23,minute=59,second=59,microsecond=999999) }}"
    target:
      entity_id:
        - calendar.xxxx_googlemail_com
        - calendar.feiertage
    response_variable: calendar_events_variable
binary_sensor:
  - name: Urlaub
    unique_id: Urlaub
    state: >-
      {{ ( calendar_events_variable['calendar.xxxx_googlemail_com'].events |
      regex_search('(Urlaub|Krank)', ignorecase=True) ) or 
      (calendar_events_variable['calendar.feiertage'].events | count > 0 ) }}
1 Like

Nope is not working too :see_no_evil:
Problems on the binary

Edit: I have changed completly to v4:
Can you delete the input of “Minimum Temp (optional)” field after migration? there is a not working value in it, and when you dont delete it this comfort temp would not be taken. (maybe the same for comfort themp optional)

Here is my working sensor:

trigger:
  - platform: time_pattern
    minutes: /10
action:
  - service: calendar.get_events
    data:
      start_date_time: "{{ now().replace(hour=0,minute=0,second=0,microsecond=0) }}"
      end_date_time: "{{ now().replace(hour=23,minute=59,second=59,microsecond=999999) }}"
    target:
      entity_id: 
        - calendar.familie
        - calendar.feiertage
    response_variable: termine
binary_sensor:
  - name: Urlaub
    icon: mdi:palm-tree
    unique_id: urlaub
    state: >
      {{  
        ( termine['calendar.familie'].events | regex_search('urlaub', ignorecase=True) ) or 
        ( termine['calendar.familie'].events | regex_search('krank', ignorecase=True) ) or 
        ( termine['calendar.feiertage'].events | count > 0 ) 
      }}

hmm the binary_sensor setting part is after import not visual existing on my automation (only in yaml). maybe i dont understand the code, but do i need to create the binary sensor before? or what he does exactly?

please see my edit on the last post :slight_smile:

There is no way to delete variables or defaults in you configuration when migrating automatically. Best way is deleting the old automation and create a new one otherwise you have to delete the values in the automations.yaml manually.

I’ve edited first post again. The sensor must be defined in template section in configuration.yaml.

template:
- trigger: ...

Can you add hvac functions? i wanna use my A/C for Heating and cooling with your blueprint :slight_smile:

2 Likes

Possible, but I don’t know if this capable for cooling. I can focus on this when v4 is ready to go. Maybe in 2 or 3 weeks. And ofcourse I need a wingman for this because I don’t own an A/C. I will just setup a test entity in my testing system. :wink:

2 Likes

Hello @panhans I use version 4.0_alpha8. A question about this: If I have a temperature of 17c° in the room, a minimum temperature is set at 18c° via the helper. The presence is off. Shouldn’t the heating then heat at least to the minimum temperature, even if no one is there? Or did I get this wrong?

Yes, correct. Minimum will be set if no conditions for comfort match. Whats the target temperature for your climate entities in this case?

Ive tried it again.

  • Comfort Temp 20c°
  • Min Temp 19c°
  • Actual Temp 17,14C°

Presence is Off

No Changes after Script ist running.

Could you check out latest version? I’ve did a quick test and it works for me. If it’s not working with latest version for you I would ask you to share the corresponding trace log.

Ive tried the Alpha 10:


Dont work. How i can trace? Please Tell me how to do it

Just click on your automation then dots menu → show trace. Then again 3 dots menu to download the trace.

Just have a look in the first post. There is described how to share it.

My Trace

What’s the state of your climate at this point? You enabled Off Instead Of Min. The climate card also looks like your valve is turned off. At this state the target temperature doesn’t matter and also won’t be set.

Yes right. Thermostat ist Off. Now I changed from “enabled Off Instead Of Min” to disabled.

it looks like it’s working now. Apparently the function wasn’t clear enough to me. Thanks

1 Like

I’ll have a go with the option enabled.
What’s your plan with the proximity sensor?
I currently use a simple automation to toggle the heating on an off when someone enters or leaves a 5 KM radius around the homezone.

@panhans Question to the Offset.
Can it be that the offset calculation makes trouble when the Thermostat sync is to long (15 min default)? the thermostat heats to early when the contact is to late.
i have the supposition that the temp is sometimes to high (0.5C), i think it makes sence to integratiate a offset option, which is substract a value from your calculated offset. (when the temp is to high)

here you see the thermostat always hold for ~15 min the temp, this is way the offset is to low

what you think? i will check it the next days a little bit more. i think it should be the same line like at 10 o clock
image
image

The generic offset and that means also the target temperature are dynamic. The difference between valves and sensor temperature can differ between 0 and let’s say 3-5 °C. When you start heating the offset can be 3°C and when the room is evenly warm the offset can be gone.

Maybe you can overlay the graph of the target temperature with the sensor temperature to visualize weak points.

Yes, something like this. With the proximity integration you can check if a person is on the way to a specific zone, e.g home.
It needs an evaluation of direction and distance, maybe some debounce option for the direction state to make heating happen if somebody is on the way home.

I have tested the v4 Version and looks good for me.
Is there a way to set 2 different Reaction Times for the Window/Door? So one for open the Window/Door and one closing the Window/Door?

1 Like