I am looking for a sensor that can extract data from a JSON stream. I am getting this JSON stream from a wireless speaker (BeoPlay M3). It streams events like changes in volume, source, etc. without delay. In a first step I want to display these real-time information as one or multiple sensors on the Home Assistant frontend.
I can view the stream outside Home Assistant using a curlGET request. Single events look like this ("muted" changed):
Is there a sensor or component that can directly or using curl receive and analyse the stream and feed values of selected keys (e.g. id, type or level) to single sensors?
Update of sensor.streamdata_test_1 is taking over 10 seconds
19:49 core.py (WARNING)
I assume that the command_line sensor has a defined order of processing by requesting data -> receiving data -> extracting values -> putting those in Home Assistant pipeline, repeating periodically at scan_interval.
The difference with a JSON stream is that the response has no end, hence the command_line sensor timed out. Instead, analysing and extracting has to take place each time a new part of the response comes in. Which sensor could do this?
I don’t know of a sensor that would run, or read a connection continuously, but you could try run the command externally and redirect the output to a file. Then use the file sensor to read the file