Hi, I’m struggling extracting attrubutes from the following JSON: (I have shortened the json, because it’s quite lengthy)
I have used the same JSON in Lua (as a table) using the following x[0-6][Mon-Sun][h00-h23]
If i use the attribute path "$.*" (or no attribute path, or "$.[*]" ) the result is one attribute: “Mon” with the dictionary key-value paires. Any other paths I tried result in “None”, or complaints that it’s not a dictionary.
How to get the other attributes, "Thu" etc.
I’ve read and reread examples and answers to other peoples questions. I’ve used JSONPath online evaluator. To no avail. What an I doing wrong? (probably something obvious and stupid, but I’m stuck)
Help is really appreciated.
I use a rest sensor to grab a json payload with more than one attribute, but the json is structured differently:
[
{
“label”: “Address Here”,
“UPRN”: “1234567890”,
“Results”: “A load of text would be in here about my rubbish collection”
}
]
So all the attributes are at the top level.
When you look at your json, Mon, Tues etc are wrapped in braces. I’m not an expert, but that seems the only obvious difference between yours and mine that works. My sensor looks like this
Thank you. Yes, the top level keys array’s are at 0, 1 etc. Tried that, but that results in None. Funny things is that I get Mon even though it is deeper in the JSON.
Edit: As @fingerha noted, these are not keys, just the index numbers
Many thank to all for helping me out on this! (I’m a little embarrassed)
Hello Akja,
For what kind of Tesy device this is?
I have the Tesy boiler, which is working fine in HA, as another forum topic has excellent support on it.
Now, I also bought a Tesy convector heater (LivEco CN 051) and I didn’t find any forum topic on this device for the HA integration.
From what I get of your post, it is about interacting with a Tesy device, but I don’t know which one?
Thanks for pointing out that topic. I solved my problem, but it’s always interesting to read other solutions. I had solved controlling the Tesy boiler in Domoticz, several years ago, using dzVents. However, ‘programming’ in Home Assistant is very different. Yaml feels like filling in a tax return form, with some coding fragments.