Creating Custom Sensors for Daily Prayer Times in Home Assistant

As a newcomer to Home Assistant, I’m diving into the world of smart home automation with a specific goal in mind: creating custom sensors to display daily prayer times. These times change every day, and I’ve come across a URL that provides this data in JSON format. For example, the JSON response looks like this:

{
“city”: “london”,
“date”: “2019-05-06”,
“fajr”: “03:41”,
“fajr_jamat”: “03:56”,
“sunrise”: “05:21”,
“dhuhr”: “01:02”,
“dhuhr_jamat”: “01:30”,
“asr”: “05:04”,
“asr_2”: “06:09”,
“asr_jamat”: “06:24”,
“magrib”: “08:34”,
“magrib_jamat”: “08:49”,
“isha”: “09:45”,
“isha_jamat”: “10:15”
}

My goal is to create a sensor named ‘Fajr’ that retrieves the time “03:41” from this example as its value. I need this sensor to fetch these values daily from the URL. I’ve looked into the Restful sensor platform, but I’m not entirely sure how to proceed. ANY help would be most appreciated in helping me get started on this project. Thank you!

If anyone has successfully implemented something similar, I’d love to hear about your approach. Maybe there’s a more efficient way to parse the JSON data or automate the daily updates. Let’s explore this together!