npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

homebridge-praycalc

v1.0.0

Published

Homebridge plugin for PrayCalc prayer times as HomeKit contact sensors (one per daily prayer, OPEN during the prayer window)

Readme

homebridge-praycalc

Homebridge plugin that exposes Islamic prayer times as HomeKit contact sensors — one per daily prayer (Fajr, Dhuhr, Asr, Maghrib, Isha). Each sensor reads Open while that prayer's time window is active, and Closed otherwise, so it can drive HomeKit automations (dim the lights, play a sound, send a notification) without any PrayCalc account or login.

Powered by the public PrayCalc Smart API — no API key required.

Installation

Homebridge Config UI X (recommended)

  1. Search for "PrayCalc" in the Plugins tab of Homebridge Config UI X.
  2. Click Install.
  3. Configure via the settings form (see Configuration below) — no manual JSON editing needed.

Manual

npm install -g homebridge-praycalc

Then add an accessory block to your Homebridge config.json (see below).

Configuration

{
  "accessories": [
    {
      "accessory": "PrayCalcPrayers",
      "name": "Prayer Times",
      "latitude": 40.7128,
      "longitude": -74.0060,
      "method": "isna",
      "madhab": "shafii",
      "windowMinutes": 30
    }
  ]
}

| Field | Type | Required | Default | Description | |---|---|---|---|---| | accessory | string | yes | — | Must be exactly "PrayCalcPrayers" | | name | string | yes | — | Accessory name shown in the Home app | | latitude | number | yes | — | Decimal degrees, north positive | | longitude | number | yes | — | Decimal degrees, east positive | | method | string | no | isna | One of isna, mwl, egypt, umm_al_qura, tehran, karachi | | madhab | string | no | shafii | One of shafii (standard) or hanafi (double-shadow Asr) | | windowMinutes | number | no | 30 | Minutes after a prayer's start time the sensor stays Open |

Full config UI schema is in config.schema.json for Config UI X users.

What you get

Five ContactSensor HomeKit services, one per prayer:

  • Fajr Prayer
  • Dhuhr Prayer
  • Asr Prayer
  • Maghrib Prayer
  • Isha Prayer

Each reads Contact Not Detected (Open, i.e. the automation-friendly "triggered" state) during its active window, and Contact Detected (Closed) the rest of the day.

Example automation

In the Home app: Automation > When a sensor detects something > pick e.g. "Fajr Prayer" > Opens > choose a scene (dim lights, play a sound via a HomeKit speaker, etc.).

How it works

On startup and every hour, the plugin fetches today's prayer times from https://api.praycalc.com/api/v1/public/times for the configured latitude/longitude, method, and madhab. Sensor states are recomputed every minute from the cached times — no per-minute network call.

Requirements

  • Homebridge >=1.6.0
  • Node.js >=20.0.0 (the plugin uses the native fetch API)

Troubleshooting

Sensors never show Open: confirm latitude/longitude are correct and check the Homebridge log for homebridge-praycalc: Initial fetch failed — this usually means the device running Homebridge has no outbound internet access to api.praycalc.com.

Wrong prayer times: double check method and madhab match your usual calculation preference; these affect Fajr/Isha (method) and Asr (madhab) timing.

See also

License

MIT — see the repository LICENSE.