Is this still working? I have followed the thread to a “T” and I am getting the alert on my Android device, but I am not getting the image. I have changed the pertinent MQTT details and credentials, etc.
I am seeing the image in Node Red under the viewer. According to MQTT explorer, I am getting two items for my camera: alert-image-b64 and alert-image and both contain data.
I think I am close, but not proficient enough to figure out where the problem lies.
@flyinglow and @TheHolyRoger thank you for putting this together! I am setting up my cameras and just updated to Home Assistant 2022.5.5. I am very new at MQTT and HA, so I may be making a silly error. Unfortunately, the entity I have set up to receive the base64 data as an MQTT camera doesn’t seem to register anything. I get a long string sent over via MQTT, but I can’t seem to get any further.
Reading the release notes for 2022.5.5, I don’t see any reference to @TheHolyRoger’s commit. Are we certain that the native b64 decoding has been included in this release? Should the MQTT camera topic be exactly the same as the topic that BlueIris publishes to (no trailing slashes or anything further)? Thanks in advance!
I’m afraid my fix hasn’t been included in the release yet, I was advised it will likely be 2022.6, for now I’ve been manually patching my files which I can show you how to do if you’re on haos or core
Thanks for the quick reply! I wouldn’t want to waste your time on something that you’ve already worked so hard on and will be ready to go in just a couple of weeks. Thank you for offering! If they haven’t added it to 2022.6, I will absolutely take you up on that.
Has anyone tried the json ({"img":"&ALERT_JPEG","db":"&ALERT_DB"} ) to be able to view the clip with @TheHolyRoger’s code? Will that functionality work, by chance?
@TheHolyRoger, since this stuff is still new with me, I have done your patch. If I don’t have to use Node Red, do I now create an automation and look for that MQTT topic and then do something with it?
For some reason, I still can’t wrap my head around it. I guess I am confused as to why your patch works and the other stuff did not???
I have all of that I believe. I am getting the MQTT topics according to MQTT Explorer. I guess where the disconnect is, how does it connect to my phone to show the picture?
You just take a snapshot of the camera to send it to your phone. If you add the camera entity to your dashboard you’ll see the last received image there. Here is my doorbell automation though, triggered when someone rings the doorbell and sends camera snapshot notification to my phone.
alias: Doorbell Notifications
variables:
MSG: Someone's at the door
sequence:
- variables:
file_time: '{{ now().strftime(''%Y%m%d_%H%M%S'') }}'
# Take a snapshot of the camera and save to public http folder
- service: camera.snapshot
data:
filename: /config/www/{{ file_time }}_amcam1_ha.JPG
target:
entity_id: camera.alerts_amcam1
# Notify the phone app for mobile notifications
- service: notify.mobile_app_phone1
data:
message: '{{ MSG }}'
title: Doorbell
data:
channel: doorbell
importance: max
tag: persistent
persistent: true
image: /local/{{ file_time }}_amcam1_ha.JPG
# Notify HA for persistent notifications inside hass
- service: notify.persistent_notification
data:
message: '![image](/local/{{ file_time }}_ac1db_ha.JPG)'
title: Doorbell
I have a separate automation to delete old images, but you can also change the filename and re-use the same file if you’re only bothered about the latest image
Got it working with Android notifications however I get repetitive notifications. I don’t understand. My MQTT in node keeps cycling between disconnected to connecting to connected to disconnected…
Using the same mosquitto addon. Really breaking my system with all the tweak attempts etc. Could it be a QOS setting? I looked at the Mosquitto broker log and get repetitive
New Client connected to XXX.XXX.X.XXX
New Connection from XXX.XXX.X.XXX
Client bi_alerts already connected, closing old connection
Maybe a version issue(5.5.4.1 x64 but I find that odd. Prior to discovering this image option I had all my alerts functioning correctly with MQTT. Its just the images?
I’ll keep playing with the MQTT node as I think it’s that setting.