Folks
I have an automation that runs hourly to check if any of my heaters are on and just messages me to remind me.
There are three conditions, one for each heater. What i would simply like to do is include the entity name in the message depending on which condition was met. Is this possible?
thanks
Yes, but you need to share your automation configuration so we can recommend a method that works with what you are using.
Hello
yaml code for the automation
alias: Notify - Heater Alert
description: Notify if Gazebo Heater or Office Heater has been running for over an hour.
trigger:
- platform: time_pattern
hours: /1
condition:
- condition: or
conditions:
- condition: state
entity_id: sensor.tado_hvac_action
state: heating
- condition: state
entity_id: climate.heater
state: heat
- condition: state
entity_id: climate.tuya_local_gazebo_heater
state: heat
action:
- service: script.broadcast_all
data:
title: Heater
message: Heater is on
mode: single
Redesign your automation so that the State Conditions you are currently using become the automation’s State Triggers. There’s no need for the Time Pattern Trigger. You’ll be able to get the friendly name, of the entity that triggered the automation, from trigger.to_state.name
If you don’t want to redesign it, you’ll need to create a template that checks the state of all three entities and reports the friendly name of all entities that are actively heating.
Let me know if you need help creating the template.
The reason I put it as a time trigger is that if it is on, then it will remind me hourly. ie if i put the Gazebo heater on, and sitting outside for a couple of hours, I don’t want to forget it is on.
What you just described is achieved using a State Trigger with a for
option. It will trigger when the entity has been heating for a specific amount of time.
Ideally the automation can notify you after a certain amount time has elapsed and then automatically turn off the entity after an additional period of time has elapsed (in case the notification was ignored).
But will that restrict me checking once, and the pausing to turn it off? I want to have a continuous reminder every hour.
The alert integration can help you to repeat the notification every hour if the heater remains on.
oh interesting, didn’t consider that option
So I have tried alerts and not sure why, but cant get it to work. Doesn’t seem a way to debug it.
In my configuration.yaml I have;
# To use the alerts.yaml
alert: !include alerts.yaml
Then in my alerts.yaml, i have the following.
office_heater_alert:
name: Office Heater Is On
message: The office heater is currently on
entity_id: hallway.climate
state: "heat"
repeat:
- 1
- 30
- 45
can_acknowledge: true
skip_first: false
notifiers:
- mobile_app_oppox3
hallway
is not a real domain… You likely mean climate.hallway
.
Oh FFS, lol yes, let me try that
Changed that, still no alerts
Ignore, it is working, found a minor typo