Heaty will die, Schedy be born!

Hi @Autoper

Sure, this is common problem. You need to triggere re-avaluation somehow.

I see two options.

First is to set an automation every eg. minute to trigger Schedy to re-evaluate.
Check Schedy docs.

Second option is what I did. I created a fake sensor computing number of minutes since midnight. This sensor changes itself every minute, logically. And I set it as watched entity.

Schedy, line 35:

Sensor:

Thanks a lot! That saved the day :smiley:
Just one question, is it possible to modify the sensor to count every 10 minutes? I think every minute may be a bit agressive.

  • Jan-Tore -

In that case I would suggest you the automation to triggere re-evaluation every ten minutes.

Or you can play a bit with the sensor and eg. round the result for tens. That could do the trick :slight_smile:
For me the minutes sensor is important as it is used for comparing time intervals. Comparing hours and minutes in Schedy would be nightmare so all values from GUI sliders are trasnformed to minutes since midnight. And then it is much easier to compare.

hello, i got a question.

i got an input number which i set to be watched:

  watched_entities:
    - input_select.heating_mode
    - input_number.heatingperiodebeginyear

heatingperiodebeginyear has got the float value of “2021.0”

and i want to use it here:


  schedule_snippets:
    preset1:
      - v: 19
        start_date:
          {
            year: int(state("input_number.heatingperiodebeginyear")),
            month: 10,
            day: 1,
          }
        end_date: { year: 2022, month: 4, day: 1 }
        rules:
          - weekdays: 1-7
            rules:
              - { start: "07:00", end: "07:59:59" }

but thats not working. i getting this error:

ERROR schedy_heating: !!! Configuration error: expected int for dictionary value @ data['schedule_snippets']['grundwaerme_preset1'][0]['start_date']['year']. Got 'int(state("input_number.heatingperiodebeginyear"))'

how can i solve that?

Good evening,
I recently started using HA.
Schedy is runnung good so far as I have one “test-room” before completely switching fom OH and from MAX! thermostats to Zigbee.

I have the following problem:
Temperature changes are performed according schedule. Window open detection is not working at all (change temperature to 5°C when window is open).

The log says the following:

INFO schedy_heating: → Attribute ‘state’ of ‘binary_sensor.door_window_sensor_wc’ changed from ‘off’ to ‘on’, reevaluating .

here is my .yaml

schedy_heating: # This is our app instance name.
module: hass_apps_loader
class: SchedyApp

actor_type: thermostat

expression_environment: |
def heating_mode():
return state(“input_select.heating_mode”)

watched_entities:

  • input_select.heating_mode

schedule_prepend:

  • x: “Mark(5, Mark.OVERLAY) if not is_empty(filter_entities(‘binary_sensor’, state=‘on’, window_room=room_name)) else Next()”

schedule_append:

  • v: 5

rooms:

wc:
  allow_manual_changes: false
  actors:
    climate.zb_thermostat_eg_wc:
  watched_entities:
  - binary_sensor.door_window_sensor_wc
  schedule:
    - v: 20
      rules:
        - weekdays: 1-5
          rules:
          - { start: "07:30", end: "17:59" }
        - weekdays: 6-7
          rules:
          - { start: "08:00", end: "17:59" }
    - v: 18
      rules:
        - weekdays: 1-5
          rules:
          - { start: "18:00", end: "07:29" }
        - weekdays: 6-7
          rules:
          - { start: "18:00", end: "07:59" }

Any suggestions?

BTW: is there any chance to delay the temperature reduction by, let’s say, 5 minutes?

Thanks in advance
Florian

Hello All,
I advanced in using Schedy for my heating schedules. The unsolved problem still is that the thermostats do not react when a window is opened. The used thermostats are Zigbee Tuya thermostats.
After browsing the web I found a configuration that promised being the solution but it is not:

  actor_type: thermostat
  actor_templates:
    default:
      off_temp: 5
      supports_hvac_modes: false

The log still states the following:


2022-03-01 20:15:10.616086 INFO schedy_heating: --> Attribute 'state' of 'binary_sensor.door_window_sensor_wc' changed from 'off' to 'on', reevaluating <Room R:wc>.
2022-03-01 20:15:17.592606 INFO schedy_heating: --> Attribute 'state' of 'binary_sensor.door_window_sensor_wc' changed from 'on' to 'off', reevaluating <Room R:wc>.

Can someone suggest anything to fix this?

Here is my schedy_heating.yaml

