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 🙏

© 2024 – Pkg Stats / Ryan Hefner

homebridge-jewish-calendar

v1.1.1

Published

HomeBridge Plugin that establishes a block of sensors related to events on the Jewish Calendar that you may use in your automation projects.

Downloads

7

Readme

npm version GitHub release GitHub license verified-by-homebridge

"Jewish Calendar" Plugin

This Plugin creates a series of Contact Switches that you can use in Automation related to the Hebrew Calendar. The heavy lift of this is from he-date and sun-calc. The rest was just calculating the various events.

Example config.json:


    "accessories": [
        {
            "accessory": "JewishCalendar"
            "name": "Jewish Calendar",
            "latitude": 40.7128,
            "longitude": -74.0060,
            "candlelighting": 18,
            "havdalah": 42,
            "offset": 0,
            "israel": false,
            "sheminiatzeret_in_sukkot": false,
            "Shabbat": "Shabbes",
            "YomTov": "Yom Tov",
            "RoshHashana": "Rosh Hashana",
            "YomKippur": "Yom Kippur",
            "Sukkot": "Sukkot",
            "SheminiAtzeret": "Simchat Torah",
            "Pesach": "Passover",
            "Shavuot": "Shavuot",
            "Chanukah": "Hanukkah",
            "Kodesh": "Kodesh",
            "Mourning": "Mourning",
            "Omer": "Omer",
            "SefiratOmer": "Sefirat Omer",
            "sefiratOmerCustom": "Ashkenazi",
            "ThreeWeeks": "Three Weeks",
            "threeWeeksCustom": "Ashkenazi",
    ]

Explanation of Plugin and Config

The project was originally designed for me to have a better "Shabbat Mode" in Homekit, but for completeness I added some very specific ones. The settings in the Config for the holidays are to change spelling. I use a modern Transliterated spelling, but feel free to replace with Hebrew, Ashkenazi transliterations, English, or whatever language you prefer. If you look in the sample above, you can see a variation of languages.

Caveats

Suncalc is known to occaisionaly have issues of a few minutes. Unfortunately the other library I found was not compatible with Homebridge. If you are concerned with Halachic specificity, you need to add at least 1 minute to cover the fractional minute between updates, and 3 minutes for safety on Sun-Calc. In general, this is more useful for limiting Trigger Events in your Automation rules than serious Halachic implications.

How to Use in Automations

I use the Home App for building my scenes (to include Homepods), and the Eve App for programing. But any Homekit app should work.

Example of Programming:

Turn the Dining Room on for lunch on all Sabbath and Holidays, except Sukkot. On Sukkot, we turn the Sukkah on instead.

Trigger: Timer: 12:30 PM Conditions: Kodesh: Open Sukkot: Closed Scene: Dining Room Entertaining

Trigger: Timer 12:30 PM Conditions: Kodesh: Closed Sukkot: Closed Scene: Sukkah On

NOTE: Because of quirks in how Sun-Calc and Apple can calculate things like Sundown, I recommend that you either use a fixed Time for your Trigger, or Sundown or later. But setting it to run 15 minutes before Sundown when Shabbat: On should work.

On/Off Settings - the words may be backwards. Contact sensors are open/closed. Eve is a fantastic for editing rules but it terminology felt "backwards" for checking the settings.

Debugging your rules

You can set the Offset to add (negative to subtract) minutes to the date/time to allow you to test rules. This is important if you are testing Shabbat rules and don't want to be using your electronics on Shabbat.

If you want to code your Shabbat rules on Sunday, you can do offset: -1440, and it will run everything as though then.

Hat tip to moshed for the idea, Issue #3 https://github.com/scorpionmit01/homebridge-jewish-calendar/issues/3

Silly but valid examples

Trigger: at Sundown each day Conditions: Chanukah: on

Action: turn on Menorah Outlet

Trigger: at Midnight each day Action: turn off Menorah Outlet

Use: a store/dorm that wants a Hanukkah Menorah to light up their window during Chanukah.

Trigger: at 7:00 AM Conditions: Kodesh: off Mourning: off Action: Scene Good Morning Music

If you come up with clever hacks, feel free to let me know. I mostly disable the rules fired by my motion sensors

Explanations of some Specifics:

Koshesh is true whenever Shabbat or Yom Tov is true. I have it so I can check a single value when disabling routines that run off motion sensors.

Sefirat Omer settings are: Ashkenazi: Pesach 2 -> before Lag B'omer Sephardic: Pesach 2 -> Lag B'omer Iyar: Rosh Chodesh Iyar until Sivan 3 Iyar 2: Iyar 2 until Shavuot

Three Weeks Settings: Ashkenazi: Fast of Tamuz through day after Tisha B'av Fast Sephardic: Rosh Chodesh Av through day after Tisha B'av Fast

Sukkot: is on from beginning of holiday through Shemini Atzeret. If you enable sheminiatzeret_in_sukkot in the config, it will run until Simchat Torah (or end of Shemini Atzeret in Israel). Chol Hamoed is part of this Sensor.

Pesach: runs from beginning of holiday through the end, including Chol Hamoed.

Special Thank You

Hat tip to shayweiss who found the bug and the fix. It's Suncalc Issue #11, apparently not being fixed https://github.com/mourner/suncalc/issues/11

How to say thank you for this

Drop me an email, [email protected] will always forward to me and say thanks. It's happened a few times, and it really makes my day. If you want to do more, please consider a donation to your local Jewish Federation in honor of Homebridge Jewish Calendar.