Assuming that the below cURL command (and respective response) in the HA’s terminal:
[core-ssh ~]$ curl --location 'http://192.168.1.2:34400/api/' --header 'Content-Type: application/json' --data '{"cmd": "status"}'
{
"epg.source": "XEPG",
"status": true,
"streams.active": 271,
"streams.all": 271,
"streams.xepg": 271,
"url.dvr": "192.168.1.2:34400",
"url.m3u": "http://192.168.1.2:34400/m3u/threadfin.m3u",
"url.xepg": "http://192.168.1.2:34400/xmltv/threadfin.xml",
"version.threadfin": "1.0"
}[core-ssh ~]$
QUESTION: How do I capture the above streams.active
or streams.all
values as HA sensors; or as a sensor’s respective attributes?
The below code is what I have currently in my configuration.yaml. However I’m missing something fundamental; as, the sensor name: threadfin_active_streams isn’t even recognized in HA’s developer tools:
CODE:
sensor:
- platform: rest
resource: http://192.168.1.2:34400/api/
name: Threadfin active streams
headers:
Content-Type: application/json
method: POST
payload: '{"cmd": "status"}'
json_attributes_path: "$.."
json_attributes:
- streams.active
- streams.all
- streams.xepg
Thank you in advance… I think I’m pretty close; however, I’m not sure.