But as you can see from the screenshot I cannot create attributes as expected ,neither trying to change the path of Json.
the error log reports:
* TemplateError('UndefinedError: 'None' has no attribute 'records'') while processing template 'Template("{{ state_attr('sensor.termo_status', 'termo1')['records'][0]['dato1'] }}")' for attribute '_attr_native_value' in entity 'sensor.termo1'
* TemplateError('UndefinedError: 'None' has no attribute 'records'') while processing template 'Template("{{ state_attr('sensor.termo_status', 'termo2')['records'][1]['dato1'] }}")' for attribute '_attr_native_value' in entity 'sensor.termo2'
From the screenshot your ‘status’ sensor has no (well: 1) attribute so the template sensors won’t work logically. try using: states(’… instead…sorry to be short but leaving office… just my 2cts, can look more tomorrow
Hi
tried your suggestion, but states or state_attr did not change the current result
it seems that anything I do will probably not affect missing attributes just because home assistant did not create them.
I thought it was due to a wrong conversion from xml to json but the strange thing is that if I change the value template to
I believe it is not a ‘neat’ json, I got errors with incorrect characters, strings not being used in json (although I did a to_json first)… might also be that the rest sensor has a bug as … what you noticed… it does mostly work in devtools.