Scripts
Introduction
Domoticz provides a wide range of capabilities in controlling your devices, but when further integration is needed, scripting opens up a tremendous degree of control for advanced users.
This page is a place to find & share useful scripts to enhance the capabilities of your Domoticz system, including specific details related to specific scripting languages.
For an introduction and overview/tutorial specific to Domoticz, see this wiki page: Scripting in Domoticz.
Scripts and logic to do that can be found under the automation part of this Wiki.
Scripts
Batch Scripts (MSWindows)
Use the Edit button of a switch on the Switches tab. Use in the "On Action" or "Off Action" field: script://Domoticz\scripts\soundplay.bat to execute a batch file in the directory Domoticz/scripts on the same disk as the Domoticz installation. To play tada.wav the soundplay.bat file can contain: c:\PROGRA~1\VIDEOLAN\VLC\vlc.exe --play-and-exit %WINDIR%\media\tada.wav (assumed VLC is installed).
Blockly Scripts
Lua Scripts
Tutorial
Trigger
Library
Specific
- Lua - Electric meter pulse counter
- Lua - Update a virtual P1 meter from an existing general kWh meter
- Excess Water Flow Alert
- Lua - Oil Tank Monitor
- Lua - Powermonitor with Ping Using Telegram
- Event Examples (To be formatted to new wiki standard AND split in different pages)
- Smart Lua Examples (To be formatted to new wiki standard AND split in different pages)
- Get Weather Prediction
- Get Doors Status
- Thermostat Control (To be translated)
- Thermostat with planning and localisation
- Alarm
- Capturing Energy Usage with Lua Scripts (To be formatted to new wiki standard)
- Lua - Upload energy data to PVOutput
- Interacting with Google Calendar (To be formatted to new wiki standard)
- Automate sunscreen, blinds, shades (To be formatted to new wiki standard)
- Battery Level Check (Lua, php)
- Get Sensors Status
- Lua - Dusk Sensor
- Lua - TI SensorTag
- Lua - Humidity control
- Lua - Garden Irrigation
- Presence detection through mobile phone and PC presence on the network
- Controlling a Onkyo home cinema receiver through a Lua-script
- Real-time solar data without any hardware sensor : azimuth, Altitude, Lux
- Simple script to update Philips Hue Status
- Lua - Ground Level Pressure to Sea Level Pressure Translation
- Lua - Activate one or more outputs using pushbutton switches
- Lua - Monitor import/export electricity power, shows import/export power on LEDs, activate white LEDs in case of power outage (emergency light), automatically enable/disable loads/appliances
dzVents Scripts
Tutorial
DzVents: next generation Lua scripting
Specific
- dzVents - Light as Alarm
- dzVents - Light Flashing Alternating Colors
- dzVents - Light off at Sunset
- dzVents - Light Flicker before Turning Off
- Stookalert
Bash Scripts
Tutorial
General Bash Instruction click here
Bash in Domoticz see page Scripting_in_Domoticz#Non-Lua_Scripts
Specific
- Post Gas Reading to the Mindergas.nl site
- Eastron SDM120C
- Use Google Translate for Voice Notifications
- Play a streaming radio
- Limitless/AppLamp LED Control (To be formatted to new wiki standard)
- Daily Backup to External Hdd (To be formatted to new wiki standard)
- Automatic Weather Tweets (To be formatted to new wiki standard)
- http://www.domoticz.com/wiki/Monitoring_domoticz#Alternative_script Monitoring & auto restart of Domoticz service
- Monitor memory usage of a process and log inside domoticz
- Bash - Control Daikin wifi heatpump
- Bash - Status Hombot in Domoticz
- Batch - Domoticz backup script for Windows
- Use VoiceRSS for Voice notifications
- Installation Telegram Notification System - Telegram-Cli Method
- Use Slack as an alternative logging mechanism and upload images
- Bash - Speedtest.net Download/Upload/Ping monitoring
- Rsync raspberry bash script
- Raspberry pi fan control and monitoring with bash
- Display output of PiHole api
- Monitor an APC UPS Monitoring Card (e.g. AP9617)
- Bash - Get information from your Renault Zoe
Perl Scripts
Tutorial
- Tutorial on Devices, Ping, Sqlite3, Xively, Sen.se, GPIO and Arduino
Specific
PHP Scripts
Tutorial
- Customization#PHP
- PHP:_Functions_to_control_Domoticz
- PHP: Store switch states and values in variables
Specific
- Extracting status and measuring values (To be formatted to new wiki standard)
- Automatic Weather Forecast Tweet (To be formatted to new wiki standard)
- Controlling a Onkyo home cinema receiver through a PHP-script
- Controlling a Ziggo Horizon (SMT-G7400) receiver through a PHP-script
- PHP: Store switch states and values in variables
- PHP: Functions to control Domoticz
- PHP: Send notifications
- PHP: Google Calendar to control Domoticz
Python scripts
Tutorial
Specific
- Presence detection by pinging a user's smartphone
- Presence detection by checking connected devices via SNMP
- Python & Bash - Posting gasreading to mindergas.nl
- Python - Read data from netduino-DAL
- Python - Control LG Smart TV (2012)
- Python - Notifications to PC with Snarl
- Python - Omnik Solar Inverter
- Python - Pushover notification first day of month with smartmeter meter values
- Prowl notification for energy measuring device
- Python Let a device blink
- Connect your doorbell to Domoticz (through GPIO)
- Get current state from Eneco Toon and save it as a uservariable in Domoticz
- UPS Pico (pimodules) integration with Domoticz
- Python - Monitor Domoticz IP address
- Python - Read-out of DDS238 kWh-meter and upload to Domoticz and to PVOutput