Getting your house to ask you for help: Using Email Notification in an 'Automation'
Test Your Notification
"Choose your service from the Service dropdown menu"
And then I hit "Call Service". (I have no doubt my wife wonders WTH I am doing sending her this email. Better to keep her guessing)
And holy cow!!! It worked!
Now I just need to try use this to tell us when batteries are getting low.
Link the Battery Level to the email
So now I need to add an 'automation'. I went to Configuration > AutomationsSelected "Add Automation".
I skipped the page that tries to parse the automation, because what I am doing is too complicated for it to figure out.Then I filled out the automation.
I gave it a name: Scottish Room Battery Change
A description: Scottish Room Batteries need to be Changed
Set the trigger type to "Numeric state", and set the "Entity" to the "Scottish Room Battery Level".
I set the field "Below" to 95 (Which needs to be 30, but I am not going to wait for the batteries to die to test this). So the trigger says - "When the numeric value of the Scottish Room Battery Level is below 95" then do something. Now I can set up what it will do.
I scrolled down to "Actions and set the action type to "Call service", and selected the service I just set up. I added the 'service data' following the directions here.
For the message, I used the current 'state' of the sensor in the email. This is another example of using that yaml stuff. You can get the right value for "sensor.kwikset_spectrum_brands_unknown_type_0003_id_0339_battery_level" by looking at the 'entity' in the trigger you just selected.
title: Scottish Room Batteries are low
message: >-
The Scottish Room Battery level is at
{{states('sensor.kwikset_spectrum_brands_unknown_type_0003_id_0339_battery_level')
| int }} percent. Time to think about changing them out.
And then I saved it,
and tried it out by scrolling back to the top, and selecting "Execute".
So now I have an 'automation' that should fire if the sensor ever goes below 95% - I think I will change that to be 30% now...
Now I need to add an automation for each of the other doors.
A note here: this blog does not give you "best practices". In other words, what I am doing on here is not necessarily the 'best way' to do things. For instance, having to set up the exact same thing (automation) for each of the doors, when it is likely that it is close to identical, is just too much work. However, I am focusing on making one small thing work, then making things better from there.
Comments
Post a Comment
Thanks for the comment!