cmroche / OctoPrint-HomeAssistant

Home Assistant plugin for OctoPrint, enabling MQTT discovery of you device and sensors
110 stars 18 forks source link

Why publish camera configuration? #84

Closed Sennevds closed 2 years ago

Sennevds commented 2 years ago

I saw that this plugin publishes a configuration for a camera entity: https://github.com/cmroche/OctoPrint-HomeAssistant/blob/1cd06aad75a1a525de63d1c6b3a4bf5aed8533fa/octoprint_homeassistant/__init__.py#L922-L930 But the camera image itself isn't published any reason why this configuration is published?

cmroche commented 2 years ago

I thought this sensor generated a URL for the video stream... but it doesn't look like that's the case. I'll have to revisit the docs to make sure we are using this correctly. The image though isn't a video stream, rather just a single image (which I guess could be updated periodically perhaps) or driven by capture events in OctoPrint to update.

bagobones commented 2 years ago

Octoprint has a stream URL and a snapshot URL that you can configure in the core app.. I DO have a manual platform: mjpeg camera that I already use in HomeAssistant for the stream. Not sure if the MQTT plugin publishes those.

Seem like you should be able to grab those values and publish them, they seem to accept relative (default for the stream) and full URLs in octo print so you may have to figure out if you want to figure out the host name or if you want to just have the user enter the "public" full URL for those items.

cmroche commented 2 years ago

The MQTT camera platform is not for configuring cameras it seems. The documentation says that it will only support still images sent as a payload of the MQTT channel which isn't really what I think people have in mind when associating a camera with their setup. Unfortunately, it does not appear there is a way for me to expose the camera automatically through MQTT discovery and it will still need to be manually configured by the user as is shown in the README.md.

I'm removing the sensor since it has no purpose in the mean time.