Hello!
I am stucking on a python script for publish an image via MQTT. The image is generated by pyscreenshot and published to the broker successfully:
def get_value(self):
im = ImageGrab.grab()
im.save('C:\python\psmqtt\screenshot.jpg')
#buffer = im.tobytes("raw", 'RGB')
f = open('C:\python\psmqtt\screenshot.jpg', 'rb')
imagestring = f.read()
#byteArray = bytes(imagestring)
byteArray = bytearray(imagestring)
return byteArray
But the screenshot is not being displayed in HA. Topic is correct, MQTT is storing the image. But neither converted to bytes or bytesarray is displaying the image. What I am missing for the MQTT Camera component? I‘ve searching for more infos for which kind of data must be saved in the topic for displaying the image over mqtt, but found nothing.
Please help!