schedy_heating:
  module: hass_apps_loader
  class: SchedyApp

  actor_type: thermostat
  actor_templates:
    default:
      off_temp: 5
      supports_hvac_modes: false

  expression_environment: |
    def heating_mode():
        return state("input_select.heating_mode")

  schedule_snippets:
  
    ss_aus: 
    - v: 5

    ss_durchgehend_wohnen:
    - v: 21

    ss_durchgehend_sonstige:
    - v: 19

    ss_durchgehend_kids:
    - v: 20

    ss_abwesend:
    - v: 18
      start: "10:00"
      end: "20:00"

    ss_kz:
    - v: 20
      rules:
      - weekdays: 1-5
        rules:
        - { start: "07:30", end: "17:59" }
      - weekdays: 6-7
        rules:
        - { start: "08:00", end: "17:59" }
    - v: 18
      rules:
        - weekdays: 1-5
          rules:
          - { start: "18:00", end: "07:29" }
        - weekdays: 6-7
          rules:
          - { start: "18:00", end: "07:59" }

    ss_sz:
    - v: 20
      rules:
      - weekdays: 1-5
        rules:
        - { start: "07:30", end: "17:59" }
      - weekdays: 6-7
        rules:
        - { start: "08:00", end: "17:59" }
    - v: 18
      rules:
        - weekdays: 1-5
          rules:
          - { start: "18:00", end: "07:29" }
        - weekdays: 6-7
          rules:
          - { start: "18:00", end: "07:59" }

    ss_bz:
    - v: 20
      rules:
      - weekdays: 1-5
        rules:
        - { start: "07:00", end: "16:59" }
      - weekdays: 6-7
        rules:
        - { start: "08:00", end: "17:59" }
    - v: 18
      rules:
        - weekdays: 1-5
          rules:
          - { start: "17:00", end: "06:59" }
        - weekdays: 6-7
          rules:
          - { start: "18:00", end: "07:59" }

    ss_wz:
    - v: 21
      rules:
      - weekdays: 1-5
        rules:
        - { start: "05:30", end: "21:59" }
      - weekdays: 6-7
        rules:
        - { start: "05:30", end: "22:59" }
    - v: 18
      rules:
        - weekdays: 1-5
          rules:
          - { start: "22:00", end: "05:29" }
        - weekdays: 6-7
          rules:
          - { start: "23:00", end: "05:29" }

    ss_wc:
    - v: 19
      rules:
        - weekdays: 1-5
          rules:
          - { start: "07:30", end: "17:59" }
        - weekdays: 6-7
          rules:
          - { start: "08:00", end: "17:59" }
    - v: 18
      rules:
        - weekdays: 1-5
          rules:
          - { start: "18:00", end: "07:29" }
        - weekdays: 6-7
          rules:
          - { start: "18:00", end: "07:59" }

    ss_ki:
    - v: 20
      rules:
      - weekdays: 1-5
        rules:
        - { start: "08:00", end: "17:59" }
      - weekdays: 6-7
        rules:
        - { start: "09:00", end: "17:59" }
    - v: 18
      rules:
        - weekdays: 1-5
          rules:
          - { start: "18:00", end: "07:59" }
        - weekdays: 6-7
          rules:
          - { start: "18:00", end: "08:59" }

  watched_entities:
  - input_select.heating_mode

  schedule_prepend:
  - x: "Mark(OFF, Mark.OVERLAY) if not (is_empty(filter_entities('sensor', state='open', window_room=room_name))) else Next()"
  - x: "Mark(OFF, Mark.OVERLAY) if not (is_empty(filter_entities('sensor', state='tilted', window_room=room_name))) else Next()"
  - x: "Mark(OFF, Mark.OVERLAY) if not (is_empty(filter_entities('binary_sensor', state='on', window_room=room_name))) else Next()"
  - x: "IncludeSchedule(schedule_snippets['ss_abwesend']) if heating_mode() == 'abwesend/zeitgesteuert' else Next()"
  - x: "IncludeSchedule(schedule_snippets['ss_aus']) if heating_mode() == 'aus' else Next()"

  schedule_append:
  - value: "17"

  rooms:

    wc:
      allow_manual_changes: false
      actors:
        climate.zb_thermostat_eg_wc:
      watched_entities:
      - binary_sensor.door_window_sensor_wc
      schedule:
      - x: "IncludeSchedule(schedule_snippets['ss_wc']) if heating_mode() == 'anwesend/zeitgesteuert' else Next()"
      - x: "IncludeSchedule(schedule_snippets['ss_durchgehend_sonstige']) if heating_mode() == 'durchgehend aktiv' else Next()"
      
      
    sz:
      allow_manual_changes: false
      actors:
        climate.zb_thermostat_eg_kz2:
      watched_entities:
      - binary_sensor.door_window_sensor_kz_21
      - binary_sensor.door_window_sensor_kz_22
      schedule:
      - x: "IncludeSchedule(schedule_snippets['ss_sz']) if heating_mode() == 'anwesend/zeitgesteuert' else Next()"
      - x: "IncludeSchedule(schedule_snippets['ss_durchgehend_sonstige']) if heating_mode() == 'durchgehend aktiv' else Next()"

    kz1:
      allow_manual_changes: false
      actors:
        climate.zb_thermostat_eg_kz1_1:
        climate.zb_thermostat_eg_kz1_2:
      watched_entities:
      - binary_sensor.door_window_sensor_kz_11
      - binary_sensor.door_window_sensor_kz_12
      schedule:
      - x: "IncludeSchedule(schedule_snippets['ss_kz']) if heating_mode() == 'anwesend/zeitgesteuert' else Next()"
      - x: "IncludeSchedule(schedule_snippets['ss_durchgehend_kids']) if heating_mode() == 'durchgehend aktiv' else Next()"
      
    bz:
      allow_manual_changes: true
      rescheduling_delay: 60
      actors:
        climate.zb_thermostat_eg_bz:
      watched_entities:
      - binary_sensor.door_window_sensor_bz
      schedule:
      - x: "IncludeSchedule(schedule_snippets['ss_bz']) if heating_mode() == 'anwesend/zeitgesteuert' else Next()"
      - x: "IncludeSchedule(schedule_snippets['ss_durchgehend_sonstige']) if heating_mode() == 'durchgehend aktiv' else Next()"

