Good morning,
Here’s my goal: I want to get push notifications when a person is detected by my reolink camera at the front door, with a snapshot of the camera displayed in the notification, when my home assistant companion app is connected over SSL to my home assistant instance.
This works absolutely fine when my companion app is connected directly to my home assistant instance, without SSL.
When connected through the reverse proxy at https://ha.mydomain.com, I get the notification but the attachment doesn’t come through.
nginx is a new addition to my homelab. Prior to that, SSL was configured directly on home assistant, and I had intermittent issues with attachments. Sometimes they would come through, sometimes they wouldn’t. The notification itself would always come through.
I looked into the logs and searched for the name of my automation but nothing related would come up. Not sure what I should be looking for.
My setup:
I have 2 RPI 4. One is running my home assistant instance and the other one is running nginx with a reverse proxy to ha.mydomain.com, where SSL is enabled. Here’s my nginx config file:
server {
listen 80;
server_name ha.mydomain.com;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
server_name ha.mydomain.com;
ssl_certificate /etc/ssl/mydomain.crt;
ssl_certificate_key /etc/ssl/mydomain.key;
location / {
proxy_pass http://ip.home.assistant.instance:8123;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header X-Forwarded-Host $host;
}
}
Here’s the automation that detects someone at the front door and sends the notification with an attachment:
alias: Notification - Front Porch - Human Detection
description: Sends notification to my phone if someone is detected at the door
trigger:
- type: turned_on
platform: device
device_id: 092524197ea1fcdbc21a116f6cf7886d
entity_id: 99abd7ebd2ee2ddeea766132c19e732b
domain: binary_sensor
condition: []
action:
- service: camera.snapshot
data:
filename: /config/www/snapshot.jpg
target:
device_id: 092524197ea1fcdbc21a116f6cf7886d
- service: notify.mobile_app_pixel_7_pro
data:
message: Someone is at the door
title: Ding Dong!
data:
image: /local/snapshot.jpg
mode: single