Has anyone had any luck in getting motion eye to send a command to HA using a Token? I just get a authentication error.
When I ran the command from my motioneye device I had a few āCould not resolve host:ā errors. I was able to resolve these by removing any spaces from the parts of the command that had quotation marks. The only remaining error is āinvalid character in headerā. Iāve copied and pasted your curl command and just changed the relevant information, so I canāt see where the problem is.
@kingphil123 I have been able to achieve the desired result with a Webhook though.
https://[HomeAssistantIP]:8123/api/webhook/[Some Number]
HTTP Method - POST (form)
You can then trigger an automation with a webhook referencing [Some Number].
Iāll try and discover what the invalid character in the curl command is and Iāll post here if I find out what the problem is.
- āCould not resolve hostā usually means DNS error. Are you by any chance trying to do this through the internet? I mean, do you use any ddns services (instead a local IP) to execute the command? You should be using the internal IP of your HA instance, for example the IP should start by 192.168ā¦
- Invalid character, could be a bracket. Have you removed them all?
- Copying the code from this forum has caused me some errors in the past with the quotes. Make sure to copy the command in a notepad and delete and REwrite the quotes (single and double), and then paste this in the terminal.
Hope some of the above helps.
It was the quotes! It always seems to be the basics that catch me out.
Thank you for taking the time to resolve this @argykaraz, very much appreciated.
Iāve installed the motioneye add-on. Do I still have to use the REST way for communication with HA or is there a direct way integrated in the add-on?
Hi
Thank you for your the above work.
Iāve got issue on motion detection. i have to move the camera then the motion detected and if I wave, it doesnt trigger the motion detector. im using esp32cam.
and also when it trigger it take about 21seconds to activate thedetector.
thank you for your help.
Hey,
Thanks for your detailed explanation!
Howevever, I am very bad at this as I canāt get it to work.
Here is the command I tried:
curl -X POST -H āAuthorization: Bearer eyJ0eXAI3NMEACMUIYLsā \ -H āContent-Type: application/jsonā \ -d ā{āstateā: āonā, āattributesā: {āfriendly_nameā: ācameraā}}ā \ http://192.168.1.xx:8123/api/states/binary_sensor.camera
I did reduce the size of the token here. Y the way is there an easy way to test the command outside of motioneye?
try replacing ā and āā like this -
curl -X POST -H āAuthorization: Bearer eyJ0eXAI3NMEACMUIYLsā -H āContent-Type: application/jsonā -d ā{āstateā: āonā, āattributesā: {āfriendly_nameā: ācameraā}}ā http://192.168.1.xx:8123/api/states/binary_sensor.camera
If you have CURL installed on a pc you can try it from the command line
Hello everybody,
Maybe one of you can help me.
i would like to make the motioneye webcontrol functional.
I use a RPi 4 where HA runs on it with the addon motioneye.
when I enter the ip the motoneye page is displayed, but the camera stream is not.
no matter whether in the browser chrome, edge, opera.
what and where do i still have to do so that the webcontrol works?
my intention is to link HA and motion via curl.
Thank you.
This method worked for me perfectly.
This is awesome, exactly what I was looking for so thank you!!
I have a quick question, I set this up and can successfully take a snapshot and have it send it to my phone and have it saved on homeassistant but is there a way to have it continually take snapshots and save them to homeassistant without overwriting the original snapshot? Iām looking to do this with recording motion as well.
Also in MotionEye do you have any settings enabed in terms of uploading snapshots and movies?
Iām looking to write a script that pulls the saved videos and snapshots from that directory for that day and save them onto a hard drive via smb.
Hi Everyoneā
First post on here and itās to say thank you for explaining this method, got MotionEye integrated into Home Assistant really quickly after reading argykanaz post, thanks again. Works a treat if anyone else s trying to do the same.
Hey, I just tried this integration with a single network camera, I get a device in HA but no camera entity, any help appreciated.
Hi,
I donāt understand how to just add the motion sensor from the motioneye. everything is installed and I have all my network cameras, but cant sees
Anyone know whats the solution?
any option to add an actual motion sensor to the areas the cameras are placed.
Iāve just set up motionEye @heiblum and used the below method to get the motion sensor (as it isnāt set up by default)ā¦
- Set up the motionEye intregation (if you havenāt already)
- Find the integration in Configuration > Integrations & click āConfigureā
- Make sure āConfigure motionEye webhooks to report events to Home Assistantā is selected
- Now you need to find the Device ID, the easiest way to do this is to go into motionEye, select the camera you want motion detection for and go to the āMotion Notificationsā settings. Home Assistant will have auto-configured a webhook URL for the integration to use - Copy and paste this sting into a simple text editor (notepad, notes on your phone etc.)
- The very end of the string will have ā
device_id=
ā - Copy the string after the = sign, this is the device id!
- Create a template binary sensor with the below configuration, making sure to add your device id - I wonāt rehash whatās already in the documentation in this thread on how to set these sensors up, just go here to see documentation on template sensors using triggers and the configuration of them
template:
- binary_sensor:
name: NAME FOR THIS MOTION SENSOR
state: "true"
device_class: motion
auto_off: 10 # This turns the sensor off automatically after 10 seconds, you can change this if you so wish
trigger:
platform: event
event_type: motioneye.motion_detected
event_data:
device_id: YOUR DEVICE ID
Hopefully this helps
go to motion eye , select the camera you want to configure and scroll to the bottom of the config pane. THere is category called āstreamingā enable it
This totally worked for me BTW. THANK YOU!!!
It gets hard to follow the thread with so many varying methods. It was very kind of you to put it together in one cohesive post.
Adjusting the light sensitivity setting pretty much cleared all the false triggers throughout the day for a camera in the staircase with window.
Hey, just a quick word of warning. The template config doesnāt work, HA flags it as wrong if you copy paste as is.
If you are able to share the error you get then I can work out whatās going wrong. It may be the integration has changed since I wrote the above
ths one was most simple for me and works geat