Thanks in Advance
Florian

1 Like

Hi my solution is to have a general definition of hvac modes and define the off temperature only for thermostats who do not support a real off hvac (some tuyas dont). and of course prepend some general scheduling rules. hope that helps.

  actor_type: thermostat
  actor_templates:
    default:
##      off_temp: 5
      supports_hvac_modes: true
      hvac_mode_on: 'auto'
      hvac_mode_off: 'off'
  schedule_prepend:
  # don't turn on when it's > 24 degrees outside
  - x: "IncludeSchedule(schedule_snippets['snippet_aus']) if float(state('sensor.vicare_outside_temperature') or 0) > 24 else Next()"
  - x: "Mark(OFF, Mark.OVERLAY) if not (is_empty(filter_entities('binary_sensor', state='on', window_room=room_name))) else Next()"
  - x: "Mark(OFF, Mark.OVERLAY) if not (is_empty(filter_entities('binary_sensor', state='on', window_room2=room_name))) else Next()"
  - x: "IncludeSchedule(schedule_snippets['snippet_abwesend']) if heating_mode() == 'abwesend/zeitgesteuert' else Next()"
  - x: "IncludeSchedule(schedule_snippets['snippet_aus']) if heating_mode() == 'aus' else Next()"
####### #########

    Kinderzimmer:
      rescheduling_delay: 20
      watched_entities:
      - binary_sensor.kinderzimmer_sensor_fenster_links_contact
      - binary_sensor.kinderzimmer_sensor_fenster_rechts_contact
      - sensor.kinderzimmer_sensor_temperature
      actors:
        climate.kinderzimmer_heizung:
          min_temp: 5
          max_temp: 45
          off_temp: 5
          supports_hvac_modes: false
#          delta: 1.0 
      schedule:
      - x: "IncludeSchedule(schedule_snippets['snippet_aus']) if float(state('sensor.kinderzimmer_sensor_temperature') or 0) > 22 else Next()"
      - x: "IncludeSchedule(schedule_snippets['snippet_kinder']) if heating_mode() == 'anwesend/gast' else Next()"
      - x: "IncludeSchedule(schedule_snippets['snippet_kinder']) if heating_mode() == 'anwesend/zeitgesteuert' else Next()"
      - x: "IncludeSchedule(schedule_snippets['snippet_durchgehend_wohnen']) if heating_mode() == 'durchgehend aktiv' else Next()"

####### #########

It would be nice if you could explain some more about your heating situation and what you want to reach and why you change temperatures how you do?

@roschi
I am not sure how to use HVAC mode on a heating radiator valve (no cooling) with the modes heat, auto and off.
should it switched on or off? If i set it to heat and it is in mode auto i get errors regarding unknown mode auto and vice versa.

hvac_mode_on: auto # or heat?

Absolutely!
I live in an old house, that is difficult to keep warm in certain conditions.
I don’t want the heating to run at full all day, because I can’t afford that, so I have the temperature gradually ramp up during the day and then ramp down again.
But things like the wind coming from the North or East, will chill the house down quickly, more than the wind coming from the south will.
Additionally in order to save a bit of money, I don’t want the heating running at a higher temperature when I am not at home.
I am still tweaking, but I basically have the heating reacting to external conditions as well as internal ones, in order to keep a reasonably comfortable temperature that I can just about afford. It is certainly not what many people would consider to be toasty though.

