I’m fairly new to HomeAssistant and have been muddling my way through moving some automation to HomeAssistant. I’ve been a little stumped on how to send iOS alerts to my phone and how to include a variable in my alert notification. I have 4 automations set up that trigger based on real time electricity pricing. They all seem to trigger and work properly, yet only 1 send an iOS notification (Turn on Mini Fridge automation). Also, I’d like it to output the current price when it does so, but currently it just spits out this:
Comed price is {state.sensor.comed_5_minute_price}
Mini Fridged turned back on.
Any help or points in the right direction are appreciated.
- id: '1611002510461'
alias: Turn off Mini Fridge
description: ''
trigger:
- platform: numeric_state
entity_id: sensor.comed_5_minute_price
above: '4'
condition: []
action:
- domain: switch
entity_id: switch.mini_refrigerator
device_id: b66547973fab91f046e4f45a7eb9d479
type: turn_off
- device_id: 3f8d5522b14ec128970965ee77b37493
domain: mobile_app
type: notify
message: Mini Fridge turned off
title: Comed Hourly Price is {{sensor.comed_5_minute_price}}
mode: single
- id: '1611018874449'
alias: Turn on Mini Fridge
description: ''
trigger:
- platform: numeric_state
entity_id: sensor.comed_5_minute_price
below: '4.0'
condition: []
action:
- domain: switch
entity_id: switch.mini_refrigerator
device_id: b66547973fab91f046e4f45a7eb9d479
type: turn_on
- device_id: 3f8d5522b14ec128970965ee77b37493
domain: mobile_app
type: notify
message: Mini Fridge turned back on
title: Comed price is {state.sensor.comed_5_minute_price}
mode: single`
Thanks. I’ll give that a try. The other thing I have not figured out is why only 1 of my 4 notifications works. 1 works literally every time. The others have not worked at all.
I may have figured it out. I think it was a combination of some of these changes, plus I had to reload the automations, which I must have forgotten to do after 1 of the changes. I’m monitoring it now. I also realized I need to tweak the last part of the automation, depending on time of day and year. I need to look into how to do that now.
- id: '1611002510461'
alias: Turn off Mini Fridge
description: ''
trigger:
- platform: numeric_state
entity_id: sensor.comed_5_minute_price
above: '4.0'
condition: []
action:
- domain: switch
entity_id: switch.mini_refrigerator
device_id: b66547973fab91f046e4f45a7eb9d479
type: turn_off
- device_id: 3f8d5522b14ec128970965ee77b37493
domain: mobile_app
type: notify
message: "Comed price is {{ states('sensor.comed_5_minute_price') }}"
title: Mini Fridge turned off
mode: single
- id: '1611018874449'
alias: Turn on Mini Fridge
description: ''
trigger:
- platform: numeric_state
entity_id: sensor.comed_5_minute_price
below: '4.0'
condition: []
action:
- domain: switch
entity_id: switch.mini_refrigerator
device_id: b66547973fab91f046e4f45a7eb9d479
type: turn_on
- device_id: 3f8d5522b14ec128970965ee77b37493
domain: mobile_app
type: notify
message: "Comed price is {{ states('sensor.comed_5_minute_price') }}"
title: Mini Fridge turned back on
mode: single
- id: '1611251451579'
alias: Turn off Humidifier
description: ''
trigger:
- platform: numeric_state
entity_id: sensor.comed_5_minute_price
above: '4.0'
condition: []
action:
- type: turn_off
device_id: a627867f10c929f0229240a9bacd2630
entity_id: switch.humidifier
domain: switch
- device_id: 3f8d5522b14ec128970965ee77b37493
domain: mobile_app
type: notify
message: Humidifier turned off
title: "Comed price is {{ states('sensor.comed_5_minute_price') }}"
mode: single
- id: '1611251648758'
alias: Turn on Humidifier
description: ''
trigger:
- platform: numeric_state
entity_id: sensor.comed_5_minute_price
below: '4.0'
condition: []
action:
- type: turn_on
device_id: a627867f10c929f0229240a9bacd2630
entity_id: switch.humidifier
domain: switch
- device_id: 3f8d5522b14ec128970965ee77b37493
domain: mobile_app
type: notify
message: Humidifier turned back on
title: "Comed price is {{ states('sensor.comed_5_minute_price') }}"
mode: single
- id: '1611252261052'
alias: Set Ecobee Comfort Profile to Precool when Hourly pricing is less than 0
description: ''
trigger:
- platform: numeric_state
entity_id: sensor.comed_5_minute_price
below: '0'
condition: []
action:
- device_id: 3f8d5522b14ec128970965ee77b37493
domain: mobile_app
type: notify
message: Comed price is low!
title: "Hourly pricing is less than zero ({{ states('sensor.comed_5_minute_price') }})"
mode: single
Very interested! I was realizing that it seems rather redundant, but was focused on making it work first and having them separate allowed me to make changes to just 1 and not others to test what worked. Thanks for your help!
It seems like this doesn’t replace the part about setting my EcoBee to pre-cooling that I have in my automations. I was hoping to do this when power is zero or less, but realized I only want to do this during the day in the winter, and anytime during the summer. Or maybe I could just set it to If Ecobee is set to heat mode, then do this, otherwise if set to cool mode do this…
From what I see in the automations you posted, all you are doing is sending a message when the comed is below zero which is my “Comed very low messge”. Did I miss something else?
If you are looking at doing something else when below zero, You can add a condition in the action section at the end to test for < 0 winter/summer logic.
This sets my thermostat to a precool mode when pricing is below zero.
EDIT: No, you’re right. It only sends a message for now. I didn’t figure out that automation yet. My mistake.
- id: '1611252261052'
alias: Set Ecobee Comfort Profile to Precool when Hourly pricing is less than 0
description: ''
trigger:
- platform: numeric_state
entity_id: sensor.comed_5_minute_price
below: '0'
condition: []
action:
- device_id: 3f8d5522b14ec128970965ee77b37493
domain: mobile_app
type: notify
message: Comed price is low!
title: "Hourly pricing is less than zero ({{ states('sensor.comed_5_minute_price') }})"
mode: single
I am finally returning to this. I’m wondering how I can use your suggestion and now just notify my phone when devices turn on/off. I’m ditching the EcoBee part for now since I think IFTTT will be able to do some of that for me with some logic they’re building.