Looks like you are attempting to use the zoneminder component with MotionEye. This won’t work. You will need to install zoneminder from https://www.zoneminder.com/, or integrate your cameras in a different way.
For some reason I was under the impression that MotionEyeOS was a convenient wrapper for ZoneMinder…wonders never cease.
Anyway, I did get the stream to show up from MotionEye using the generic MJPEG component. That works fine, but I was hoping to use the motion sensing stuff for automation. Oh well.
I have an SD card with ZoneMinder and one with MotionEyeOS. Maybe MotionEye support will be added some day. Until then, I can try to figure out ZoneMinder.
MotionEye (and by extension MotionEyeOS are a convenient wrapper for motion, which is perhaps where your confusion has arisen.
Glad you got the camera feed working. MotionEye supports webhook outputs, which you might be able to use to call into the HASS API. In addition the underlying motion software can run arbitrary commands, which you can use to integrate with HASS via MQTT (mosquitto_pub) or HTTP (curl).
I’d be interested to know how well ZoneMinder performs on a Pi. I’ve used both MotionEye and ZoneMinder and ZM definitely uses more resources (but then it does more).
The question is how to get the sensor to return to the off state, since I don’t think MotionEye will alert you when the motion event finishes. You could do this with an automation which just resets the state after a few seconds.
Yeesh, well it seems that MotionEyeOS follows the “just enough OS” philosophy and has a read-only file system. Meaning that mosquitto_pub is not an available command. Nor, for that matter, are things like, ya know, Apt.
I think it’s ridiculous how an OS that can run on a toaster is just too much for some people.
But curl is installed. So I guess I should figure out how to use that as well. I know how to use Curl to download things from websites, but that’s about it.
I did sort of get the Curl command to work as well. The important lesson for me was that you don’t have to add anything to configuration.yaml when using HTTP components.
This is the Curl command I entered in MotionEye under the “Motion Notifications” tab:
The problem with both of these approaches (MQTT and Curl), as @robconnolly said, is that the sensors just stay at “ON” forever after motion is detected. So I either have to figure out how to use that Python script that @DrJeff linked to, or find some other solution if there is one.
I previously handled this by making the sensor a momentary trigger with minimum trigger time.
This was enough for me to create automation based on motion from cameras.
Create Script that makes Sensor ON>>wait 5 seconds>>sensor OFF for example
set motioneye to trigger this script upon motion detection
This allows you to track how often motion is triggered
You may go one step further and replace timeout with something into script to verify if motion event is still occurring.
in the Motion Notifications field, but neither of these things appear to change the state of the sensor when there’s motion, even though I can trigger the state manually by executing the exact same commands from the terminal.
I still have the same problem after adding the full path.
Shinobi looks pretty cool. Uses FFMPEG, which HA clearly supports. And that video is adorable. Not sure if it will run on a Pi though. That’s kind of my own fault. I need a grown-up computer.
OK. I had to reboot MotionEye for some reason because the MJPEG stream started messing up as well. Now the motion sensor works and I have my first working automation:
- action:
- alias: light.studio
data:
entity_id: light.studio
service: light.turn_on
alias: Turn on light when I enter studio
id: '1499546682238'
trigger:
- entity_id: binary_sensor.studio_motion
from: 'off'
platform: state
to: 'on'
so what do i need for a command or webhook to send to google homeassistant text to speech alert? i have motioneyeos on a raspberry pi 2, i might just install motioneye on top of stretch with pihole though or something, but i also run another raspberry pi 3 with hassbian.