Hi, thanks for your response. I am querying a web api to get prayer times. I then need to extract that prayer times and display in UI as a sensor. I have tried to ammend yaml file but not sure how to extract this e.g.FAJR. See my code below please.
Also note, while using this API is totally fine if that’s what you prefer, and I don’t know enough about Islamic Prayer Times to know what matters in this regard…
BUT, Home Assistant has a built-in Islamic Prayer Times integration that seems to provide quite a few prayer times based on your longitude and latitude. So, if all you’re after is a few prayer times for your location, this might do the trick more easily. If you just want an exercise in writing REST sensors or you want the times provided by this API specifically (because they are different or something) then continue on and my last comment should get what you want.
I added this line to the RESTful Sensors configuration:
value_template: '{{value_json.date}}'
Without it, the entire JSON string will be stored as the sensor’s state. An entity’s state cannot store a string greater than 255 characters in length. The JSON data you posted is currently 255 characters long. If it grows by just one more character, it will fail to be stored.
Hello, thanks for your response. I was actually trying to make use of this rest api. Thanks for your suggestions, which have worked flawlessly. I am adding my final code in case if someone needs it.