The extended dim action replaces the built-in dim action of pilight V6.0. This dim action now supports TO, UP, and DOWN.
This tutorial describes the installation and usage of this action.
The modified action is compatible with the manually installed development version of pilight version 6.0. For instructions on how to install manually please look here.
The modified dim action accepts, besides the existing TO statement, the UP and DOWN statements.
Log on as superuser and cd to your pilight folder:
pi@raspi2 ~ $ sudo su root@raspi2:/home/pi/# cd pilight
Stop the pilight service:
root@raspi2:/home/pi/pilight# service pilight stop
Download the source code:
root@raspi2:/home/pi/pilight# git clone --depth 5 -b master https://github.com/niekd/pilight-actions.git
This will create a folder called pilight-actions in your pilight folder.
Copy the dim.* files from this folder to the pilight actions library folder:
root@raspi2:/home/pi/pilight# cp pilight-actions/dim.* libs/actions/
Then compile the sources to create the modules (.so files).
root@raspi2:/home/pi/pilight# gcc -fPIC -shared libs/actions/dim.c -Ilibs/pilight -Ilibs/config -o dim.so -DMODULE=1
Next copy the dim.so files you have just created to the actions subfolder of /usr/local/lib/pilight (create the folder /usr/local/lib/pilight/actions/ first if it doesn't exist):
root@raspi2:/home/pi/pilight# cp dim.so /usr/local/lib/pilight/actions/
Edit your config.json according to your needs.
Now you can start pilight and the new dim action will be loaded and can be used in your rules.
Note: After installation, the pilight-actions folder and its contents are not required any more and may be deleted.
Have fun!