onfoot / homebridge-valetudo-xiaomi-vacuum

A Homebridge plugin for Xiaomi/Roborock vacuum cleaners running Valetudo
MIT License
31 stars 9 forks source link

Check whether it's viable to expose Vacuum's map as a HomeKit camera #2

Closed onfoot closed 4 years ago

onfoot commented 5 years ago

One would need to be able to create a single-digit-fps MJPEG stream from images generated either by I can't believe it's valetudo or the plugin itself, then dump it using ffmpeg to HomeKit.

onfoot commented 4 years ago

I finally got around to toy with this and succeeded. The setup is:

  1. An mqtt broker running on my home server. hmq in my case.
  2. Vacuum set up to connect to said mqtt broker.
  3. I can't believe it's valetudo running on my camera server, with webserver enabled, running on port 3030.
  4. homebridge-camera-ffmpeg installed on my camera server's homebridge, properly configured.
  5. Camera added to Home.

homebridge-camera-ffmpeg config:

{
      "name": "Vacuum",
      "videoConfig": {
        "source": "-loop 1 -i http://localhost:3030/api/map/image",
        "videoFilter": "pad='ih*16/9:ih:(ow-iw)/2:(oh-ih)/2',scale=1920:1080",
        "maxFPS": 5
      }
}

Looks cool!

heberlej commented 2 years ago

Would you please a step by step guide, this would be awesome :)