Hi, relatively new to HA and looking at trying to drive more smarts through notifications (due to my air conditioner not being smart in any way) for humidity control.
I have humidity sensors in each of my rooms, which are measuring fine and working as expected.
I would like to create a notification on my phone, that would alert me to “Room X humidity is at Y%”. which y% would be over a threshold (eg 60%).
Im sure there is a smart way of doing this, rather than creating an automation per humidity sensor. Hoping someone can shed some light on that smart way for me to dig into and learn some more.
thanks very much @Coolie1101 for a super quick reply. It looks like I need to do the above in YAML and not through the UI.
I appreciate that this is an example only however due to my newbieness :P, can I confirm that this line IS correct or is it just a verbose way of saying what you mean? The rest of it I can get my head around ta.
The {{ trigger.to_state.attributes.friendly_name }} is currently {{ trigger.to_state.state }}.
Can be done via the UI as well, you will just add multiple entities for the trigger above and below the required value.
This template enables the notification to tell you which sensor triggered the automation and it’s corresponding value.
If you add my example via yaml then switch to visual editor, you will get a little more insight a to what the process / steps are, for me it’s just easier to do in yaml, as we didn’t have the visual editor when i initially started using HA, had to learn yaml the hard way.
fantastic thank you so much. i will do it in YAML as I am not afraid of it and see how it moves into the UI Editor so I can get my head around it. thanks very much for your clear and prompt responses. #legend.
Hi @Coolie1101, I have added it in to my automations.yaml but the notification isn’t coming through (after I reloaded automations.yaml etc).
I have only added one sensor, just so I can learn to build it out, and note that when I go into the automation UI I cant edit the message (which is fine). However, if I edit the message to just be plain text, the notification works. It doesn’t work with the template details in there. (even if I force run the automation and change the humidity threshold to be lower than current).
Any ideas?
- id: '1669250371390'
alias: High Humidity Alert
description: Alert when humidity is over 50%
trigger:
- platform: numeric_state
entity_id:
- sensor.harper_s_thermostat_humidity
above: 50
for:
hours: 0
minutes: 3
seconds: 0
condition: []
action:
- service: notify.mobile_app_dr_iphone_14_pro_max
data:
message: The {{ trigger.to_state.attributes.friendly_name }} is currently {{
trigger.to_state.state }}.
mode: single
something must have been bugging out mate, all good. i added the rest of the sensors, and now its working. I am not 100% sure what happened and why but all good mate thanks very much again for your help.
If you could share where I could learn how to craft the message part of the above automation that would be great.