I am not sure how many folks still use jython and the openhab-helper-libraries and hence not sure it is worth the effort to update/maintain for the community vs. just keeping my own version updated?
There are also a couple of repositories (crazy-ivan’s being the latest, but not maintained today). If anyone is interested, I have updated the libraries with the following changes:
- Added/fixed the missing classes/decorators to support more recent triggers:
@when("System started")
@when("System reached start level 50")
@when("Time is midnight")
@when("Time is noon")
@when("Time is [Item]")
@when("Time is [Item] [timeOnly]")
- I have also added an onlyif decorator which mirrors the different conditions which can be configured through the ui.
@onlyif("Item Weather_Overcast = ON")
@onlyif("Item alarmPanelDisplay is ON")
@onlyif("Item Weather_Overcast == ON")
@onlyif("Item Weather_Overcast eq ON")
@onlyif("Item alarmPanelDisplay equals 'hello friend'")
@onlyif("Item Weather_Overcast != ON")
@onlyif("Item Weather_Overcast is not ON")
@onlyif("Item Weather_Overcast < 5")
@onlyif("Item Weather_Overcast lt 22")
@onlyif("Item Weather_Overcast is less than 22")
@onlyif("Item Weather_Overcast <= 5")
@onlyif("Item Weather_Overcast lte 22")
@onlyif("Item Weather_Overcast is less than or equal 22")
@onlyif("Item Weather_Overcast > 5")
@onlyif("Item Weather_Overcast gt 22")
@onlyif("Item Weather_Overcast is greater than 22")
@onlyif("Item Weather_Overcast >= 5")
@onlyif("Item Weather_Overcast gte 22")
@onlyif("Item Weather_Overcast is greater than or equal 22")
@onlyif("Today is a holiday")
@onlyif("It's not a holiday")
@onlyif("tomorrow is not a holiday")
@onlyif("today plus 1 is weekend")
@onlyif("today minus 1 is weekday")
@onlyif("today plus 3 is a weekend")
@onlyif("today offset -3 is a weekend")
@onlyif("today minus 3 is not a holiday")
@onlyif("yesterday was in custom_dayset")
@onlyif("Time 9:00 to 14:00")
@onlyif("Time 3:30 AM to 2:00 PM")
@onlyif("Time 6:00-13:00")
I did re-factor/simplify the parsing in the decorators - so let me know if there are any issues with any of your current rules.
The code is here:
https://github.com/jsjames/openhab-helper-libraries.git
Lastly, it would be great to have the python helper libraries kept in a central openhab git repository. Not sure what would be the process to make that happen??