AIoT.IO.VN
AIoT.IO.VN
SmartHome SERIES
🌐 VI • EN

[OpenHAB] Share a Vietnamese Lunar Calendar Script for OpenHAB

Ng Nghia Phan • • ⚡ 1 min read • -- views • --
VI EN
[OpenHAB] Share a Vietnamese Lunar Calendar Script for OpenHAB
TABLE OF CONTENTS (Nhấn để xem)

OpenHAB Lunar Calendar

  • Vietnamese lunar calendar for OpenHAB by AIoT.io.vn . The file is based on the original repository: https://github.com/quangvinh86/SolarLunarCalendar/blob/master/LunarSolar.py.
  • Adds solar terms, Buddhist calendar dates, and annual holidays and anniversaries using the algorithm by Ho Ngoc Duc.

Requirements

  • Download OpenHABLunarCalendar.py.
  • Create these items in OpenHAB:
    • AL_PhatLich - String
    • AL_ThangNhuan - Number (0 = not a leap month, 1 = leap month)
    • AL_Holiday - String
    • AL_TietKhi - String
    • AL_CanChiNam - String
    • AL_CanChiThang - String
    • AL_CanChiNgay - String
    • AL_Today - DateTime
  • Edit the information on lines 296 and 319-326 of the script.
  • Create a rule that runs the script every day at 00:01.

Copy the file to OpenHAB userdata

The default userdata directory is /var/lib/openhab/; adjust it for your installation.

mkdir /var/lib/openhab/amlich
wget -O /var/lib/openhab/amlich/OpenHABLunarCalendar.py https://raw.githubusercontent.com/NghiaMaster/OpenHAB-Lunar-Calendar/refs/heads/main/OpenHABLunarCalendar.py
chown openhab:openhab /var/lib/openhab/amlich/OpenHABLunarCalendar.py
TAGS: #openhab

Discussion & Feedback 0

Share your questions, feedback or insights with the community