Motioneye integration

This is really awesome!

I’ve been able to easily make my motionEye OS with a USB camera running on an RPi3 separate from my HA RPi installation used as a motion sensor.

Worked great!

Might be good to edit step 5 as follows:

binary_sensor:
  - platform: template
    sensors:
      camera1_motion:
        friendly_name: "Camera - Mouvement"
        device_class: motion
        value_template: "{{ is_state('input_boolean.camera1_motion_detected', 'on') }}"
1 Like

Thanks for this awesome guide.
I didn’t manage to get the binary sensor working.
I verifed that automations
“Motioneye - Camera1 - Motion started” and
“Motioneye - Camera1 - Motion ended” triggered, but the input_boolean is never updated.
What am I missing? Some new requirements since some HA update?

I found the answer in one of my other automations. I need to add data: {} after the service in the action part like this:

- alias: "Motioneye - Camera1 - Motion started"
  trigger:
  - platform: webhook
    webhook_id: motioneye-camera1-started
  action:
  - service: input_boolean.turn_on
    data: {}
    entity_id: input_boolean.camera1_motion_detected

Now everything is working fine.

Thanks for you help on this. That made it work for me.

altho I still have one nasty thing.
When there s motion detected I have 10 sec delay on the webhook command.

therefore making a sanpshot 10sec later …
Did you notice that also?

hello
I have installed motioneye on my raspbian buster pi3b+ and plugged in an old usb microsoft camera.
It works great, i get the stream inside motioneye.
Once i install the motioneye integration on my hassio pi3b+ with:

host: http://192.168.x.xxx:8765
and admin/user credentials

the camera is unavailable and doesn’t receive the stream from the raspbian buster motioneye camera.
What is wrong?
Is it because the host is in http and not https? All access is locally.

Hello all,

If you’re motionEye enthusiast this post announcing a new custom component may be relevant to your interests, and may significantly simplify some of the automations in this thread:

Thanks.

1 Like

Can you please share your motioneye addon config? Here is mine:

motion_webcontrol: true
ssl: true
certfile: fullchain.pem
keyfile: privkey.pem
action_buttons: []
log_level: trace

What am I missing?

Yeh that is the same as mine. So when i want to turn recording on and of I then send a a webcontrol value through a rest command.

  ai_motion_right_side_capture_on: 
    url: 'http://yourip:7999/3/config/set?emulate_motion=on'
    method: get
    
  ai_motion_right_side_capture_off: 
    url: 'http://yourip8:7999/3/config/set?emulate_motion=off'
    method: get

Where do you exactly are you writing this? is this into the motion configuration section of motioneye?

Thank you so much for sharing this!!!

this custom component gives us the binary sensor for using it in automation.

raspi4 with Motioneye server – add-on in home assistant – connected the integration to localhost – all entities are working fine

thank you

btw: I love this community here, always helpful and friendly.

Is there any easy way to get motion detection from particular camera into automation?

Define easy….

I use a webhook from motioneye notification section, which triggers an automation in HA

yes, I have noticed it, but what to put in there webhook url?

so you enter something like:
http://your-home-assistant:8123/api/webhook/some_hook_id
type will be ‘post(query)’

and then create a trigger for it:

automation:
  trigger:
    - platform: webhook
      webhook_id: "some_hook_id"

I’m trying to use webhook to trigger event from my camera (motioeye) but can’t get it working:

alias: 'Auto Terace Lights '
description: Automaticaly switch light on terace from terace ptz camera motion notification
trigger:
  - platform: webhook
    webhook_id: terace
condition:
  - condition: time
    after: '18:00'
    before: '09:00'
action:
  - service: switch.turn_on
    target:
      entity_id: switch.terrace_lights
  - delay:
      hours: 0
      minutes: 5
      seconds: 0
      milliseconds: 0
  - service: switch.turn_off
    target:
      entity_id: switch.terrace_lights
mode: restart

and in motioneye I have done:
image
where address is: https://myhomeassistant:8123/api/webhook/terace

Time is 05:00 AM
Why is it not working?

two // just before api?

does not work even with one, that is typo

Do you have ssl set up? If not it is plain http://

ssl set up and works both from local address and from remote through duckdns HTTPS://

OK what happens when you run the webhook from curl?