Actionable Notification on Thermostat Change

I created this a while back and figured with the European Energy crises perhaps this could be useful

This blueprint will fire an actionable notification if somebody sets the temp beyond a threshold - giving you the choice to set it back to the threshold or leave it as-is. I had at some point planned to offer more choices but apparently never got around to it … however thought I’d toss what I am currently using out to the community.

blueprint:
  name: Climate Alert
  description: Notification
  domain: automation
  input:
    climate:
      name: Climate Entity
      selector:
        entity:
          domain: climate


    temp:
      name: Trigger Temp
      description: Temp value to trigger the automation. In `heat` mode the target temp must be above this value to trigger the automation, where as in `cool` mode it must be below.
      default: 70
      selector:
        number:
          min: 32
          max: 100
          unit_of_measurement: "°"
          mode: box
    mode:
      description: "Select whether to trigger when Heating or Cooling"
      selector:
        select:
          options:
            - "heat"
            - "cool"

    notify_device:
      name: Device to notify
      description: Device needs to run the official Home Assistant app to receive notifications
      selector:
        device:
          integration: mobile_app

variables:
  mode: !input mode
  temp: !input temp
  climate: !input climate

trigger:
  - platform: state
    entity_id: !input climate
    attribute: temperature

action:
  - alias: "choose alias (name)"
    choose:
      - conditions:
          - condition: or
            conditions:
              - alias: "Too Hot - Heat"
                condition: template
                value_template: "{{ mode=='heat' and (states(climate) == 'heat') and (state_attr(climate, 'temperature') > temp)}}"
              - alias: "Too Hot - Heat + AC"
                condition: template
                value_template: "{{ mode=='heat' and (states(climate) == 'heat_cool') and (state_attr(climate, 'temperature') > temp)}}"
        sequence:
          - device_id: !input notify_device
            domain: mobile_app
            type: notify
            message: >-
              🔥️ Heat set to {{ int(state_attr('climate.downstairs','temperature'))}}° 🌡️
            data:
              actions:
                - action: DO_NOTHING
                  title: Leave it as-is!
                  icon: sfsymbols:checkmark.circle
                  destructive: false
                - action: SET_TO_TEMP
                  title: Set it to {{ temp }}
                  destructive: false
                  icon: sfsymbols::arrow.down.circle
      - conditions:
          - condition: or
            conditions:
              - alias: "Too Cold - AC"
                condition: template
                value_template: "{{ mode=='cool' and (states(climate) == 'cool') and (state_attr(climate, 'temperature') < temp)}}"
              - alias: "Too Cold - AC + Heat"
                condition: template
                value_template: "{{ mode=='cool' and (states(climate) == 'heat_cool') and (state_attr(climate, 'temperature') < temp)}}"
        sequence:
          - device_id: !input notify_device
            domain: mobile_app
            type: notify
            message: >-
              🥶️ AC set to {{ int(state_attr('climate.downstairs','temperature'))}}° ❄️
            data:
              actions:
                - action: DO_NOTHING
                  title: Leave it as-is!
                  icon: sfsymbols:checkmark.circle
                  destructive: false
                - action: SET_TO_TEMP
                  title: Set it to {{ temp }}
                  destructive: false
                  icon: sfsymbols::arrow.up.circle
  - alias: Wait for Input
    wait_for_trigger:
      - platform: event
        event_type: mobile_app_notification_action
        event_data:
          action: LEAVE_AS_IS
      - platform: event
        event_type: mobile_app_notification_action
        event_data:
          action: SET_TO_TEMP
  - alias: "Change Climate"
    choose:
      - alias: "Set to target temp"
        conditions: "{{ wait.trigger.event.data.action == 'SET_TO_TEMP' }}"
        sequence:
          - service: climate.set_temperature
            target:
              entity_id: !input climate
            data:
              temperature: !input temp
      - alias: "Target minus 1"
        conditions: "{{ wait.trigger.event.data.action == 'SET_TO_TEMP_MINUS_ONE' }}"
        sequence:
          - service: climate.set_temperature
            target:
              entity_id: !input climate
            data:
              temperature: "{{ int(temp) - 1 }}"
      - alias: "Target plus 1"
        conditions: "{{ wait.trigger.event.data.action == 'SET_TO_TEMP_PLUS_ONE' }}"
        sequence:
          - service: climate.set_temperature
            target:
              entity_id: !input climate
            data:
              temperature: "{{ int(temp) + 1 }}"

mode: restart
4 Likes

Hi,

check some line, it doesn’t work because you are using entity for actionable notifications Climate.downstairs .

Maybe that’s why I never posted it! :slight_smile:

I’m in the process of redoing my HA → and plan to update this.

1 Like

Hi @jeeftor , are there any updates on this? it’s exactly what I was looking for. thanks!

Oh dear… so many projects so … not organized … (no I haven’t touched it in a while because for me it just kinda works)

I should really look at this :rofl: (ping me in a week if its still open or just DM me)

Check here - you should be able to pull it down :slight_smile:

2 Likes