0
Completed

Smartthings HebCal Integration

Ephrayim 6 years ago updated by Daniel Strauss 2 years ago 13

The HebCal Smartthings integration changes modes based on the candle lighting time provided by the HebCal API. The smart app code can be seen here. Recently I noticed that the smart app is switching to Sabbath mode at candle lighting time on Chanukah due to chanukah candles being listed under the "candles" category. Because of the way the JSON is parsed this is causing the smart app to trigger Sabbath mode at candle lighting time during Chanukah. 


I'm not saying this is an API issue because it can be resolved by changing the app's programing, but since there are many people using this Smartthings smart app (which is an official app available in the Smartthings store)  perhaps the API could be slightly adjusted so as to avoid this error?

Answer

+1
Answer
Completed

Hi, thanks for the feedback.

We've made changes to how our API works and Chanukah candle-lighting times will no longer suppress regular Shabbat/Havdalah times. Here's an example to illustrate how the API now behaves (with 2 events on Friday night and 2 events on Saturday night).

https://www.hebcal.com/hebcal?v=1&cfg=json&c=on&maj=on&min=on&zip=02906&year=2016&month=12&leyning=off

{

"title": "Chanukah: 7 Candles",

"date": "2016-12-30T16:05:00-05:00",

"category": "holiday",

"subcat": "major",

"hebrew": "חנוכה: ז׳ נרות",

"link": "https://www.hebcal.com/holidays/chanukah-2016?utm_source=js&utm_medium=api",

"memo": "Hanukkah, the Jewish festival of rededication. Also known as the Festival of Lights"

},

{

"title": "Candle lighting: 4:05pm",

"date": "2016-12-30T16:05:00-05:00",

"category": "candles",

"title_orig": "Candle lighting",

"hebrew": "הדלקת נרות"

},

{

"title": "Chanukah: 8 Candles",

"date": "2016-12-31T17:11:00-05:00",

"category": "holiday",

"subcat": "major",

"hebrew": "חנוכה: ח׳ נרות",

"link": "https://www.hebcal.com/holidays/chanukah-2016?utm_source=js&utm_medium=api",

"memo": "Hanukkah, the Jewish festival of rededication. Also known as the Festival of Lights"

},

{

"title": "Havdalah: 5:11pm",

"date": "2016-12-31T17:11:00-05:00",

"category": "havdalah",

"title_orig": "Havdalah",

"hebrew": "הבדלה"

}


    Hi,

    Now that Samsung has phased out the groovy protocol. Is there any plan to change these smartapps to work with the new smartthings system?

    I've recently created a replacement for the old groovy integration! You can access it here on github, and the accompanying smartthings thread.

    Excellent, thank you very much for this.

    +1
    Answer
    Completed

    Hi, thanks for the feedback.

    We've made changes to how our API works and Chanukah candle-lighting times will no longer suppress regular Shabbat/Havdalah times. Here's an example to illustrate how the API now behaves (with 2 events on Friday night and 2 events on Saturday night).

    https://www.hebcal.com/hebcal?v=1&cfg=json&c=on&maj=on&min=on&zip=02906&year=2016&month=12&leyning=off

    {

    "title": "Chanukah: 7 Candles",

    "date": "2016-12-30T16:05:00-05:00",

    "category": "holiday",

    "subcat": "major",

    "hebrew": "חנוכה: ז׳ נרות",

    "link": "https://www.hebcal.com/holidays/chanukah-2016?utm_source=js&utm_medium=api",

    "memo": "Hanukkah, the Jewish festival of rededication. Also known as the Festival of Lights"

    },

    {

    "title": "Candle lighting: 4:05pm",

    "date": "2016-12-30T16:05:00-05:00",

    "category": "candles",

    "title_orig": "Candle lighting",

    "hebrew": "הדלקת נרות"

    },

    {

    "title": "Chanukah: 8 Candles",

    "date": "2016-12-31T17:11:00-05:00",

    "category": "holiday",

    "subcat": "major",

    "hebrew": "חנוכה: ח׳ נרות",

    "link": "https://www.hebcal.com/holidays/chanukah-2016?utm_source=js&utm_medium=api",

    "memo": "Hanukkah, the Jewish festival of rededication. Also known as the Festival of Lights"

    },

    {

    "title": "Havdalah: 5:11pm",

    "date": "2016-12-31T17:11:00-05:00",

    "category": "havdalah",

    "title_orig": "Havdalah",

    "hebrew": "הבדלה"

    }


      +2

      Hi, friend of mind just rewrite the SmartApp to include Israel as well . If someone is interested, his work can be found here :
      https://drive.google.com/drive/folders/1kxs5rLBmwG9dqsEV0DU3OJG1HYvxqarU?fbclid=IwAR2QRXIaX7JXdZmHkK1fq8LoDr21C0DJ9esrOnVGzqSu8e7HqW28WJeVr-o 
      The ReadMe is in Hebrew and he refers in the SmartApp to geonameid that can be find web page address after generating the calander and not the Zip Code. I hope this is clear...

      hi

      the drive folder is empty...

      Not sure why you want to avoid GCal and IFTTT, the HebCal integration is also reliant on the cloud (HebCal and Smartthings). And honestly, the way the official app queries at 8 am exactly has caused the integration to be unreliable (this could be for several reasons). You are much better off using Google calendar which is very reliable. 

      Ephrayim, thank you for your help and expertise. I have downloaded Hebcal to Gcal, now how to I get smarthings to query Gcal/IFTTT over the Samsung server. thanks 

      Gcal is the name of a custom app for Smartthings. Whether you use Gcal or IFTTT you are going to create a virtual switch in Smartthings that gets turned on and off based on the start of an event in the Google calendar. Candle lighting events mean the start of shabbos and yom tov and havdalah events signify the end. You then program the mode to follow the switch's state. 

      Thanks for replying.

      I want to avoid using GCAL and IFTTT for that. Is it possible to allow 7 digits ZIP code as in Israel in HebCal or allow in SmartThings using City name instead of Zip code while keeping exact city name spelling as in HebCal.
      Another solution might be finding a city in US that have exact  "candle lighting" and "Havdalah" timing as the city in Israel. the SmartApp is using local time , can you suggest how to do that ?

      Pleas advise,

      Shai

      I tried to use this smartapp in Israel / Rehovot. 


      It didn't worked for me, I wasn't able to receive a popup notification. I suspect it is something with the Zip code. Can someone please explain how to use in Israel? 


      Shai Dotan 

      Smartthings is not supported in Israel. I agree there is likely an issue with the zip code lookup in that country. As far as the push notification, this feature is broken in the version of the smart app provided in the Smartthings store but I have corrected it a custom smart app that I use. 

      I would suggest that you instead import the HebCal data into a Google calendar and use either IFTTT or GCal Search to trigger a mode change based on "candle lighting" and "Havdalah".