MotionEye, home assistant, camera motion, automation

Ignore me, I just noticed you posted them above in the thread, should have read up, instead of starting at the top :smiley:

This is right…

So, since your solution didnt work, could this be related with the base_url of my configuration.yaml? I have it pointing at my dyndns.

base_url: https://mydyndns.com:myport

I cant figure out why this is not working.

Sorry argykaraz, I have to confirm that my approach isn’t working (anymore?).
I hope someone finds a solution to make it work with token.

has anybody managed to get this to work? all the above does nothing.

@argykaraz and me managed to make it work with “command” instead of web hook.
This goes into motioneye command:

curl -X POST -H "Authorization: Bearer TOKEN" -H "Content-Type: application/json" -d '{"entity_id": "script.yourscript"}'  http://yourip:8123/api/services/script/turn_on
3 Likes

This no longer works since release 0.84, can anybody help?

I get a

401: Unauthorized

returned

HI John,
In your node red flow the exec node does not find the image file(debug) shows “” )and so the msg.payload is not populated. Does this flow work with Hassio?

For those using docker, the developers have added the mosquitto-client to the dev-amd64 image and will work with the HassCasts mqtt command

No need for webhook/token etc

1 Like

I’m running Hassio 0.85.0 and finally I was able to get it to work by using the command below:

curl -X POST https://youraddress/api/services/script/turn_on -H 'Authorization: Bearer TOKEN' -H "Content-Type: application/json" -d '{"entity_id": "script.yourscript"}'

5 Likes

Thank you. Sold. I’ve just subscribed!

Did you ever do that video? I couldn’t immediately spot it.

1 Like

Mr HassCast, shooting way back into the past here, but is this still working for you? I tried but HA isnt making any changes on a motion mqtt command.

i still have no issues with my setup, curl is the way to go. As for ghost motion i’ve noticed a lot of it depended on my camera quality, meaning resolution and fps, also wireless vs wired. here is a picture of my motion settings.

51%20PM

with this setting i dont get a lot of ghost motion, its a crappy camera 3 db antenna

2 Likes

can u send a pic of ur setup to use curl command

I guess ill just have to figure out curl then. Its just not very familiar or readable to me. MQTT I have had more success as I’m all in on Sonoff light switches with Tasmota.

4

Just turn this on and add this from an earlier post:

Replace the script.yourscript with a script name of your choice. You will have to create a script to do something when motion is detected.

1 Like

this is my old post on here, also my setup uses a mqtt to http bridge thats why the binary sensor is mqtt, the curl command is issued to the mqtt service and passed to http or https. In my opinion dont use a script, use the mqtt binary sensor, works great, that way in the future if you figure out mqtt all you have to change is the command in motioneye. Also i believe you should definitely use the run end command so it turns off the sensor once motion has stopped being detected.

Why use curl when you can use mosquitto_pub and just use MQTT? Way easier.

Because MQTT isnt working (well not for me)

I managed to get it working via MQTT. Using this command.

Motion On
curl -X POST \ -H “Authorization: Bearer YOURTOKEN” -H “Content-Type: application/json” \ -d ‘{“payload”: “{“status” :“MOTION”}”, “topic”: “cameras/motion/picam”, “retain”: “True”}’ \ http://192.168..**:8123/api/services/mqtt/publish

Motion On
curl -X POST \ -H “Authorization: Bearer YOURTOKEN” -H “Content-Type: application/json” \ -d ‘{“payload”: “{“status” :“NO MOTION”}”, “topic”: “cameras/motion/picam”, “retain”: “True”}’ \ http://192.168..**:8123/api/services/mqtt/publish

Sensor YAML:

  • platform: mqtt
    name: “PiCam Motion”
    state_topic: “cameras/motion/picam”
    payload_on: “MOTION”
    payload_off: “NO MOTION”

HA is complaining about the payload on/off but ill sort that out later, its still working.