Bookmark

[OpenHAB] Share a Vietnamese Lunar Calendar Script for OpenHAB

Post img header

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

0 Bình luận

Góp Ý / Bình Luận / Đánh giá