Does anyone have a working example of sending a text with a camera snapshot to their cell phone? I would like to see the picture inline in the email so it will display inline for the MMS message.
I have reviewed SMTP/notify docs as well as camera and snapshot docs, but cannot figure out the html part to send the image inline, not as an attachment.
Yes, but the details will have to wait until I’m at my computer.
1 Like
ha_time
February 7, 2020, 12:15am
3
I figured it out. If anyone gets an error that says unable to determine mime subtype, use imagmagick to convert the jpg to jpg. Fixed my issue.
Here is an example.
Sure
Here’s for everyone else.
shell_command:
camera_wget_convert: sh /config/camera_wget_convert.sh
Use this action in an automation:
action:
service: shell_command.camera_wget_convert
Script file in Home Assistant folder:
10.0.1.2:8123 is my Home Assistant. 127.0.0.1 does not seem to work.
camera_wget_convert.sh
#!/bin/bash
wget -q -O /tmp/camera_forhave.jpg http://10.0.1.2:8123/api/camera_proxy/camera.forhave
wget -q -O /tmp/camera_kontor.jpg http://10.0.1.2:8123/ap…
I ended up not using html to send the image inline for MMS. I used the normal smtp notify config with image attachment.
tmjpugh
(Tmjpugh)
February 7, 2020, 2:06am
4
I previously did this.
Will try to find the automation
Glad you got it working. Sorry I didn’t provide the details earlier. Just for reference, below are the pieces of what I did.
homeassistant:
whitelist_external_dirs:
- /home/homeassistant/.homeassistant/snapshots
notify:
- name: sms
platform: smtp
server: !secret notify_snd_email_server
sender: !secret notify_snd_email_username
username: !secret notify_snd_email_username
password: !secret notify_snd_email_password
recipient: !secret notify_mms_address
script:
snapshot:
sequence:
- service: camera.snapshot
data:
entity_id: camera.XXX
filename: /home/homeassistant/.homeassistant/snapshots/XXX.jpg
- delay: 4
- service: notify.sms
data:
title: Motion
message: Motion
data:
images:
- /home/homeassistant/.homeassistant/snapshots/XXX.jpg
I use Amcrest cameras and the JPEG images they output work as is in the e-mail, which ultimately goes to my phone via MMS because the recipient e-mail is of the form: [email protected] .