The official advice in the UK at least is that living areas should be around 21C and bedrooms around 18C. I can’t afford to heat my living areas to 21C, and I doubt it would be possible even if I could. But I can afford to keep the bedroom at a comfortable-ish 18C - but only overnight, it’s pointless to heat the bedroom during the day when I am not in it. The heating system is not zoned like fancy American ones, the one boiler heats all the radiators, and all the radiators have thermostatic valves on them, so I can’t specifically heat a certain room, I can only turn the whole house heating on or off, and leave the thermostatic (not smart) valves to do the rest. Thus the bedroom will heat up if it is cold and the heating comes on because the living room is too cold, but the logic of when to turn the heating off, ignores the temperature of the bedroom during the day, because even if the bedroom gets too hot, I can’t do anything about it, and I don’t really care, I only care that the living room is not freezing.

interesting, thank you, but not my usecase. Have radiator valves / thermostats.

Hi @vajdum
I live in an old house too and save a lot on my gas bill by installing motorized radiator valves with separate temperature sensors per room. Using Scheky I even adjust on the month sinc in April/May there is no need to heat up in the morning when there is a sunny day coming. I would advise you to invest in this.
Long ago I even did a poor mans solution I installed resistors in standard thermostat knobs and by running a current through them it would think it is hot enough and close the valve :wink:

Yes, my valves are smart and i have thermometers in some rooms. But no need to do this sort of weather based related calculations. Especially as i can change my valves, but not my heater with HA.
I think i could calculate some pre heating times based on weather.

1 Like

Hi everyone. Here is my TRV Setup for the moment. TRV Gist. I think I have figured it out quite good for my situation (old house, old radiator system, central gas heating). So if it gives anyone some new ideas, feel free to use it.

I have a question;
I need a rule that prevents a thermostat from being turned on again for 5 minutes.
Use case: my heating software tells thermostat A to turn off because of the amount power (kwh) being used. This heating software can possibly 10 seconds later send a turn on thermostat A because used kwh has declined.
To save my thermostats from going on and off 30 times more than normal I hope schedy has some sort of delay function.
Many thanks

You did not mentioned how the Schedy is involved in “my heating software tells termostat”, it looks like direct communication :slight_smile:
But anyway I am using delays in HASS itself for windows opening. I created new artificial sensor with the delays and this artifical one is watched by Schedy instead of the primary one.
Like this:

platform: template
sensors:
  bedroom_window_delayed:
    friendly_name: "Delayed bedroom window"
    #window_room: bedroom
    delay_on: 
      seconds: 20
    delay_off:
      seconds: 20
    value_template: >-
      {{ is_state('binary_sensor.0x00158d0001f406fb_contact', 'on') }}

So sorry for the late reply, thanks for yours!

I have for example a heatit thermostat on my wall integrated via zwavejs as a climate entity. Schedy is controlling that climate thermostat :slight_smile: Kind of direct communication if you want to call it that :slight_smile:

I have 11 thermostats schedy control today, so I would need 11 templates and then schedy would use the template instead of the climate entity to manipulate temperature and hvac modes I assume. Hmm.

Is this project still actively supported? I think I have an issue with schedule_prepend. See Schedy may be ignoring schedule_prepend

1 Like

I have a heating schedule for a room that I want to overide temporarily. The current schedule is:

    livingroom:
      rescheduling_delay: 0
      replicate_changes: true
      actors:
        climate.livingroom_thermostat:
      schedule:
        - x: "15 if simulate_bedtime() == 'on' else Next()"
        - v: 19
          rules:
            - { start: "07:00", end: "22:30" }

i.e., unless I have signalled that we’ve gone to bed earlier, set the room 'stat to 19 between 07:00 and 22:30.

I now want to add the ability to extend the on period by an hour - like my previous Honeywell programmer permitted. However, what should happen in practice should depend on some factors:

  1. If it is before 22:30 (e.g. 22:15) and the stat is set to 19, simply extend to 23:15
  2. If it is before 22:30 (e.g. 22:15) and the stat has been increased to (say) 21, stay at 21 until 23:15
  3. If it is past 22:30 set the stat to 19 for 60 mins.

I can’t see how to program this in Schedy. Before I go down the route of an automation or piece of Python code, is there a way to incorporate this into Schedy itself?

Hi I managed to create binary sensors for all thermostats. The delay works like this;
when triggered to heat, the thermostat starts heating immediately and the binary sensor starts counting down from 20 seconds. After 20 seconds it’s On.
Same for the other way around.

I guess it’s expected since schedy still works directly with my thermostats, climate.downstairs_entrance for instance.

Do you address the binary sensor in schedy, called binary_sensor.downstairs_entrance for instance, to turn on? How?