I have an IP cloud camera that lets you fetch a snapshot URL via API (REST). I am trying to use the RESTful sensor to get and store this URL each minute, but unfortunately the URL returned is longer than 255 characters, and therefore it is not storing. Instead I get this error:
Invalid state encountered for entity id: sensor.cam_1_url. State max length is 255 characters.
Is there some other method I can use to store this URL to be used as the still_image_url: in the generic camera platform? Here is what I currently have setup:
Attributes can be longer than 255 characters; perhaps you could put the URL into an attribute instead, and some dummy value for the actual sensor? Or some other response (possibly even a truncated string) that you can ignore.
You can use the json_attributes thing to capture this other info.
You’re a hero, thanks @lmamakos! I had read about json_attributes being able to store >255 characters but I didn’t fully grasp it until I looked at your sample file. For anyone that is running into a similar challenge, here’s what I ended up with that worked:
Glad to hear that worked for you! I was also surprised by the state length limitation, and stumbled over the json_attributes thing somewhere along the way…