openhab-docs/configuration/blockly/rules-blockly-ephemeris.md

2.0 KiB
Raw Blame History

layout title
documentation Rules Blockly - Ephemeris

Ephemeris

return to Blockly Reference

Introduction

The ephemeris category provides blocks with calendar functionality. The blocks can be used to determine what type of day today is, or a number of days before or after today is. For example, a way to determine if today is a weekend, a bank holiday, someones birthday, trash day, etc.

Definition of holidays can be customised through the ephemeris.cfg file. See the Ephemeris configuration page for more information.

{::options toc_levels="2..4"/}

  • TOC {:toc}

Overview of the Ephemeris blocks

ephemeris-dates

Ephemeris Blocks

More about that topic can be viewed at youtube Using Ephemeris information

Holiday, weekend or weekday check

ephemeris-is

Function: this block checks if the given date is a holiday, weekday or weekend.

Type: boolean true or false

Examples

ephemeris-is-example

Get the holiday name for a particular date

ephemeris-get-name

Function: Returns the holiday name for the given date. Will return null if no holiday is found for the date.

Type: String

Get the number of days until a specific holiday

ephemeris-days-until

Function: Return the number of days until the given holiday name, or -1 if the holiday is not found.

Type: number

Some holidays are already provided by default from openHAB. Additional holidays must be configured in ephemeris.cfg.

Return to Blockly Reference

return to Blockly Reference