Hi,
As a newbee, I’m struggling (get stuck) with reading data from an URL that needs variables. After many tries and reading the documentation and inspiration from [Templates in command line sensor + Octopus Energy API], I would like to put my question for help in here
Currenlty I have url data between “<>” hardcoded , serialnr, siteid and api_key
this results in an error:
Invalid state encountered for entity id: {entity_id}. "
homeassistant.exceptions.InvalidStateError: Invalid state encountered for entity id: sensor.solar_inverter. State max length is 255 characters.'
I want to read a JSON element from the return data
That’s what I do not understand. When reading the URL and xpath I expect a max 6 letter answer.
How Can I examine the URL that is produced by the template?
I expect something like
thanks for pointing me to the malformed xpath to the element! Stupid I didn’t check earlier. Normally i use NP++ for that, but thanks for the online version. I don’t have this option: Run Configuration > Server Controls > Check Configuration? Saving the configuration.yaml did’n report issues. I restarted hassio again, and found no entity.
If the entity is not listed in Developer Tools > States then you need to fix that first, otherwise the rest of this discussion is fruitless.
To make this visible: Configuration > Server Controls > Check Configuration
your user account must operate in Advanced mode.
Click your account icon (located at the bottom of the lefthand menu in the UI) and enable Advanced Mode.
Run Configuration Check and see if it reports any errors. If there are none and the entity is missing then there’s something unusual happening in your system.
Thanks
I updated to the last version of hassio and checked the config with the add-on (after enabling it in Advanced). No issues found.
Still no entity with name: solar_inverter
I got t working now (at least the right data is coming in). Thanks @123 for pointing me in the right directions. I tested the templates in Developer Tools -> template and these work fine now.
Solution / correct syntax below.
Seems that I had wrongly formatted time Minutes %m which I set to %M
that sensor part of configuration.yaml looks like:
Still needs some logic around this, while at night (power falls back to 0 or null the return data is different
{
"data": {
"count": 0,
"telemetries": []
}
}
(I’m still looking for a solid way to monitor my SolarEdge system. Since I have no Admin rights at the portal, I’m told that its not possible to alert us when something is wrong…(amazing right))
The original question concerned the error message you received (received data exceeds 255 characters). That was due to an incorrect template. I provided a template with the correct JSONpath. That was the solution to the original question.
Anyone with a similar question will read your first post and then be led to your Solution that doesn’t directly answer, or explain, the original question (changing the appearance of the time was not the root-cause of the problem). In addition, it is the custom of the community to mark the post that introduces the solution as being the Solution. Your post simply copies the original solution and without explanation.