How do you manually configure and display an Mqtt camera in Lovelace that has no unique id

I am aware of the dreaded “no unique id” problem when using manually configured items in config.yaml that prevents their use of the ui to configure Lovelace. The question is how do you display the camera images if you cannot use the ui to configure Lovelace? Maybe its impossible to display a manually configure Mqtt camera? Here is my manual config for the camera

# setup mqtt camera 
mqtt:
  camera:
    - topic: homie/mac_webcam/capture

Thanks in advance

To answer my own question…
It seems that you can get an Matt cam for which settings can be edited in Lovelace

This configuration allows this

# setup mqtt camera 
mqtt:
  camera:
    - topic: homie/mac_webcam/capture
      name: mqtt_cam
      unique_id: camera.myownmqttcam
      image_encoding: b64

Note that when adding the camera to Lovelace you use the entity camera.mqtt_cam . the unique_id is not visible when editing the UI but I assume its necessary. As per the docs if you don’t specify an image_encoding it assumes binary bytes as a default.

1 Like