Digital Loggers

Downloadable scripts for your use.


Updated 04/18/2025

Advanced Power Control - Lua Scripting

On its own, a power switch isn't very smart.  Add custom functionality using the built-in simple Lua scripting language. It's really simple. No programming experience is required.  Give it a try!

 

Hardware Requirements

WiFi capable power controller such as the LPC PRO, EPCR 5/6/7, DIN4, DC3, 222 or ISO32

This page describes the Lua based scripting language used in DLI products with WiFi capability only.

Note: To download, right-click on the file and choose "Save link As..." to keep any special characters.
1  WOL_after_switch_on.lua Send Wake-On-LAN to a PC after switch 1 is turned on
2  Control_temperature_with_fans.lua Older version to turn on fans if the temperature exceeds a defined maximum. Keep them on until it's below a defined temperature. This example check every x seconds
Change the limits as desired.
2  Monitor_temperature_for_fan_control.lua Updated version to monitor temperature and turns fans on/off based on defined triggers of TEMP_TOO_HOT and TEMP_OKAY.
This example uses an event trigger available in firmware 1.8.x.0 and higher.
3  Reverse cycle.lua Turn an outlet or relay on then off. This is designed for use as an autoping action, usually in a DIN relay.
3  Autoping - reboot router & modem Reboot the modem and/or router as needed as an autoping action.
*Thanks to Eric C. for providing this sample.
4  Notify of network reboot.lua Reboots modem and router, then sends a notification that the network devices were rebooted.
This script has a limitation that if autoping completely fails and is disabled, the notification will not be sent until it is re-enabled.
5  Mike's_autoping_failure_with_notify.lua Power cycles the router and modem and will wait and send a notification after the network is restored.
This is a more sophisticated version of the above and will work even with extended outages. (Updated 10-22-23)
6 Monitor critical outlets.lua Monitor critical outlets so that if accidentally turned off, they will be turned back on automatically.
7 Log_Temp_and_Humidity.lua Log the temperature and humidity every 2 hours.
8 Astronomy_Sun.lua Initiate actions based on sunrise/sunset or dawn/dusk. (Requires firmware 1.11.8.0 or higher)
9 Countdown.lua This script periodically toggles the outlets while displaying a running countdown to the next toggle.
*Special thanks to Mike Gut for offering it here.
10 re-enable_autoping.lua This script periodically re-enables all autoping targets in the case of a prolonged ISP failure where autoping becomes disabled.
11 monitor_public_ip_and_notify.lua Monitor the public IP address and send a notification if it has changed.
12 turn_outlet_off_after_defined_time.lua Monitor an outlet and turn it off after a defined amount of time.

Need additional help? Email support@digital-loggers.com

* Customer contributions are encouraged
** Scripts supplied are not necessarily tested by DLI

Return to the main script page.

Have a smart script or unique way to use your switch?  Let us know!

engineering@digital-loggers.com