Help with doors open and heating

Hey all,
i have samsung smartthing multisensors on doors/windows.
i then have evohome heating system. https://www.home-assistant.io/components/evohome/

goal1:
notify me if heating comes “on” and a door/window is open in that room (living room, office, bedroom, whatever)

I looked at making a group for each radiator + door/window combination.
however for the evohome system, there is no clear “on” attribute.
maybe the only way to work it out is to have a template that updates if the “TargetHeatTemperate” is greater then the “temperature” - you could then assume its “on”

{
  "current_temperature": 20.1,
  "min_temp": 5,
  "max_temp": 35,
  "temperature": 21,
  "target_temp_step": 0.5,
  "operation_mode": "TemporaryOverride",
  "operation_list": [
    "FollowSchedule",
    "TemporaryOverride",
    "PermanentOverride"
  ],
  "status": {
    "temperatureStatus": {
      "temperature": 20.12,
      "isAvailable": true
    },
    "activeFaults": [],
    "setpointStatus": {
      "targetHeatTemperature": 21,
      "setpointMode": "TemporaryOverride",
      "until": "2019-06-24T08:50:00Z"
    },
    "name": "Office"
  },
  "switchpoints": {},
  "friendly_name": "Office",
  "icon": "mdi:radiator",
  "supported_features": 4225
}

once thats done…

goal2:
turn off heating if the door/window is open for >5min, with an alert.
goal3:
restart the heating if the door is then closed and resume the schedule.

Nice goals! So… Is there a question hidden in there somewhere? :wink:

Did you finis goals 2 and 3, if so, could you hint me on howto do that.

currently i’m stuck in switching modes, from the developper side in the “bakcend” switching modes is working, but from a button card it won’t switch.

only 1 so far

Here are samples of my automations that achieves both goal2 and 3, without the notification. I have a group with all doors and windows and use the state of the group to determine if any is open. My use cause don’t really care about which door/window is opened since I have central Heat/Cooling. Also of note, HA controls my entire Heat/Cool schedule. I don’t utilize any of the thermostat built in functionality.

- alias: 'HVAC Off If Door Or Window Left Open'
    trigger:
      platform: state
      entity_id: group.door_window_opennings
      to: 'on'
      for:
        minutes: 5
    condition:
      condition: template
      value_template: '{{ states.climate.main_floor.state | lower != "off" }}'
    action:
      - service: automation.turn_off
        entity_id:  automation.hvac_change_operating_mode
      - service: climate.set_hvac_mode
        data:
          entity_id: climate.main_floor
          hvac_mode: 'off'
      - service: automation.turn_on
        entity_id: automation.hvac_restore_state_after_all_doors_or_windows_close

- alias: 'HVAC Restore State After All Doors Or Windows Close'
    initial_state: false
    trigger:
      platform: state
      entity_id: group.door_window_opennings
      to: 'off'
      for:
        minutes: 5
    condition:
      condition: state
      entity_id: climate.main_floor
      state: 'off'
    action:
      - service: climate.set_hvac_mode
        data_template:
          entity_id: climate.main_floor
          hvac_mode: '{{ states.sensor.hvac_operating_mode.state | default("heat") }}'
      - service: automation.turn_on
        entity_id:  automation.hvac_change_operating_mode
      - service: automation.turn_off
        entity_id: automation.hvac_restore_state_after_all_doors_or_windows_close

What is your automation for:

automation.hvac_change_operating_mode

It changes the operating mode between heat/cool base on inside and outside temp.