Skip to content

Latest commit

 

History

History
 
 

shabbat_times

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Shabbat Times Sensor

Component Type : platform
Platform Name : shabbat_times
Domain Name : sensor
Component Script : custom_components/sensor/shabbat_times.py

Community Discussion

Component Description

The component works in a similar manner as the rest type sensor, it send an api request towards Hebcal's Shabbat Times API and retrieves the next or current Shabbat start and end date and time, and sets them as attributes within a created sensor.
The component can create multiple sensors for multiple cities around the world, the selected city is identified by its geoname which can selected here.

Table Of Contents

Installation

Configuration

To use this component in your installation, add the following to your configuration.yaml file:

# Example configuration.yaml

sensor:
  - platform: shabbat_times
    geonames: "IL-Haifa,IL-Rishon LeZion"
    candle_lighting_minutes_before_sunset: 0
    havdalah_minutes_after_sundown: 40

This configuration will create two sensors:

  • sensor.shabbat_times_il_haifa
  • sensor.shabbat_times_il_rishon_lezion

Each sensor will have its own set of attributes:

  • shabbat_start
  • shabbat_end

Which will be calculated based on configuration optional values candle_lighting_minutes_before_sunset and havdalah_minutes_after_sundown. These attributes are available for use within templates like so:

  • {{ states.sensor.shabbat_times_il_haifa.attributes.shabbat_start }} will show the Shabbat start date and time in Haifa.
  • {{ states.sensor.shabbat_times_il_rishon_lezion.attributes.shabbat_end }} will show the Shabbat end date and time in Rishon Lezion.

Configuration Keys

  • geonames (Required): A valid geoname selected here, multiple geonames separated by a comma is allowed.
  • candle_lighting_minutes_before_sunset (Optional): Minutes to subtract from the sunset time for calculation of the candle lighting time. (default = 30)
  • havdalah_minutes_after_sundown (Optional): Minutes to add to the sundown time for calculation of the Shabbat end time. (default = 42)
  • scan_interval (Optional): Seconds between updates. (default = 60)

States

  • Awaiting Update: the sensor hasn't been updated yet.
  • Working: the sensor is being updated at this moment.
  • Error...: the api has encountered an error.
  • Updated: the sensor has finished updating.

Special Notes

  • The sensors will always show the date and time for the next Shabbat, unless the Shabbat is now, and therefore the sensors will show the current Shabbat date and time.