In this repository you can find several LUA scripts and config files for Domoticz, the easy and powerful open-source home automation system controller.
More information, scripts, application notes, examples are available at https://www.creasol.it/support/domotics-home-automation-and-diy
Some scripts require that you install the dkjson package, with the command apt install lua-dkjson
All scripts are free to use, with absolute no warranty. Use them at your own risk.
All global variables and functions are stored in the files globalvariables.lua and globalfunctions.lua.
** The scripts are used with out set of industrial and home automation system modules, made in Italy: for more info, check below! **
For any requests, you can join DomBus channel on Telegram
This is a main script called every time a device changes state: it’s optimized to
File: power.lua and config_power.lua
Destination directory: DOMOTICZ_DIR/scripts/lua
Called by script_device_master.lua and triggered when a device containing Power or Button in its name changes state.
Used to check power from energy meter (SDM120, SDM230, …) and performs the following actions
Files: script_time_selfconsumption.lua config_power.lua globalfunctions.lua globalvariables.lua
Destination directory: DOMOTICZ_DIR/scripts/lua
Called every minute
This is a mandatory script for those who have at least one reneable generation plant in their building.
It manages one or more energy production plants (photovoltaic on the roof, photovoltaic in the garden and or wind turbine, …) computing the total generated energy/power, total used energy/power, self-consumption energy/power, self-consumption percentage and self-sufficiency percentage.
These are goods indicators to know if the building is optimized or not.
Detailed info are available at www.creasol.it/SelfConsumption page.
Files: script_device_evsegridpower.lua
This simple script is meant to compute the total power from the grid and feed it to the DomBusEVSE module, EV charging system that must know the total power from the grid, to prevent overloads and manage solar charging. In case of 2 or 3 meters are used (for example, a meter for the house, a meter for the electric car, and another meter for the garage, it computes the total power.
Files: heatpump.lua (script_time_heatpump_emmeti.lua) and config_heatpump_emmeti.lua
Destination directory: DOMOTICZ_DIR/scripts/lua
Called every minute
This script is designed for radiant systems:
Files: script_time_heatpump.lua and heatpump_conf.lua
Destination directory: DOMOTICZ_DIR/scripts/lua
Called every minute
This script manages the heat pump, adjusting power and fluid temperature to meet the building demand.
If a photovoltaic system is installed, with a power meter measuring the power exchanged with the electric grid, during the summer the heat pump will try to work only when extra power from photovoltaic is produce. No power => heat pump off or at minimum level.
During the winter, the heat pump will work expecially during the day, when external temperature is high, and regulates the fluid temperature smartly to get the heat pump consuming the most energy from photovoltaic and working hard when external temperature is high, and works at minimum (or off) when the external temperature does not permit to get an high efficiency
Files: alarm.lua (script_device_alarm.lua) alarm_config.lua alarm_sendsnapshot.sh and alarmSet.sh
Destination directory: DOMOTICZ_DIR/scripts/lua
Called by script_device_master.lua and triggered when a device with name starting with PIR , MCS , SIREN, TAMPER, ALARM or Light, changes state, or when the variable alarmLevelNew is not zero (alarm started or stopped)
Scripts that manages a burglar alarm system: magnetic contact sensors on doors/windows/blinds, PIRs and radars, tampers, sirens.
Full notifications on Telegram and 3 working modes fully configurable:
Other features:
More info at https://www.creasol.it/freeBurglarAlarm
Files: script_time_fireAlarm.lua config_fireAlarm.lua
Destination directory: DOMOTICZ_DIR/scripts/lua
LUA script that loads the rooms information from config_fireAlarm.lua and for any room if Temperature > averageTemperature + deltaT => fire alarm detected => send notification by Telegram
More information available at fire alarm page
File: script_time_rainCheck.lua
Destination directory: DOMOTICZ_DIR/scripts/lua
Called every minute
Script that checks the raining rate and wind speed, and performs several functions:
If raining rate is over 8mm/h, disable external socket in the garden (connected to the Xmas tree!!).
Checks wind speed and direction and disable ventilation when wind speed is zero or wind comes from south or west, where there are few building using wood stoves generating bad smoke smell.
Sends weather telemetry to WindGuru
It’s programmed to work with the cheap DomBusTH module which can be placed in a blank cover (in a wallbox) and already provide a piezo buzzer output, red+green+white leds, touch sensor (simulating a pushbutton, that can be used to cancel the alarm), other 4 I/Os, temperature and humidity sensors. DomBusTH video
File: script_time_fronius.lua
Destination directory: DOMOTICZ_DIR/scripts/lua
Simple script that every minute fetch data, by http, from Fronius solar inverter.
File script_time_earthquake.lua , together with globalvariables.lua and globalfunctions.lua, can be used to get earthquakes alert on Domoticz and, if magnitude is stronger than a certain threshold, also sends alert on a Telegram channel or group.
File script_device_power2p1.lua is a LUA script for Domoticz useful for the Energy Dashboard. It can be used to update a virtual P1 meter (that you have to create by yourself from Setup -> Hardware menu), writing the current power and energy (usage and return). Also, the script can handle more generators (photovoltaic on roof, photovoltaic in the garden, wind generator, …) compute the sum of the power to a virtual device, used by the Energy Dashboard.
Just copy this script in scripts/lua folder and update the 6 variables at the top of file.
-- script_time_example.lua : simple example script that write a message to Telegram channel/group if temperature is less than 5
commandArray={}
dofile "script/lua/globalvariables.lua" -- read a file with some variables, including Telegram API key and ChatID
dofile "script/lua/globalfunctions.lua" -- read a file with some functions
if (tonumber(otherdevices['Temp_outdoor']) < 5) then -- check that Temp_outdoor temperature sensor is >=5 Celsius, or send a notice to Telegram
telegramNotify("Low temperature: bring flowers inside") -- send message by Telegram
end
return commandArray
Our industrial and home automation modules are designed to be
Modules are available in two version:
Store website - Information website
Complete solution to make a Smart EVSE, charging the electric vehicle using only energy from renewable source (photovoltaic, wind, …), or adding 25-50-75-100% of available power from the grid.
Compact board, 32x17mm, to be installed on blank cover with a 4mm hole in the middle, to exchange air for the relative humidity sensor. It can be installed in every room to monitor temperature and humidity, check alarm sensors, control blind motor UP/DOWN, send notifications (using red and green leds) and activate white led in case of power outage.
Includes:
Very compact, versatile and cost-effective module with 9 ports. Each port can be configured by software as:
Versatile module designed to control gate or garage door.
DIN rail low profile module, with 8 relays and very low power consumption:
Versatile module with 230V inputs and outputs, and 5 low voltage I/Os.
Module designed to control 3 lights already existing and actually controlled by 230V pushbuttons and step-by-step relays. In this way each light can be activated by existing pushbuttons, and by the domotic controller.
Each relay can toggle the existing step-relay, switching the light On/Off. The optoisolator monitors the light status. The 5 I/Os can be connected to pushbuttons to activate or deactivate one or all lights.
DIN rail module, low profile, with 12 relays outputs and very low power consumption.
Module designed to be connected to alarm sensors (magnetc contact sensors, PIRs, tampers): it’s able to monitor mains power supply (power outage / blackout) and also have 3 relays outputs.
Simple module with 2 relays, to be used with DomBus modules or other electronic boards with open-collector or open-drain outputs
IoT board designed for NodeMCU v3 board using ESP8266 WiFi microcontroller