Ok so i have a network mjpeg.cgi camera im using on motioneyeos. I currently have them added with my configuration.yaml as shown:

   camera 3:
       - platform: mjpeg
         name: Upstairs
         mjpeg_url: http://myip:8081
         username: test
         password: test
  camera 4:
      - platform: mjpeg
        name: Downstairs
        mjpeg_url: http://myip:8082
        username: test

The cameras shows a clip when there is motion, on the home assistant dashboard, then goes back to idle when no motion. I would like to create an automation when it goes from idle to motion detected, how would i go about doing that?

1 Like

If the camera ‘state’ is changing from idle to something else when there is motion, you can use that to trigger your automation

- platform: state
  entity_id: camera.upstairs
  from: 'idle'

awesome ill give that a try, i had tried it before but with from ‘idle’ to ‘on’. I’ll update ya on it!

I tried it with a state trigger and action tts. for both cameras, but its not triggering my action, it does however keep the feed available once it detects motion i guess. meaning it doesnt turn the camera feed from the dashboard back to image not available etc.

- action:
  - data:
      entity_id: media_player.kev_group
      message: Intruder Alert
    service: tts.google_say
  alias: motion
  condition: []
  id: '1516951569581'
  - entity_id: camera.upstairs
    from: idle
    platform: state
  - entity_id: camera.downstairs
    from: idle
    platform: state

Can you go into your history page and see what the state is changing to when motion is detected ?

its really hard to tell, let me do a fresh install and just add the idle automation option.

its not showing anything in history that i can see about the mjpeg stream, but i have a couple things on my dashboard that refer to just upstairs etc…so im changing the alias to see what is what. other than that maybe i can see a tcpdump or something else to capture it since i think its using https.

yeah unfortunately that didnt work heres a picture of my history, just says idle even after ive watched it triggered, theres an option on motioneye for a webhook or a script, so thats probably what ill have to work with, through the cloud and or something, idk… theres got to be something simple maybe an event or something.

What is the brand and model number of the camera. Its possible it has its own API that you may be able to interface with.

oh nice, its the dcs 930 dlink

i found this, idk do you know anything about mqttt broker im really new with this automation and sensors etc.

That would work !
What machines are your running Home Assistant and Motion eye on ?

ok so it works great with curl commands in motioneyeos motion notifications!!