I am new to home assistant and have run in to my first hurdle. My most important integration is reading State of Charge from my Battery Management System on my local network.
I had hoped to use Scrape integration to pull the information from the http page, but it is dynamic data so beautifulSoup based tools only get the placeholder, not the real values updated by javascript.
I can see the page uses a websocket ws://localnetworkIPaddress/ws broadcasting two JSON responses every second, I can get these remotely using Postman.
Now my plan is to define a sensor as a python script using asyncio and websockets libraries.
Three questions
(1) have I missed some existing integration that reads websockets or a simpler method?
(2) has anyone got a similar sensor script I can use as my starting point?
(3) where does the sensor refresh belong, (a) defined in home-assistant somehow and my python script runs, prints and exits or (b) in the python so the script prints output every time it processes a JSON response and runs continuously?
Hoping for some wisdom of the community before I start learning new (to me) language and libraries.
Now I am up to catching and parsing my json response
Edit 2; then I moved to my home-assistant docker and remembered that adding tools to an image is not good practice so it is worth spending a bit more time trying to get this with the built in cURL
Edit 3: all my problems with cURL were my network vLANs, it really is as simple as