Motioneye integration

No idea how to use curl, I run on HASSIO

I assume you mean HASSOS. Hassio no longer exists.

Presumably uoi have a computer other than your home assistant? curl is cross platform. Otherwise ssh into your hassos.

yes, that is right, what to do next?

I’m using the Core MotionEye integration. Occasionally when switches for Motion Detection or movies are toggled they switch back to the previous state in 30-60s. A few others have noticed the same thing in this thread but no solution is noted.

Has anyone fixed this issue?
Is this issue present in the more featured rich HACS custom integration?

I have the same problems sometimes the detection goes “ACTIVE” and motioneye starts the recording…

Is possible solve it?

I recently started using motionEye and I just wanted to understand if there was a reason everyone seems to still be opting to use input booleans and automations when there is now a method to have template binary sensors turn on via an event? I’ve set up the below via the motionEye integration and it is working perfectly for me - No need for any automations, just a template binary sensor…

template:
  - binary_sensor:
      name: HiLook Driveway Motion (motionEye)
      state: "true"
      device_class: motion
      auto_off: 10
    
    trigger:
      platform: event
      event_type: motioneye.motion_detected
      event_data:
        device_id: abcdefghijklmnop1234567

Hopefully this helps someone in the future or someone will come along and tell me why people haven’t opted for this method :wink:

EDIT: I’m aware that this functionality was only introduced in 2021.5 so the original guide was valid at the time of writing, just curious why people have not moved over to this method since then.

6 Likes

That’s a brilliant solution! I spent last three night to understand why motioneye doesn’t send mqtt commands. Now I changed to this approach and everything works flawlessy.

1 Like

I’m glad I could help! :smiley:

I couldn’t make it work having the binary_sensor following the template header.

template:
  - trigger:
      - platform: event
        event_type: motioneye.motion_detected
        event_data:
          device_id: !secret garage_camera_id

    binary_sensor:
      - name: Garage Motion
        auto_off: 10
        state: "true"
        device_class: motion

Just for completeness, as it took me ages to get it to work. device_id can be copied either from the end of the Web Hook URL in motioneye > Motion notification. That’s provided you’ve used the HA UI integration approach (i.e. not yaml integration).

Or you’ll find the device_id under the configured integrations, once added into HA. Look to the URL of your home assistant i.e. https://myhomeassistant.xyz:8123/config/devices/device/deviceid

Hope it helps.

That’s odd, I can’t see why having trigger or binary_sensor first would make a difference :thinking: Glad the swap fixed it though!
Apologies, I actually posted the info on the device_id on another thread but didn’t include the same information here :man_facepalming:

1 Like

That’s all good. The more info on this the better. Whilst searching for a solution, I really couldn’t find much up-to-date information on Motioneye by using the front-end integration.

Just as an aside, did you manage to split up the binary sensor config in your configuration.yaml, if you do split your files? I’ve tried several approaches and can’t get past the validator.

I’ve managed to split it with no issues - I’ve done the following:
configuration.yaml:

...
template: !include_dir_list templates/
...

Within the templates directory I have a folder for each template type eg. templates/binary_sensors and templates/sensors/ and then within those folders I have the templates in individual files - Using the Motioneye binary sensor as an example: templates/binary_sensors/driveway_motion.yaml and that file looks like my example above without template: at the top level ie.

binary_sensor:
  name: Driveway Motion (motionEye)
  state: "true"
  device_class: motion
  auto_off: 10

trigger:
  platform: event
  event_type: motioneye.motion_detected
  event_data:
    device_id: abcdefg12345
2 Likes

That does work! :wink: :partying_face:

I so wish this was better documented. I can’t be the only one struggling with this. Thank you for your help!

Really? Splitting up the configuration - Home Assistant

1 Like

I’m not sure if this will help anyone here, but I read in a post (Reddit I think) that you need to put a mask over the time/date stamp on the cameras for motion detection not to continuously detected as this can break the webhook and motion will not be reported properly in HA. I have done this with a notification automation and seems to work quite well.

Michael