Hiya - I’m looking for a bit of help with a rest sensor. I’ve configured it like this:
- name: "REST Tv Input Source"
json_attributes_path: "$.components.main['samsungvd.mediaInputSource'].inputSource"
value_template: "{{value_json.components.main['samsungvd.mediaInputSource'].inputSource.value}}"
json_attributes:
- "timestamp"
The value pulls out correctly but the timestamp does not get put into an attribute. The log error I get is that JSON result was not a dictionary or list with 0th element a dictionary - but I can see that’s not the case when using jsonpath. The problem seems to be that the dictionary key has a . (period) in it, and this is breaking something on the json attributes path.
Another sensor against the same API, that works almost the same way, but just doesn’t have a dictionary key with a . works exactly as expected:
- name: "REST Tv Channel Name"
json_attributes_path: "$.components.main.tvChannel.tvChannelName"
value_template: "{{value_json.components.main.tvChannel.tvChannelName.value}}"
json_attributes:
- "timestamp"
Am I missing something on how this should be written? Grateful of any help or guidance!