I would like to receive a notification on my phone when ringing the portal

My goal

I would like Home Assistant to send me on my phone the photo of the camera filming the entrance to my house when someone rings the doorbell.

My prerequisites

Obviously, to achieve this, there are several necessary prerequisites:

  • Integration SIP-HASS since my doorman is in SIP, I will therefore use it to detect the change in status of the doorman line.
  • Integration MJPEG IP Camera which recovers my camera feeds but any other camera integration will work.
  • Integration PushOver which I have been using for a very long time and which is my instant messaging dedicated to home automation but any other notification integration should work.

I'm checking how to get a snapshot of the camera.

To send the image of the camera via PushOver, I must have it on a local jpg file, ideally, I store it well. So I test the service camera.snapshot

Service: camera.snapshot data: filename: /media/cameras/cars/last.jpg target: entity_id: camera.camera _cars

The camera that displays the bell view is the _cars camera. I was surprised by the simplicity of creating a camera folder and then cars in media! It was Ha who managed everything, I had nothing to declare, the first launch of this service created the files and made the snapshot!

I realize my Automation

alias: We ring the doorman description: "" trigger: - platform: state entity _id: - sensor.100 _state from: null to: In use condition: [] action: - service: camera.snapshot data: filename: /media/cameras/cars/last.jpg target: entity_id: camera.camera_cars - service: notify.information data: Message: We're ringing the title doorman: We're ringing the data doorman: sound: tugboat attachment: /media/cameras/cars/last.jpg mode: single

This automation is triggered when the sensor.100 _state entity, which corresponds to line 100 SIP, i.e. my doorman, switches to ‘In use’, i.e. is used.

First, you have to generate the snapshot and then send the "information" notification that is programmed in PushOver.

I test the result

I ring the doorbell and instantly receive a message informing me that the doorbell has been ringing and a photo.