psyciknz / CameraEvents

Dahua NVR/Camera Alerting to MQTT. Fairly specific to my needs, but also an attempt at starting to use travis.
Eclipse Public License 2.0
58 stars 19 forks source link

Configure Home Assistant to receive image #11

Open goermezer opened 4 years ago

goermezer commented 4 years ago

Do anybody know, how I have to configure home assistant to receive the image, which is sent by CameraEvents?

My Payload looks like documented:

{"message": "IVS: Dahua3: CrossRegionDetection", "imagebase64": "/9j/4AAQSkZJRgA..."}

My configuration:

camera:
  - platform: mqtt
    topic: CameraEvents/Dahua3/Image
    name: my mqtt camera image

When the image is sent by CameraEvents, the sensor in home assistant shows idle the whole time and nothing is logged. I think, I have to reference the imagebase64 attribute. But I don`t know how. Anybody have success with a camera mqtt sensor in home assistant?

psyciknz commented 4 years ago

Not sure. I use MQTTwarn for picking up the payload and pushing the image to pushover. I’ve not tried home assistant.

You’d need to grab the payload, and base64 decode it. Maybe ask on home assistant forum or discord?

bryeartem commented 4 years ago

@goermezer in Home assistant just make an mqtt binary sensor and make an automation to send a snapshot when the binary sensor is triggered.. it has been working great for me! (Until I moved my my install to a new computer and forgot to copy my setup for this :() now trying to get it set back up how I had it. @psyciknz thanks for your time, your work is appreciated

psyciknz commented 4 years ago

Does/can home assistant grab the image from the mqtt payload? Or do you something else to view the image after the binary sensor asks for the snapshot?

I use mqttwarn to pushover and slack myself.

bryeartem commented 4 years ago

There is a component called “mqtt camera” in home assistant that could, but I do not use that. It all happens fast enough that home assistant takes the snapshot using its own stream of the cameras I already have in there using ffmpeg/RTSP stream

bryeartem commented 4 years ago

I actually tried to teach myself python just to turn this into a home assistant component.. it didn’t go well,.. nonetheless, someone finally made something similar to get the events but it unfortunately doesn’t support the multiple channels of the NVR so this little baby has been vital to my setup.. thanks again!