Access PV Forecast from Pyscript

I am looking for a way to access the hourly PV Forecast from Pyscript? Unfortunately, the hourly data is not provided as sensor or sensor attributes…

Does anyone have a tip?

In general, can I retrieve the data via the websocket interface. ({“type”: “energy/solar_forecast”})
Does anyone have any idea how I can access a websocket from pyscript?
Or is there an other way?

I currently using Nodered to request the data via websocket und making the available as a sensor. I’m sensor. I’m hoping for a simpler possibility without Nodered.

at least I was able to retrieve the forecast via websockets from pyscript in the meantime

token =  "xxxxxxxxxxxx"
host = "192.168.2.xxx"
port = 8123

import asyncio
import websockets
import json

ws_server_url = f'ws://{host}:8123/api/websocket'

async def fetch_forecast():
    async with websockets.connect(ws_server_url) as websocket:
        log.info(websocket.recv())
        await websocket.send(json.dumps({"type": "auth", "access_token": token}))
        log.info(websocket.recv())
        await websocket.send(json.dumps({"type": "energy/solar_forecast", "id": 2})) #list dashboards
        return websocket.recv()
        
cfg = json.loads(fetch_forecast())

Looking for the same! Did you manage to find a nicer solution?