If I start the flows manually, the snapshot will be send. Even if I click it every 5 seconds. ALL THE TIME
If in developer tools I change the state from the binary_sensor.00000_motion_alarm to on: The flow triggers and works. ALL THE TIME
If I make a flow with only text to be send. This works always, also when the motion sensor has been triggered by onvif.
Now the strange part:
Bot actions are NEVER working when the motion sensor has been triggered by a real event. Truly NEVER.
When the sensor has been triggered by a real event, the snapshot in /screenshot/dahua_snapshot.jpg is ALWAYS updated to the new image.
I want to focus on the first option (saving the file to /screenshot/dahua_snapshot.jpg). If I look in the logging, I get these messages all the time if it fails.
Can anyone point me in a direction where I can solve this? I am just new with Home Assistant, but I can’t wrap my head around what I am doing wrong here.
Hello everyone!
For those who googled this topic and are delving into telegram notifications, I will describe my configuration.
First of all, you must have a telegram bot installed and configured correctly for HA.
That’s my part of configuration.yaml for tg:
telegram_bot:
- platform: polling
api_key: 1234567890:ABCD-01235-ABCDE # fake api, redacted for this message
parse_mode: html
notify:
- platform: telegram
name: Maxim
chat_id: 198765432 # fake id, redacted for this message
Next is setting up automation. This can be done more clearly through the GUI, but below I will provide the code that is obtained in my automations.yaml.
Pay attention to the file paths. Depending on your HA installation, the folder to which the automation has rights to write snapshots may differ. Always check whether an image file is created on a motion event.
The name of action notify.maxim related to lowercased name: Maxim of notify block from configuration.yaml.
This is a part of automations.yaml regarding notifications from my motion alarm automation.
The first action is to take snapshot and saves it to file. The second one is to send this file.