This docker image is intended to be used with OpenHAB.
It allows you to have a file named "_.rules" in the input folder, together with your regular .rules files. It outputs each regular .rules file prepended by the contents of the "_.rules" file. It continually watches for changes to files in the input folder and recompiles files as necessary.
This allows you to put variables and functions in the _.rules file to have them available in all your .rules files, since OpenHAB's rule engine does not allow for global variables and functions.
docker run -v "<host path>:/opt/app/input" -v "<host path>:/opt/app/output" finalfrag/dynamicrules
[...]
openhab:
image: openhab/openhab:2.4.0
volumes:
- "/opt/openhab/conf:/openhab/conf"
[...]
dynamicrules:
image: finalfrag/dynamicrules
volumes:
- "/opt/openhab/conf/drules:/opt/app/input"
- "/opt/openhab/conf/rules:/opt/app/output"
[...]
Input folder:
_.rules (contents: A)
appliances.rules (contents: B)
presence.rules (contents: C)
Output folder (generated)
appliances.rules (contents: A + B)
presence.rules (contents: A + C)
Source code is available at https://github.com/FinalFrag/dynamicrules
Content type
Image
Digest
Size
24.6 MB
Last updated
over 7 years ago
docker pull finalfrag/dynamicrules