Hi all,
I´m changing this topic because I now trying with Restful to get the attributes out of my file.
All I want to do is get system, channel 1-8 and pitmaster out of follwing json file:
{"system":{"time":"1527327597","soc":31,"charge":false,"rssi":-89,"unit":"C"},"channel":[{"number":1,"name":"KT-BEEF","typ":3,"temp":83.90,"min":10.00,"max":92.00,"alarm":1,"color":"#0C4C88"},{"number":2,"name":"PIT","typ":1,"temp":109.00,"min":80.00,"max":140.00,"alarm":1,"color":"#22B14C"},{"number":3,"name":"Kanal 3","typ":1,"temp":999.00,"min":10.00,"max":150.00,"alarm":1,"color":"#EF562D"},{"number":4,"name":"KT-PORK","typ":1,"temp":79.70,"min":10.00,"max":92.00,"alarm":0,"color":"#FFC100"},{"number":5,"name":"Kanal 5","typ":1,"temp":999.00,"min":10.00,"max":45.00,"alarm":0,"color":"#A349A4"},{"number":6,"name":"TempAussen","typ":1,"temp":26.70,"min":10.00,"max":35.00,"alarm":0,"color":"#804000"},{"number":7,"name":"GR","typ":3,"temp":113.80,"min":80.00,"max":130.00,"alarm":0,"color":"#5587A2"},{"number":8,"name":"Kanal 8","typ":0,"temp":999.00,"min":10.00,"max":35.00,"alarm":0,"color":"#5C7148"}],"pitmaster":[{"id":0,"channel":2,"pid":2,"value":100,"set":110.00,"typ":"auto"},{"id":1,"channel":1,"pid":0,"value":0,"set":50.00,"typ":"off"}],"api":{"version":"2"}}
I tried with following:
sensor restful:
-
platform: rest
name: JSON Channel 1
resource: http://192.168.0.29/data
value_template: ‘{{ value_json.channel.0 }}’
json_attributes:- name
- temp
-
platform: template
sensors:
name:
friendly_name: ‘Name’
value_template: ‘{{ states.sensor.json_channel_1.attributes[“name”] }}’
temp:
friendly_name: ‘Temp’
value_template: ‘{{ states.sensor.json_channel_1.attributes[“temp”] }}’
any hint would be very appreciated. I tried several hours and days now.
Thanks
Philipp