Integration of the /t.json call

Hello,
if I type this into my browser:
192.168.31.223/t.json
it returns this value:

{"thermos":[{"t": 21.6},{"t": 22.0},{"t": 0.0},{"t": 22.0},{"t": 0.0},{"t": 0.0},{"t": 0.0},{"t": 24.5},{"t": 0.0},{"t": 0.0},{"t": 0.0},{"t": 0.0},{"t": 0.0},{"t": 0.0},{"t": 0.0},{"t": 0.0}],"wen0": 39,"wen1": 39,"podcm": -1,"podcmp": -1,"podcz": 105,"podczzas": 66113,"podczdo": 69000,"podgmin": 240,"pod": 0,"co": 0,"cwu1": 0,"cwu2": 0,"cyrk": 0,"ter": 0,"al": 0,"time":727,"ver":"0.1.0.130.32"}

How to automate the call in HA and display the values.
this is the first temperature value:

{"t": 21.6}

second temperature:

{"t": 22.0}

and so on
then there’s the run time in seconds:

"podcz": 105

is it possible to chop it up somehow and make it into individual values - sensors? there are about 33 of them.
Thank you

You can use a rest sensor for getting the data: RESTful Sensor - Home Assistant

About chopping it up i am not sure how as many of the values have the same key.

They are in an array though so:

thermos[1].t for example should give the 2nd value and thermos[2].t the third etc…

1 Like

I know this seems simple, would there be an example please? Something I could continue with?
https://jsonlint.com/

{
	"thermos": [{
		"t": 21.6
	}, {
		"t": 22.0
	}, {
		"t": 0.0
	}, {
		"t": 22.0
	}, {
		"t": 0.0
	}, {
		"t": 0.0
	}, {
		"t": 0.0
	}, {
		"t": 24.5
	}, {
		"t": 0.0
	}, {
		"t": 0.0
	}, {
		"t": 0.0
	}, {
		"t": 0.0
	}, {
		"t": 0.0
	}, {
		"t": 0.0
	}, {
		"t": 0.0
	}, {
		"t": 0.0
	}],
	"wen0": 39,
	"wen1": 39,
	"podcm": -1,
	"podcmp": -1,
	"podcz": 105,
	"podczzas": 66113,
	"podczdo": 69000,
	"podgmin": 240,
	"pod": 0,
	"co": 0,
	"cwu1": 0,
	"cwu2": 0,
	"cyrk": 0,
	"ter": 0,
	"al": 0,
	"time": 727,
	"ver": "0.1.0.130.32"
}

Something like:

  - platform: rest
    name: my_rest_sensor
    resource: http://192.168.31.223/t.json
    value_template: 'OK'
    json_attributes:
      - thermos
      - wen0
      - wen1
      - podcm
      - podcmp
      - podcz
      - podczzas
      - podczdo
      - podgmin
      - pod
      - co
      - cwu1
      - cwu2
      - cyrk
      - ter
      - al
      - time
      - ver

If you then wanted to access one of the sensors - start the count at 0, so in an automation or a template sensor - you would be doing something like this to access the value of sensor 5:

{{ state_attr('sensor.my_rest_sensor','thermos')[4]['t']|float }}
1 Like


Yes it works!!!
I know you wrote it, but I really don’t know.
Can you still help me with maybe the first temperature? So I can get a temperature sensor out of it?