I’m trying to retrieve an HLS access token or stream URL like the one on the front-end/loveplace. My camera does not have any rtsp or other video streaming locally, but with the use of Tuya integration I am able to get the stream. But I would like to access camera stream outside of Home Assistant. So far I am able to get thumbnail but I want stream or HLS access token:
from websocket import create_connection
import json
ws = create_connection("ws://ip:8123/api/websocket")
result = ws.recv()
print("Received '%s'" % result)
ws.send(json.dumps(
{
"type": "auth",
"access_token": "eyJ0eXAiOiJKV1QiL(...)Awu7cxLodelRXCOZFtXABMQ7fReEXLbvxtUHY1c"
}))
result = ws.recv()
print("Received '%s'" % result)
ws.send(json.dumps(
{
"id": 19,
"type": "camera_thumbnail",
"entity_id": "camera.videokamera"
}))
print("Received '%s'" % result)
ws.close()