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-loop-sensor

v1.2.0

Published

A switch that pulses a HomeKit sensor every X minutes while it's on, or once after a countdown. Great for repeating automations (e.g. 'window open while AC is on' alerts).

Readme

homebridge-loop-sensor

מתג + חיישן ל-HomeKit. כשהמתג דלוק, החיישן נדלק לרגע (ברירת מחדל 2 שניות) כל X זמן. כשהמתג כבוי – שום דבר לא רץ.

A HomeKit switch that pulses a sensor every X minutes while it's on. When the switch is off, nothing runs (no timers at all).

למה זה טוב

אוטומציות שחוזרות על עצמן, למשל: "כל 2 דקות, אם המזגן דלוק והחלון בחדר פתוח – ההומפוד מכריז".

תכונות

  • כמה לופים שרוצים, לכל אחד זמן משלו (שניות / דקות / שעות)
  • שני מצבים: לופ (חוזר כל X זמן) או פעם אחת (ספירה לאחור – החיישן נדלק פעם אחת והמתג נכבה לבד)
  • סוג חיישן לבחירה: Contact, Motion, Occupancy, Leak (התראה קריטית)
  • סוג מתג לבחירה: Switch, Outlet, Lightbulb
  • משך "הדלקה" של החיישן (שניות)
  • בחירה מתי הלופ מתחיל: מיד כשהמתג נדלק, או רק אחרי הזמן שנבחר
  • כיבוי אוטומטי של המתג אחרי X דקות (אופציונלי)
  • זוכר את מצב המתג אחרי הפעלה מחדש של Homebridge
  • קל: טיימר אחד לכל לופ, ורק כשהמתג דלוק. בלי לוג על כל הפעלה (אלא אם מסמנים Debug)

הגדרה

{
  "platform": "LoopSensor",
  "name": "Loop Sensor",
  "loops": [
    {
      "name": "לופ מזגן",
      "switchType": "switch",
      "sensorType": "contact",
      "interval": 2,
      "intervalUnit": "minutes",
      "pulseSeconds": 2
    }
  ]
}

| שדה | ברירת מחדל | הסבר | |---|---|---| | name | – | שם הלופ (חובה) | | mode | loop | loop = חוזר כל X זמן, once = ספירה לאחור, החיישן נדלק פעם אחת והמתג נכבה | | switchType | switch | switch / outlet / lightbulb | | sensorType | contact | contact / motion / occupancy / leak | | interval + intervalUnit | 2 minutes | כל כמה זמן החיישן נדלק (מינימום 10 שניות) | | pulseSeconds | 2 | כמה זמן החיישן נשאר דלוק | | startMode | immediate | immediate = החיישן נדלק מיד עם המתג, afterInterval = ההפעלה הראשונה רק אחרי הזמן שנבחר | | autoOffMinutes | 0 | כיבוי אוטומטי של המתג (0 = אף פעם) | | rememberState | true | לשחזר את מצב המתג אחרי ריסטארט | | switchName / sensorName | – | שמות מותאמים | | debug | false | שורת לוג על כל הפעלה של החיישן |

דוגמה לאוטומציה

  1. אוטומציה: כשהמזגן נדלק → להדליק "לופ מזגן". כשהמזגן כבה → לכבות.
  2. אוטומציה: כשחיישן "לופ מזגן" נפתח → המרה לקיצור דרך → אם החלון פתוח → לנגן בהומפוד.

License

MIT © Oren Asher

שומר חלונות (Guard)

מזגן דלוק וגם לפחות חלון/דלת אחת פתוחה במשך X זמן ← חיישן היציאה נדלק פעם אחת (למשל כדי לכבות את המזגן). כל החלונות נסגרו או המזגן כבה ← הספירה מתבטלת. פתיחה מחדש ← הספירה מתחילה מאפס.

הפלאגין יוצר מתג "מזגן", מתג לכל חלון/דלת, וחיישן יציאה. אוטומציות (כל אחת שורה אחת):

  • כל חלון: נפתח ← להדליק "חלון X", נסגר ← לכבות "חלון X"
  • מזגן נדלק/כבה ← להדליק/לכבות "מזגן"
  • חיישן היציאה נפתח ← לכבות את המזגן
"guards": [
  {
    "name": "כיבוי מזגן - חלון פתוח",
    "conditionName": "מזגן",
    "inputs": ["חלון סלון", "דלת מרפסת", "חלון תומר"],
    "delay": 30,
    "delayUnit": "minutes"
  }
]