Filipowicz251 / mijia-1080P-hacks

434 stars 66 forks source link

New request: Camera still image (http) #12

Open aferraz opened 6 years ago

aferraz commented 6 years ago

Hi, it's possible to add a web server returning a still image from the camera ? Something like http://IP_OF_CAMERA/image.jpg

I would like to use this camera in homeassistant automation software. With a still image I can make an automation where I could send the image via Telegram, for example, in case motion is triggered.

Thanks Alessandro

willthrom commented 6 years ago

I don't see any reason you couldn't implement that. Usually a short video it is more useful for motion detection thought

aferraz commented 6 years ago

You are right mut at the moment homeassistant don't support videos on Telegram notifications.

itanczos commented 6 years ago

@aferraz HomeAssistant handles RTSP stream via FFMPEG.

aferraz commented 6 years ago

@itanczos I know but I don't find a way to send it via push notification.

bartvollebregt commented 6 years ago

I would love to see this implemented. I would then be able to easily integrate it in my OpenHab2 installations without having to do rtsp > jpeg conversions with ffmpeg....

willthrom commented 6 years ago

Having in the camera a software running a webservice publishing Image on Demand is possible but it involves quite a lot of work and I don't think someone will implement it..

The real problem is what imagine you want to publish? Whatever is there? What value has that?

I could understand a motion event triggered and the camera send that notification (Image, like upload the video/image to FTP server or send an email). Again, a lot of work. Currently I am personally focusing in an proper RTSP Server.....

@aferraz Change the issue name to something more meaningful please.

bartvollebregt commented 6 years ago

@willthrom I think something like this was implemented in one of the other xiaomi camera hacks. I'll try to find it.

They way it works is that its just a web server running on an url like http://yourip/image_latest.jpg

Everytime some does a request it will capture an image and put in on a webserver on the camera so image_latest.jpg is always the latest image.

kollaesch commented 6 years ago

@bartvollebregt How about this: I'd prefer to this keep this slim. So having a custom_component|scriptin hass would be an alternative.

check here

aferraz commented 6 years ago

I use a script in HA and it work. In my case the camera is the problem. Sometimes after a reboot it remains with the orange led on and is unreachable.

AndBaetz commented 6 years ago

Would be really cool for openHAB2 to have that implemented.

bgeneto commented 5 years ago

I would love this feature as well because Domoticz only have support for http (or https) still images. In other hacks, like fang-hacks, this feature is relative easy to implement but with this present hack for mijia I'm completely lost... Any tips? I see that there is an option to turn on http server, just don't know how to generate jpg still images every second.