Sensors
Create one REST sensor for the full response, then derive individual template sensors from its attributes. This avoids repeating the same API call for every prayer.
rest:
- resource: "https://api.aakashsharma.com.np/api/v1/prayer-times?latitude=25.2048&longitude=55.2708&timezone=Asia%2FDubai&calculation_method=iacad_dubai"
scan_interval: 3600
sensor:
- name: Prayer Times
value_template: "{{ value_json.date }}"
json_attributes:
- calculated_times
- azan_times
- adjustments_minutes
- timezone
template:
- sensor:
- name: Prayer Fajr Azan
state: "{{ state_attr('sensor.prayer_times', 'azan_times')['fajr'] }}"
- name: Prayer Sunrise
state: "{{ state_attr('sensor.prayer_times', 'calculated_times')['sunrise'] }}"The example uses the production API. Replace the base URL and all sample parameters when calling a self-hosted instance. The REST sensor polls hourly, which is enough for daily schedules and avoids unnecessary per-minute API calls. Verify exact entity IDs in Home Assistant Developer Tools after reloading configuration.
The YAML uses Home Assistant’s REST and Template integrations. Consult the official RESTful integration when adapting authentication, headers, update intervals, or availability behavior.
Last updated on