Once in awhile, my HA would act up and send me notifications via Telegram non-stop. For example, this automation will send me the notification (with photo) when motion is detected at my car porch. In my automation, I have made it to turn off the same automation > send me the photo via Telegram > wait 30 seconds > turn the automation on again. That way, I will have 30 seconds gap before receiving another notifications in case someone still lingers in my car porch.
- alias: 'Motion Detected - Car Porch'
initial_state: False
trigger:
- platform: state
entity_id: binary_sensor.motion_sensor_1
from: 'off'
to: 'on'
- platform: state
entity_id: binary_sensor.cam_1_field_detection
from: 'off'
to: 'on'
condition:
condition: and
conditions:
- condition: state
entity_id: binary_sensor.motion_sensor_1
state: 'on'
- condition: state
entity_id: binary_sensor.cam_1_field_detection
state: 'on'
action:
- service: automation.turn_off
entity_id: automation.motion_detected__car_porch
- service: notify.ben
data_template:
title: ""
message: "There is a movement at car porch"
data:
photo:
url: http://192.168.1.111/Streaming/channels/1/picture
username: !secret cam1_username
password: !secret cam1_password
caption: "There is a movement at car porch. Would you like to turn the /siren_on ?"
- delay:
seconds: 30
- service: automation.turn_on
entity_id: automation.motion_detected__car_porch
Sometimes it works, sometimes it keep sending me the notifications every seconds even though no one is already in the car porch until I have to reboot the system. The state of binary_sensor.motion_sensor_1
and binary_sensor.cam_1_field_detection
was already off when it happens.
Is anyone facing the same issue?