Alert when Speedtest below 20

I am wanting to setup an email alert when my Speedtest result is below 20.

I have the smtp setup in my notifications.yaml file. I was able to test the notify.smtp and that part works.

I have my automations in an automation folder and in my configurations.yaml file I have

automation: !include_dir_merge_list automation/
notify: !include notification.yaml

The yaml file in the automation folder looks like this.

 - alias: Speedtest Check
   trigger:
	 platform: state
	 entity_id: sensor.speedtest_download
	 below: 20
   action:
	 service: notify.smtp
	 data:
	   title: "Speed Test Issue"
	   message: "Speed test is less than 20"    

For testing purposes I changed 20 to 50 since it has been running at 47-48…just to verify I can get an email but nothing.

1 Like

try and format your code correctly, it’s difficult to see if there are any indentation issues otherwise.
Regarding your issue, you need to replace
platform: state
with
platform: numeric_state

Ok

 - alias: Speedtest Check
   trigger:
	-  platform: numeric_state
	   entity_id: sensor.speedtest_download
	   below: 20
   action:
	-  service: notify.smtp
	   data:
	   title: "Speed Test Issue"
	   message: "Speed test is less than 20"    

How often do these alerts check the system and is there a way to force it manually?

1 Like

every time the sensor.speedtest_download gets a state change, the automation is triggered and tested
every time the value goes from more than 20 to less than 20 it fires up the action

Ok I got it to work if I put it in Automations.yaml and changed my config to

automations: !inclued automations

So if I want to use a folder vs the default yaml file which is the correct way?

I was using

!include_dir_merge_list

You can use !include_dir_merge_list automations but you have to make sure you add one indent To your code on each line in each file