Sign inSign up

finalfrag/dynamicrules

By finalfrag

•Updated over 7 years ago

OpenHAB dynamic rules

Image
0

360

finalfrag/dynamicrules repository overview

⁠Description

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

⁠Running container

docker run -v "<host path>:/opt/app/input" -v "<host path>:/opt/app/output" finalfrag/dynamicrules

⁠Running together with openHAB using docker-compose

  [...]
  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"

  [...]

⁠Examples

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

Source code is available at https://github.com/FinalFrag/dynamicrules⁠

Tag summary

Content type

Image

Digest

Size

24.6 MB

Last updated

over 7 years ago

docker pull finalfrag/dynamicrules