I have already done a beta on this but I got distracted and move on, I will have to revisit it againâŠ
Blacky
I have already done a beta on this but I got distracted and move on, I will have to revisit it againâŠ
Blacky
First of all; thank you for the awesome blueprint. Saves me a lot of time.
Is it possible the create the option to run once a month?
I can probably make a workaround with a button helper and automation that runs once a month, but maybe it can be integrated in the blueprint.
two posts up i made this in a custom action.
can you post your yaml ?
sure
service: notify.persistent_notification
metadata: {}
data:
title: đȘ«Batterie schwach —
data:
notification_id: batterylow
message: |-
Folgenden GerÀte haben weniger als 10% Batterie:{{'
'}}âą {{sensors|replace(', ', '
âą ')}}
It is possible but I can see a lot of options, like day, time, first Monday etc. The best way is to add a custom condition. The condition would be a template condition, edit in YAML and enter this code. This is for the first Monday of the month. 0 = Monday and <= 7 is the first week of the month. So if you would like it on a Friday the 0 would be 4. Then just use time option and you could also set the day to be the same to.
condition: template
value_template: "{{ now().weekday() == 0 and now().day <= 7 }}"
EDIT: I did a FAQ in this now. For more details click here.
Let us know how you go.
Blacky
FAQ - How to add a Persistent Notification in the UI
In the UI you have notifications as shown below. This is called a Persistent Notification.
When you click on the âNotificationsâ you will see the notification as shown below. There are 2 ways you can do this.
OPTION1: Use the easy notify option then follow the steps below.
OPTION 2: Use the custom action option then follow the steps below.
In the custom actions, click on the â+ ADD ACTIONâ button
Then start typing ânotificationsâ. You will see the notifications options pop up. Select âSend a persistent notificationâ
Then click on the 3 dots and select âEdit in YAMLâ.
Copy the code below and paste it in as shown below. Replace the âall_sensorsâ with the sensor you would like to use. You can also change how you would receive this message by using a âIf-then-elseâ or a âIf-thenâ action. In another FAQ I show you how to do this, Click Here. In the FAQ link example 6 = Shows you how to receive a âOkay confirmation messageâ and example 7 = Shows you how to receive a message if there are batteries to report. The below example will just report every time it runs.
service: notify.persistent_notification
metadata: {}
data:
title: đȘ«Low Battery Notification
message: |-
âą {{all_sensors|replace(', ', '
âą ')}}
Enjoy
Blacky
Back to FAQ: Click Here
FAQ - How to run the automation once a month
You can run the automation once a month by adding in a âGlobal Conditionâ. Below are the steps on how to do this. There are 2 examples, choose the one you would like to use.
EXAMPLE 1: This will run it once a month but you canât use the âButton Helperâ follow these steps.
In global conditions click â+ ADD CONDITIONâ
In the search start typing âtemplateâ. Template will pop up and select it.
Copy and pase the code provide below.
â0â = Monday so if you would like to run it on Friday then replace the â0â with â4â.
â7â is for the first week of the month.
{{ now().weekday() == 0 and now().day <= 7 }}
Then enable time, set the time you would like and because we used â0â = Monday we also selected Monday.
Click save and your done . The automation should only run on the first Monday of the month.
EXAMPLE 2: If you would like to still be able to use the âButton Helperâ and run it once a month follow these steps.
In global conditions click â+ ADD BUILDING BLOCKâ
Then select âOrâ.
Click the 3 dots and âEdit in YAMLâ
Copy the code below and paste it in. Change it to the day you would like
â0â = Monday so if you would like to run it on Friday then replace the â0â with â4â.
â7â is for the first week of the month.
condition: or
conditions:
- condition: trigger
id: t0
- condition: template
value_template: "{{ now().weekday() == 0 and now().day <= 7}}"
Then enable time, set the time you would like and because we used â0â = Monday we also selected Monday.
Click save and your done . The automation should only run on the first Monday of the month and allow you to also use the âButton Helperâ.
Enjoy
Blacky
Back to FAQ: Click Here
i tested this a bit more and if a âOkay Confirmation Messageâ selected the peristent notification looks like this:
In the FAQ example 6 shows you how to receive a âOkay confirmation messageâ in your custom actions Click Here⊠your âthenâ will be for the okay confirmation and the âelseâ will be for the batteries to report using the persistent notification option.
Let us know how you go.
Blacky
perfect⊠Works like a charmâŠ
Nice oneâŠ
Enjoy
Blacky
Hi, very nice automation. Works great for sensors that report a specific battery percentage. However, I have a number of temperature/humidity sensors that only report battery STATE, i.e. high/medium/low. Is there any way these can be included such that if status is low they are reported?
Hi Richard, it is already there and you should receive the 'Low" batteries in your notification. You can select from âEasy Notify - Messageâ options 1 or 2.
If it doesnât do it I am keen to know more.
Could you please provide us your YAML of the automation? This YAML code are the settings you have selected in the automation so I can help. To do this go into your automation, top right 3 dots, Edit in YAML, copy all the code, come back to the forum and in your reply at the top tool bar click on â</>â and paste code in there.
Could you also provide a screen shot of your entity state in developer tools.
Blacky
Thanks for the quick response. If you say it will work for these sensors then great. I donât currently have any of these sensors where the battery state is actually âlowâ, so I was not aware of this and I could not find any reference in the documentation. Also, these devices do not appear when clicking the âdevicesâ or âentitiesâ buttons for custom and excluded sensors on the setup screen, so I assumed that they donât work. Maybe tomorrow I will try to find some old batteries and add them to one of my sensors to verify.
Thanks for your help
O okay, thanks for letting us know.
Blacky
Thanks for the option! Iâve added it to the automation.
I have a bunch off homematic devices but they report low battery as binary value. So when the battery is low the sensor is true. Is there any way to integrate these into your blueprint?
No problem at all
Blacky