- Details
- Category: Domotics
Introduction
DomBus are modules designed for industrial and home automation systems that are available with 2 different protocols:
- DomBus protocol, that is supported by Domoticz home automation controller, is a reliable protocol that permits to manage dozens of modules and get status from modules as soon as they changes. Also it includes the so-called DCMD commands that, similarly to KNX, are transmitted between DomBus modules in the same bus to activate outputs in case of events (switch or pushbutton pressed, temperature value, power value, ....) without needing for the intervention or the home automation controller, useful solution to get a home automation system that works even in case of domotic controller fault. The Creasol DomBus plugin have to be installed in Domoticz, using the Python Plugin Manager or downloading the software from GitHub (see the section below).
- Modbus RTU protocol, widely used in industrial and home automation systems, is supported by almost any domotic controller like Home Assistant, OpenHAB, IObroker, Node-RED, ...
Modbus is a master-slave protocol that permits to activate and deactivate a single relay, all relays or a group of relays by a single command. Also, it's possible to specify, for each relay, the ON time from 31.5ms to 1500 days, so the relay automatically switches OFF after the selected time.
The Modbus RTU version can be used by Node-RED system to realize flows including relay outputs, digital and analog inputs, temperature, humidity, energy sensors, electric vehicle charging station, and more.
Node-RED configuration
First, the modbus palette should be enabled: if not already enabled, type the command
npm install node-red-contrib-modbus
then restart Node-RED.
Configuring DomBus31 (8 relays module) or DomBus36 (12 relays module)
The above flow shows how to use the 8 relays module DomBus31 with Node-RED: drag Modbus-Write to the flow, and configure it as shown in the picture.
To have complete information about DomBus modules, check https://www.creasol.it/domotics
Click to have full information about DomBus31 (8 relays module) and DomBus36 (12 relays module)
Configuring DomBusEVSE module with NodeRED, to build a smart wallbox EV charging station
DomBusEVSE is a DIN-rail module designed to make a smart EV charging station. It have to be connected to external components like 2P or 4P contactor (single phase or three phase), RCCB protection, optional energy meter for EV energy measure/accounting, optional energy meter for grid power measure/accounting (if already exists, the grid power can be sent to the EVSE module by a simple automation), and EV cable.
It's possible to set the EVSE module to charge using only renewable power (photovoltaic, wind, ...): in this case the wallbox regulates the charging power to have always negative grid power (no power from the electrical grid). Alternatively, it's possible to set the EVSE to use 25, 50, 75 or 100% of the available power from the grid: in this case setting for example to 50% and having EVMAXPOWER=6000W (max 6000W from grid), the EVSE regulates the charging power to drain no more than 3000W from the grid.
- Details
- Category: Domotics
Although this page is available in multiple languages, please check the English version to get the most up-to-date version.
Introduction
The goal is to build yourself a complete alarm system that is reliable, scalable, cheap and feature-rich.
Using the following scripts it's possible to integrate all alarm system functions in a Domoticz controller running in a RaspberryPI (single board computer with 2.3W power consumption) , RockPIS (tiny single board computer with only 400mW power consumption) or another type of hardware.
It manages 3 different types of alarm:
- Away, when nobody is home
- Night, when everybody is home sleeping
- Day, when somebody is home and want to detect any intrusion attempt
Also, in case of a sensor activation, the system can record small videos, recode with 2x speed, and send it to a Telegram group/channel, so it's possible to check what happen on the smartphone. This is useful expecially with outdoor sensors.
Why Domoticz? Because Domoticz is free, fast and very very reliable: it's written in C++ (not python, java or other interpretated languages) and can be updated with no pain. Also it supports LUA scripting that permits to write easy-to-manage automations in a clear/easy language that can be understood by anyone. Domoticz user interface looks old, not nice, but it's really strong and this is the most important thing to save marriage when home is highly-domotized ;-)
The alarm system is made by a configuration file and some LUA and Bash scripts: one is called at the activation of the scenes AlarmAway, AlarmNight, AlarmDay, and onother one is called to record video from IPcams in case of outdoor sensors activation. Just change the config file to set which sensors and sirens to manage.
Using DomBus modules to interface alarm sensors it's possible to get reliable home automation wired network, with bus cable that interconnect all sensors carrying both data and 12V power supply: using a 12V lead acid backup battery, the system will work even in case of power outage. In any case, the alarm scripts described below works with any kind of sensors. Last, but not least, DomBus modules permits to achieve a very very low power consumption: each DomBus module typically consume about 10mW to manage many inputs and outputs, much lower than WiFi modules that consumes 400mW or more. Below a screenshot that shows some of our products with prices.
Of course, it's possible to use for the alarm system all supported devices, like Shelly, Sonoff, Denkovi, KMTronic, RaspberryPI GPIOs, ...
The alarm can be enabled/disabled through 3 scenes/group, as showing in the picture, or by pushbuttons, fingerprint readers, keyboards, RFID or NFC tags, ... For example is very useful to have pushbuttons beside the bed to activate/disactivate NIGHT alarm (check the picture below, using DomBusTH to do that).
Check the section below to know how to add icons on your smartphone to activate/disactivate alarm! Tap on a icon to activate the AWAY alarm, tap on another icon to disable alarm.
All notifications will be available in Telegram, as like as short videos that are recorded and sent to Telegram when an external sensor is activated: to make it easier to check what happen when a sensor activates, 24 seconds of video is recorded with speed 2x, so it's possible to check it in only 12 seconds.
Features
- Three types of alarm: day (only emits a short pulse on internal siren, if someone open a door or window or shutter), night (activates only internal sirens and some lights), away (activates internal and external sirens).
- full notifications through Telegram app
- manages up to 128 magnetic contact sensors (but can be easily expandable to a higher number), 32 motion sensors (PIR), 32 tampers, 32 sirens
- alarm can be activated/disactivated by pushbuttons, smartphone or other devices (fingerprint readers, keyboards, ...)
- the script is able to send a short IP-Cam video (24s) when external PIRs/Radar/sensors have been activated, showing the video in Telegram to let the owner know what happen externally. This is useful to monitor if someone (or maybe a cat!) is walking around the building while alarm is activated. To get a fast video checking, video are recorded with speed 2x!
- Also, one or more displays connected to IP-Cam or NVR can be power-on when a external sensor has been activated, showing the external IP-CAMs
Installation
To get a reliable alarm system, I believe we can't use Microsoft Windows. The installation instructions covers only Linux operating system (Raspbian, Debian, Ubuntu or similar). It's possible to get a microSD already programmed with Linux+Domoticz+Firewall+backup system+automation scripts from store.creasol.it , where are also available some domotic kits that include the controller, power supply, ...
From Linux shell, type the following commands (copy&paste):
sudo su - #get root access
apt update; apt install lua-dkjson git #install lua dkjson library and git
cd ~pi/domoticz/scripts/lua
git clone https://github.com/CreasolTech/domoticz_lua_scripts #get all scripts from CreasolTech into domoticz_lua_scripts dir
cd domoticz_lua_scripts
#add some files, if they not exists
cp -n alarmSet.sh alarm_sendsnapshot.sh config_alarm.lua globalfunctions.lua globalvariables.lua alarm.lua script_device_master.lua ..
cd ..
Configuration
First, all devices should be named using the following prefixes:
- MCS_ for magnetic contact sensors, for example MCS_Door_Garage, MCS_Window_Kitchen, ...
- PIR_ for PIRs, for example PIR_Garage, PIR_Kitchen, ...
- TAMPER_ for tampers, for example TAMPER_Blinds_GroundFloor, ...
- SIREN_ for sirens, for example SIREN_External, SIREN_Internal
- ALARM_ for pushbuttons used to activate/disable alarm, for example ALARM_Pushbutton_Bedroom, ...
Configure the file scripts/lua/globalvariables.lua writing your telegram chatid, api key, ....
Configure the file scripts/lua/config_alarm.lua writing the list of sensors and your preferences
Configure the file scripts/lua/alarmSet.sh writing in the SIREN_IDX the list, separated by a space, of all idx of devices that are activated in case of alarm (external siren, internal siren, lights, buzzers, ...): in this case if a alarm occurr, it's possible to push the Off button on AlarmXXXX scene/group to activate the alarmSet.sh script that will disable all sirens/buzzer/lights that have been activated by the script_device_alarm.lua script.
Hardware
Domoticz supports several protocols and hardware types.
As we produce home automation modules for home automation systems, we suggest to use our DomBus modules that are very reliable, work in case of power outage (just use a 12V lead-acid battery to supply the bus), very low latency and very very low power consumption: for example, in a house the power consumption is only 1.02W for 23 DomBus modules managing 113 inputs, 67 outputs, 19 sensors and 1 EV charging.
DomBus37 is a module designed specifically for alarm system, with 11x inputs (doors/windows/blinds magnetic contact sensors, PIRs, tamper, ...), ability to supply and monitor power usage of an external siren, 3x relay outputs and 3x AC inputs (to monitor power outages on heat pump, fridges, whole house, ...).
DomBusTH for example is a cheap and compact module, no case, that can be placed on blank covers with a 3-4mm hole in the center, and it's ideal to be placed in any room to monitor temperature+humidity, has red/green/white leds that can be used as status and emergency light, 4 I/Os that can be connected to magnetic contact sensors, PIRs, pushbutton, buzzer, counters, ... 2 open-drain outputs that can be connected to external relays, and a touch sensor to use that device as a multi-function pushbutton switch.
DomBus12 is another cheap and compact module, with 7 inputs, that can be used to connect alarm sensors , and 2 open-drain outputs, that can be connected to external relays.
DomBus31 is a domotic module with 8 relays, optimized for very low power consumption: less than 10mW in stand-by (all relays OFF), and LESS THAN 500mW with all 8 relays ON: unbeatable!
As comparison, usually home automation modules consumes at least 400mW for a single relay!
DomBus23 is a sophisticated module with different types of inputs and outputs.
DomBus modules are not wireless devices: they communicates by the strong RS485 standardl at 115200bps, so they can be connected together using any kind of bus topology using a thin 4 wire shielded cable: 2 wires for 12V power supply and 2 wires to exchange data. No RF pollution, no batteries, no latency!
Using a 12V power supplier that manages a 12V lead-acid backup battery, it's possible to get a domotic network that works even in case of blackout.
When a DomBus module is connected to the network, Domoticz automatically recognized and show all ports (plug&play): each port can be configured through the Domoticz web interface. Also, to get the home automation system working even in case the controller (Domoticz) is down, it's possible to program each port to control ports on the same or other devices, like KNX network: for example, if a button is pushed for less than 0.5s, switch ON for 123 seconds the output2 of module X and output 1 of module Y, while if it's pushed for 1 second, toggle ON/OFF output 3 of module Z. Or, if temperature < 21 degrees, turn ON heater, while if temperature > 21.4 degrees turn it OFF. More info in the device page, DCMD section.
Although they are made in Italy, DomBus modules are also cheap! They are available in two types: using DomBus protocol (working with Domoticz) and Modbus standard protocol (working with Home Assistant, Node-RED, OpenHAB, ...). Below an old screenshot from our store:
Add icons to smartphone to enable and disable alarm system
It's very useful to have in the smartphone an icon to enable away alarm when leaving the house, and one to deactivate the alarm system before entering the house.
Domoticz supports many HTTP commands to activate scenes, groups, switches, ... and smartphones have many applications that can be used to call such URLs.
- Install on your smartphone the HTTP Shortcuts app
- Create a new regular shortcut, specifying a name (in the example Alarm Away)
- Specify the URL to call the Alarm Away group/scene (you have to edit that group/scene to get its idx, 13 in the example) writing the right parameters (IP, PORT, idx)
- Enable base autentication, specifying the domoticz username and password
- Choose an icon
- Save, and add the icon to your smartphone home screen.
- Duplicate this icon, edit the new one, change name to Alarm Off, change icon, change URL replacing On with Off , save and add icon to the home screen.
Now you have two icons on the smartphone, one to activate alarm system and one to disable it.
- Details
- Category: Domotics
DomBus modules are connected together by a serial bus, using a thin/common alarm cable with 4 wires: 2 to carry the 12-24V power supply and 2 wires for data at 115200bps 8,n,1.
Normally, the bus is connected to the domotic controller by a cheap RS485/USB adapter.
In case that the bus cannot be physically connected to the domotic controller (different area, no cable, ...), it's possible to use a TCP tunnel to keep into communication the domotic controller (with a virtual serial device) with the DomBus network.
To achieve the virtual serial tunnel over TCP/IP it's possible to use the following solutions.
Virtual serial over TCP/IP between two linux devices
If domotic controller is hosted in a linux device (for example a Raspberry PI or NUC, now called "main") and the DomBus devices are connected to another linux device (Raspberry, Rock PI S, QNAP, ..., now called "slave"), it's possible to have the main controller connecting the DomBus network by a TCP/IP connection, wired or wireless, in this way:
- On the slave device (where the DomBus network is connected using the cheap USB/RS485 adapter), install the ser2net service:
sudo apt install ser2net - Configure the ser2net service by modifying the file /etc/ser2net.yaml :
sudo nano /etc/ser2net.yaml - Remove existing connections that are not used, and insert the following lines to define the connection with one bus:
connection: &dombus
accepter: tcp,2000
enable: on
options:
kickolduser: true
telnet-brk-on-sync: true
connector: serialdev,
/dev/ttyUSB0,
115200n81,local
- It's possible to modify the tcp port (2000, in the example) and serial port (ttyUSB0 in the example).
- In case that more than one DomBus bus are connected to the slave device, define a connection for each bus (specifying a different TCP port for each bus).
- Restart the ser2net service using the command service ser2net restart
- Test that it works by using the command telnet localhost 2000 on the slave device; ctrl+] to exit
- On the main device (with Domoticz, Home Assistant, Node-RED, OpenHAB controller...) install the socat application:
sudo apt install socat - Exec the following command to create the virtual serial port /dev/ttyUSBDomBusNet to manage the DomBus devices attached to the slave device: socat pty,link=/dev/ttyUSBDomUSBBusNet,waitslave tcp:192.168.6.2:2000 where 192.168.6.2 should be replaced with the IP number of the slave device
- In case that connection is done through internet or one or more routers with NAT, maybe it's needed to configure port forwarding / destination NAT on the routers
- Test the whole system by executing the command cat /dev/ttyUSBDomBusNet : if it works, write a small bash script to activate the virtual serial port, and call that script from /etc/rc.local assuring that there is the "&" character at the end, to execute the script in background:
#!/bin/bash
# New file /usr/local/sbin/dombusnet.sh , permissions 0700
# Thanks to Patrick Schaerer for testing and suggestions
TTYDEV=/dev/ttyUSBDomBusNet
TCPSERVER=192.168.6.2
TCPPORT=2000
while true; do
socat pty,link=${TTYDEV},waitslave tcp:${TCPSERVER}:${TCPPORT}
sleep 5
done
# End of file
# File /etc/rc.local
# ........
/usr/local/sbin/dombusnet.sh &
exit 0
This is a the cheaper solution to control DomBus modules by a wired or wireless connection in case that DomBus modules are located in a area where a linux device is already active
Connecting DomBus modules by using a RS485 to Ethernet or WiFi converters
Using an ethernet <--> RS485 converter like MOXA NPORT or other devices it's really simple to connect RS485 devices (DomBus modules, or other Modbus RTU modules) that are placed in a different area from the controller.
In this case a driver should be installed to create a virtual COM port (virtual serial port) to access the remote RS485 bus.
Below a list of RS485 to ethernet converters:
- Waveshare RS485 to WiFi / Ethernet : not tested, but the manufacturing company says it works using socat program (Linux)
- Waveshare RS485 TO ETH (available also with PoE support) : not tested, but the manufacturing company says it works using socat program (Linux)
- PUSR W610 RS485/RS232 to WiFi/Ethernet : not tested, but the manufacturing company says it works using socat program (Linux) or Windows software provided by the manufacturer. TCP port is configurable on the module (Local/Remote port number)
- Protoss PW11 or PW21 RS485 to WiFi/Ethernet : not tested, but it should work
If you know other devices that can be used for this purpose at reasonable prices, please let us know.
- Details
- Category: Domotics
Introduction
Creasol DomBus devices are home automation modules that manage inputs, outputs and sensors, available with two protocols:
DomBus proprietary protocol (works with Domoticz controllers) and Modbus RTU standard protocol that works with Home Assistant, Node-RED and other controllers.
Actually we produce the following modules:
- DomBusTH: Temperature + Relative Humidity sensors, red + green + white LEDs, 4 GPIO, 2 open-drain outputs, 1 analog input
- DomBus12: 7 GPIO, 2 open-drain outputs (configurable also as inputs)
- DomBus23: 2 relay outputs, 1 mosfet output (for 12-24V LED dimming or other DC loads), 2 analog outputs 0-10V, 2 GPIO, 2 low voltage opto-inputs (5-40V), 1 230Vac opto input
- DomBus31: low power module with 6 N.O. relay outputs + 2 N.O./N.C. relay outputs
- DomBus32: 3x relays, 3x 230Vac inputs, 5 IOs
- DomBus33: 3x relays, 3x 230Vac inputs, 5 IOs with special firmware to control 3 lights activated by existing step-by-step relays
- DomBus36: 12x relays
- DomBus37: 12x inputs, 3x 230Vac inputs, 3x relay outputs
- DomBusEVSE: EVSE module usable to build a smart wallbox (electric vehicle charging station)
- ...
Modules are available at https://store.creasol.it and explained in details at https://www.creasol.it/domotics
Using DomBus modules it's possible to make a full domotic system: the following picture describe a real example of a house using Domoticz + DomBus modules to control:
- full alarm system, with PIR and magnetic contact sensors on windows/doors/blinds
- climate control (heating and cooling by heat pump) with optimizations to use the most energy from renewable (photovoltaic system on the roof)
- ventilation control, disabling air renewal, in winter, when the wind blows from certain directions (to prevent combustion fumes from entering the house)
- lights on/off control
- 230V sockets that can be enabled/disabled by smartphone
- garden irrigation and rainwater tank level measure/control
- door bell control: when someone ring the bell, send a picture to the smartphone by Telegram. Obviously, it's also possible to open the gate or pedestrian gate by smartphone
- when presence/movement is detected outside, with the alarm enabled, grab a short 20s video from IPcam near the outdoor sensor and send video to Telegram.
DomBusTH is a really powerful and cheap board, to be mount on a blank cover with a 4mm hole in the center, with a touch sensor (to have a virtual pushbutton) that measures emperature and humidity, and have 3 LEDs: red and green LEDs are used to notify alarm, ventilation or electricity power import/export status, and white led is used as night light and emergency light (in case of blackout). Also, it can be connected to piezo buzzer for sound alerts, pushbutton switches, and external relay module DomRelay2 to control 230V sockets or roller shutter motor.
Also, GPIO/input of DomBus modules can be connected to energy meter with pulsed output, to measure the current imported/exported power. As written above, it's possible to show the actual imported/exported power on RED/GREEN Leds of a DomBusTH module.
Other modules are available at https://store.creasol.it/domotics and fully described at https://www.creasol.it/domotics
Installation
Using the Home Assistant Modbus integration it's possible to use our modules provided with Modbus RTU firmware: Modbus protocol is standard and well supported by Home Assistant as like as other systems (Node-RED, OpenHAB, ...).
Configuration examples are available on GitHub page.
Using DomBusEVSE module with Home Assistant
DomBusEVSE is a smart module that permits to get a home-made EV charging station Mode-3 for vehicles.
The Modbus version of DomBusEVSE can be used with the HomeAssistant hub using the native Modbus integration.
More information are available in the product page, where it's possible to know how to get it working with HA, and in the specific page for HomeAssistant.
DomBus36, a 12 relays module with Home Assistant
DomBus36 is a simple module with 12 relay outputs, grouped in 3 groups to have an easier wiring: each group share the same common, so you don't need to make jumpers to connect the common wire (Line, Neutral, Ground or +12/24V) to all relays.
Relays are protected from overvoltage and overcurrent, and module has a very low power consumption: less than 15mW with all relays OFF, and less than 750mW when all 12 relays are ON. Please compare with the power consumption of a Shelly, Sonoff, Denkovi or KMTronic module!
DomBus37, a versatile module with 12 low voltage inputs, 3 AC inputs and 3 relay outputs
DomBus37 is a versatile module integrating inputs, AC inputs (to sense 230V presence) and relay outputs.
In the application note below the simplest configuration with Home Assistant.
Using DomBus12 to measure water tank level, temperatures, start irrigation and light, check alarm sensors
DomBus12 is a compact and cost effective module with 9 I/Os. Each I/O can be configured as button, switch, double-pushbutton (UP/DOWN pushbutton connected to a single port), counter, meter, NTC temperature sensor, distance sensor, buzzer, led, ...
- Details
- Category: Domotics
Using Domoticz it's possible to supply a router through the normally-closed relay output (SPDT relay); so, normally power supply is applied to the router, but if internet connection goes down, after some seconds or minutes Domoticz remove the power supply, wait for 10s, and apply power supply again to restart the router.
This monitoring procedure is performed by a bash script that sends pings to two different hosts, and if they do not respond, after some seconds or minutes, sends a command to Domoticz to activate the relay output that remove power supply to the router.
First, check that 127.0.0.1 (and your network, if you prefer) are specified in the Domoticz panel Setup -> Settings -> Local Networks: in this way any connection to domoticz from the specified networks do not need authentication (no username and password is required). If you add your LAN, all devices from your LAN can enter domoticz without asking for username and password.
To install the bash script, copy and paste the following code into the raspberry/linux shell:
[code]#become root
sudo su
#download script
if [ `which wget` ]; then
wget -O /usr/local/sbin/netwatchdog.sh http://docs.creasol.it/netwatchdog.sh
elif [ `which curl` ]; then
curl -o /usr/local/sbin/netwatchdog.sh http://docs.creasol.it/netwatchdog.sh
else
#wget and curl not installed: install now
apt install wget curl
wget -O /usr/local/sbin/netwatchdog.sh http://docs.creasol.it/netwatchdog.sh
fi
chmod 755 /usr/local/sbin/netwatchdog.sh
# prepare /etc/rc.local so it is sufficient to remove a # to let raspberry start the script at boot time
sed -i 's:^exit 0:#/usr/local/sbin/netwatchdog.sh >/dev/null 2>/dev/null \&\nexit 0:' /etc/rc.local
sed -i 's/amp;//' /etc/rc.local[/code]
Now, find the idx corresponding to the relay output: open the web browser to the Domoticz page, go to Setup -> Devices to list all installed devices. Look in the idx column to find the idx of the router power supply device.
Now, copy&paste the following commands in the raspberry shell to put the script in debug mode (variable DEBUG=1 : in this way the script will print several debugging messages on the console and reduce the timings to check the script easily), edit the script (you have to write the right idx in the variable ROUTER_RELAY_IDX, check other variables, and type ctrl+x to exit):
[code]#set DEBUG=1 in /usr/local/sbin/netwatchdog.sh
sed -i 's/^DEBUG=0\(.*\)/DEBUG=1\1/' /usr/local/sbin/netwatchdog.sh
#edit script
nano /usr/local/sbin/netwatchdog.sh[/code]
and finally start the script in debug mode (reset the router after only 20s of ping failures), writing some information in the console and other information in the logfile:
[code]/usr/local/sbin/netwatchdog.sh[/code]
Remove the internet cable or switch-off the router: you should see that ping returns 100% packet loss and after 20s the script send a command to Domoticz to reset the router. Type ctrl+c to terminate the script.
If it works, type the following commands to edit /usr/local/sbin/netwatchdog.sh setting DEBUG=0 and to modify /etc/rc.local so the script is executed at boot time:
[code]#set DEBUG=0 in /usr/local/sbin/netwatchdog.sh
sed -i 's/^DEBUG=1\(.*\)/DEBUG=0\1/' /usr/local/sbin/netwatchdog.sh
#and now let linux starting the script
sed -i 's:^#/usr/local/sbin/netwatchdog.sh:/usr/local/sbin/netwatchdog.sh:' /etc/rc.local[/code]
Now you have to reboot to let linux start the netwatchdog.sh script.
Good luck.
Need help? join the DomBus channel on Telegram!
- Details
- Category: Domotics
The following script check temperature for one or more zones, to find out if windows or doors are open: in that case send notification by Telegram
Useful to avoid energy consumption during winter or summer, when someone forget windows/doors open.
The up-to-date version of this file is avaible at http://docs.crasol.it/script_time_openwindows.lua
[code]-- Script that checks temperature and try to discover if doors/windows are open: in that case sends notification by Telegram.
-- Useful to limit energy consumption in winter and summer, if someone forgets windows or doors open.
--
-- This script should be named DOMOTICZ_HOME/scripts/lua/script_time_SCRIPTNAME.lua , e.g. /home/pi/domoticz/scripts/lua/script_time_openwindows.lua
-- It will be called every minute and will check and compare, for each zone (defined below), the current temperature with previous temperature.
--
-- The following user variables must be set:
-- telegramChatid : the Telegram chat ID where notifications should be sent : see https://www.domoticz.com/wiki/Telegram_Bot
-- telegramToken : the Telegram token : see https://www.domoticz.com/wiki/Telegram_Bot
-- HeatingOn: a variables that assumes the following values
-- 0 => Heating/Cooling system is OFF
-- 1 => Heating is ON
-- 2 => Cooling is ON
--
-- Creasol - https://www.creasol.it/products
debug=1 -- if True, print debug information
domoticzUrl='http://192.168.3.230:8080'
-- zones: array that associate for each zone the name of the temperature device, and max difference for temperature
-- This script automatically create a variable zTemp_ZONENAME that contains the temperature measured before
zones={ --zonename {tempsensor,difference}
['Cucina']={'Temp_Cucina',0.6},
['Bagno']={'Temp_Bagno',0.6},
['Camera']={'Temp_Camera',0.6},
['Camera_Valentina']={'Temp_Camera_Valentina',0.6},
['Camera_Ospiti']={'Temp_Camera_Ospiti',0.6},
['Stireria']={'Temp_Camera',0.6}, --TODO: replace Temp_Camera with Temp_Stireria
}
commandArray={} -- reset commandArray, an associative array that will contain the list of commands for Domoticz.
function telegramNotify(msg)
os.execute('curl --data chat_id='..uservariables['telegramChatid']..' --data-urlencode "text='..msg..'" "https://api.telegram.org/bot'..uservariables['telegramToken']..'/sendMessage" ')
end
function min2hours(mins)
-- convert minutes in hh:mm format
return string.format('%02d:%02d',mins/60,mins%60)
end
function timedifference (s)
year = string.sub(s, 1, 4)
month = string.sub(s, 6, 7)
day = string.sub(s, 9, 10)
hour = string.sub(s, 12, 13)
minutes = string.sub(s, 15, 16)
seconds = string.sub(s, 18, 19)
t1 = os.time()
t2 = os.time{year=year, month=month, day=day, hour=hour, min=minutes, sec=seconds}
difference = os.difftime (t1, t2)
return difference
end
function checkVar(varname,vartype,value)
-- check if create, if not exist, a variable with defined type and value
-- type=
-- 0=Integer
-- 1=Float
-- 2=String
-- 3=Date in format DD/MM/YYYY
-- 4=Time in format HH:MM
local url
if (uservariables[varname] == nil) then
telegramNotify('Created variable ' .. varname..' = ' .. value)
url=domoticzUrl..'/json.htm?type=command¶m=saveuservariable&vname=' .. varname .. '&vtype=' .. vartype .. '&vvalue=' .. value
-- openurl works, but can open only 1 url per time. If I have 10 variables to initialize, it takes 10 minutes to do that!
-- commandArray['OpenURL']=url
os.execute('curl "'..url..'"')
uservariables[varname] = value;
end
end
if (debug) then print('------------------------- openwindows --------------------------------') end
timenow = os.date("*t")
minutesnow = timenow.min + timenow.hour * 60
checkVar('HeatingOn',0,0) -- 0=heating off, 1=heating on, 2=cooling on
for n,v in pairs(zones) do -- check that temperature setpoint exist
-- n=zone name, v=array with temperature sensor name and max acceptable temperature drop in degrees
checkVar('zTemp_'..n,1,otherdevices[v[1]]) -- if zTemp_Cucina does not exist, create variable and store current temperature
if (otherdevices[v[1]]==nil) then
telegramNotify('Zone '..n..': temperature sensor '..v[1]..' does not exist')
end
end
if (uservariables['HeatingOn']==1) then
-- Heating enabled
-- compare zTemp_ZONE (old temperature) with current temperature
for n,v in pairs(zones) do
-- n=zonename (HeatingSP_n = setpoint temperature)
-- v[1]=tempsensor
-- v[2]=max difference
diffTemp=tonumber(otherdevices[v[1]])-uservariables['zTemp_'..n]
if (diffTemp>=0) then
-- current temperature > old temperature: update old temperature
commandArray['Variable:zTemp_'..n]=otherdevices[v[1]]
else
-- current temperature < old temperature
-- compute gradient (diffTemp/TIME)
gradient=diffTemp*60/timedifference(uservariables_lastupdate['zTemp_'..n]) -- degrees/minute
--if (diffTemp<=-0.2) then
if (debug) then print('Zone='..n..' gradient='..string.format('%0.3f',gradient)..' Temp='..otherdevices[v[1]]..'C diffTemp='..diffTemp) end
if (math.abs(gradient)<(0.2/30)) then -- temperature falls slowly, less than 0.2C on 30 minutes
-- |gradient|=v[2]) then
telegramNotify('Zone '..n..': window open!! Gradient='..string.format('%0.2f',gradient*60)..'K/hour');
commandArray['Variable:zTemp_'..n]=otherdevices[v[1]] -- update zTemp_ZONE temperature
end
end
--end
end
end
elseif (uservariables['HeatingOn']==2) then
-- HeatingOn=2 => Cooling
-- TODO
else
-- HeatingOn=0 => Heating or Cooling = OFF => don't check windows
end
if (debug) then
for i, v in pairs(commandArray) do
print('### ++++++> Device Changes in commandArray: '..i..':'..v)
end
end
::mainEnd::
return commandArray[/code]
- Details
- Category: Domotics
Introduction
This LUA script can be used to add the following functions to Domoticz:
- power outage detect and emergency lights => turns on Leds (connected to devices supplied by 12V + backup battery) in case of blackout (power failure)
- shows import and export electricity power, through red/green leds on Creasol DomBusTH (this small module has the ability to show 1 or more flashes on the red and green LEDs available in the module itself); red LED flashes 1 time if import power <1kW, 2 times if <2kW, ... green led flashes 1 time if export power <1kW, 2 times if power < 2kW, 3 times if power <3kW, ....)
- in case of high power usage, the script sets heat pump to work at lower level to reduce power consumption, or disconnect loads to prevent power cut. In case there are not any load that can be automatically disconnected, send alert through leds/buzzer/siren, and send alert by Telegram
- automatically enable loads in case of extra power from renewable sources, to increase the own-consuming: for example activate an electric heater if temperature is below a TempSet and available power (from photovoltaic?) is greater than the heater power
Block diagram
Although it seems a bit complicted, this diagram can be divided in the following parts:
- connection to the energy meter (with pulsed output, 1 pulse every Wh, 1000 pulses per kWh)
- power outage detection (in this schema, it's connected to the heat pump power line, because if the power to the heat pump is missing during the winter, it can be a real problem!)
- LEDs to be activated in case of power cut (emergency lights)
- red and green LEDs that show import or export power (1 flash=0-1kW, 2 flashes=1-2kW, 3 flashes=2-3kW, ...): this feature is available on Creasol DomBusTH module
- temperature and humdity monitoring
- relay outputs to activate electric appliances in case of extra-power production (from photovoltaic or other renewable energy source)
- heat pump controlling (to modulate its power consumption)
- buzzer in case that power usage is above certain thresholds, so the electricity meter can lead to a power disconnection
Connecting the energy meter
In the block diagram above the Eastron SDM230 power meter is used, but any power meter with pulse outputs for import/export energy can be used for this purpose.
SDM230 has 2 optoisolated pulse outputs, one that emits 1 pulse every 1Wh imported energy, and another one that emits 1 pulse every 1Wh exported energy.
The result that we want to achieve is to have two devices, in Domoticz, showing the imported and exported power.
Using a DomBus module to interface pulse outputs energy meter
In case of using a DomBus RS485 module to interface the energy meter, this is following procedure to configure two DomBus input ports as counters:
- connect the pulse outputs to any available I/O, for example IO8 and IO9 for DomBus12, IO1 and IO2 for DomBusTH or DomBus23. The SDM230 common terminal block should be connected to GND (0V).
- configure Pulse1 output, on SDM230, as EXP kWh (check the manual to know how to do that); Pulse2 is pre-configured as IMP kWh (measure the energy imported from grid)
- configure the Domoticz device connected to Pulse2: press Edit on that device, and replace in the Description field IN_DIGITAL or IN_TWINBUTTON (the default value) with IN_COUNTER,TYPENAME=kWh and save. DomBus12Please note that kWh is CASE SENSITIVE! Now the device will be automatically moved to the Utility panel and configured as energy meter. Edit it again, write a name (for example PowerMeter_Import), and select Usage type.
- if produced energy sDomBus12hould be measured, configure the Domoticz device connected to Pulse1 as before: press Edit on that device, and replace in the Description field IN_DIGITAL or IN_TWINBUTTON with IN_COUNTER,TYPENAME=kWh and save. Now the device will be automatically moved to the Utility panel and configured as energy meter. Edit it again, write a name (for example PowerMeter_Export), and select Return type.
- In case of both import and export devices are created, it's needed to specify on Import device the Unit number of the Export device, and vice versa. So, select Setup -> Devices and write down the Unit number corresponding to Import (for example 98), and Export device (for example 99), then go to Utility panel, edit Import device and add to the description ,OPPOSITE=99 (Unit of the Export device) and save; edit Export device and add to the description ,OPPOSITE=98 (Unit of the Import device) and save. In this way, when a pulse is received on Import device, the power on Export device will be immediately set to 0, and vice versa, when a pulse is received on Export device, the power on Import device will be set to 0.
Domoticz needs up to 5 minutes before updating the energy counter correctly.
Power outage detection and emergency lights
Use any device you prefer to detect if electricity from grid is available or not. In the diagram above, the voltage from a circuit breaker (heat pump circuit breaker, in the example) is sensed by a optoisolated input.
If a wired-bus is used to connect domotic modules, and this is supplied by a backup-battery power supply (13.6V power supply + lead acid battery, or a UPS), it's possible to connect LEDs to the domotic modules and turn on LEDs in case of power outage (as emergency lights). The same can be done on battery-powered devices that have enough energy capacity.
Show current imported / exported power on red / green leds
Maybe the following function is available only on DomBusTH module, that has a special feature so LEDs can be configured in Domoticz as Selector Switch where 0 means OFF, 10=1 pulse, 20=2 pulses, 30=3 pulses, 40=4 pulses, and so on. Check the video that shows DomBusTH module programmed to show the ventilation status on white led and current exported power on green led (and imported power on red led, of course)!
In this case it's possible to get red LED flashes a number of times corresponding to the current imported power, and similarly green LED flashing a number of times corresponding to the exported power. This can be useful in the kitchen to check the available power from renewable sources, or verify that we're not consuming more power than what is permitted by the electricity meter, without the need to mount large display or tablet to show the current power.
DomBusTH also integrates a white light (usable as emergency light), temperature and relative humidity sensors, 4 I/O (that can be connected to pushbutton switches, buzzer, ...) and 2 open-drain outputs (that can be connected to external relays).
Activating loads and appliances automatically
Using any relay module it's possible to activate some appliances when there is excess energy from renewable sources: in this case it's possible to improve the own-consumption and reduce the needed of energy from the grid.
The script is able automatically enable and disable heaters, heated towel rails, dehumidifiers, ....
Limiting electricity power from grid to avoid power cut
The script has 2 thresholds above which the electric power must be reduced within a certain time. In Italy, the electricity grid permits to get
- nominal power + 10% forever
- nominal power + 27% for max 90 minutes
- more than nominal power till 14 kW for max 2 minutes
Power thresholds and max durations can be defined in the configuration file for the script, so when the imported power is above those thresholds the script try to limit the imported power by regulating, for example, the heat pump and/or swithing off some loads.
If there is nothing else to switch off and imported power level is above one of these thresholds, script is able to activate buzzers, leds, sirens or other systems to notify the building people that they have to reduce power consumption. Also, it can send a notification by Telegram.
Installation
The following list of commands can be just copied and pasted in linux shell to download and install the scripts. For those who use Windows operating system, installation is quite simple: just download and copy 4 files in the domoticz/scripts/lua directory, and edit those files to match the own configuration. Files are available in https://github.com/CreasolTech/domoticz_lua_scripts
#from linux shell, type the following commands (copy and paste): lines starting with # are comments, and can be ignored
#become root
sudo su -
#enter domoticz directory /scripts/lua
cd ~pi/Domoticz/scripts/lua
if [ -d domoticz_lua_scripts ]; then
cd domoticz_lua_scripts
#update domoticz_lua_script local repository
git pull
cd ..
else
which git
if [ $? -ne 0 ]; then
#install git
apt install git
fi
#download domoticz_lua_scripts repository with all scripts
git clone https://github.com/CreasolTech/domoticz_lua_scripts.git
fi
cp -i domoticz_lua_scripts/script_device_power.lua domoticz_lua_scripts/config_power.lua .
if [ ! -r globalvariables.lua ]; then cp domoticz_lua_scripts/globalvariables.lua . ; fi
if [ ! -r globalfunctions.lua ]; then cp domoticz_lua_scripts/globalfunctions.lua . ; fi
#now edit config file
nano config_power.lua
Measuring instant power with Eastron SDM230 connected by ModBus
Used to check power from energy meter (SDM120, SDM230, ...) and performs the following actions
1. Send notification when consumed power is above a threshold (to avoid power outage)
2. Enabe/Disable electric heaters or other appliances, to reduced power consumption from the electric grid
3. Emergency lights: turn ON some LED devices in case of power outage, and turn off when power is restored
4. Show on DomBusTH LEDs red and green the produced/consumed power: red LED flashes 1..N times if power consumption is greater than 1..N kW;
green LED flashes 1..M times if photovoltaic produces up to 1..M kW
Installation
The script is available on github, click here to see the project on GitHub, or click here to get the script
File: scripts/lua/script_device_power.lua
Destination directory: DOMOTICZ_DIR/scripts/lua
To install the script, type the following commands from the Linux shell, ignoring the comments (starting with #). If you don't know how to do, search the web how to connect to your Linux device using putty or another ssh client.
#become root
sudo su -
#install/upgrade curl, a command to fetch files from the web
apt install curl
# go to domoticz directory
cd /home/pi/domoticz
# fetch the script
curl -o scripts/lua/script_device_power.lua https://raw.githubusercontent.com/CreasolTech/domoticz_lua_scripts/master/script_device_power.lua
# now, edit the script modifying the first part with your configuration
nano scripts/lua/script_device_power.lua
- Details
- Category: Domotics
The following script, written in LUA programming language for Domoticz, was designed to manage 1 or more pushbutton switches in this way.
If the button is pressed for a short time, less than 1 second, toggle output ON/OFF
If the button is pressed for a longer time, switch output OFF
The script should be placed into the folder domoticz/scripts/lua ; filename is important, and must be script_device_DESCRIPTION.lua , for example script_device_pushbuttons.lua
Pushbutton devices must be On/Off or Pushbutton* type, or any other type that return status "On" and "Off" (e.g. type Contact returns value "Open" and "Close").
[code]-- LUA script for Domoticz, used to manage one or more pushbutton switches
-- Written by Creasol, https://creasol.it
--
-- Domoticz passes information to scripts through a number of global tables
--
-- devicechanged contains state and svalues for the device that changed.
-- devicechanged['yourdevicename'] = state
-- devicechanged['svalues'] = svalues string
--
-- otherdevices, otherdevices_lastupdate and otherdevices_svalues are arrays for all devices:
-- otherdevices['yourotherdevicename'] = "On"
-- otherdevices_lastupdate['yourotherdevicename'] = "2015-12-27 14:26:40"
-- otherdevices_svalues['yourotherthermometer'] = string of svalues
--
-- uservariables and uservariables_lastupdate are arrays for all user variables:
-- uservariables['yourvariablename'] = 'Test Value'
-- uservariables_lastupdate['yourvariablename'] = '2015-12-27 11:19:22'
--
-- other useful details are contained in the timeofday table
-- timeofday['Nighttime'] = true or false
-- timeofday['SunriseInMinutes'] = number
-- timeofday['Daytime'] = true or false
-- timeofday['SunsetInMinutes'] = number
-- globalvariables['Security'] = 'Disarmed', 'Armed Home' or 'Armed Away'
--
-- To see examples of commands see: http://www.domoticz.com/wiki/LUA_commands#General
-- To get a list of available values see: http://www.domoticz.com/wiki/LUA_commands#Function_to_dump_all_variables_supplied_to_the_script
--
-- Based on your logic, fill the commandArray with device commands. Device name is case sensitive.
--
debug=1 -- 0 => do not write debug information on log. 1 => write some information to the Domoticz log
commandArray = {}
timeNow=os.time() -- current time in seconds
function timeElapsed(devName)
-- compute number of seconds since last update, for the specified variable name
s=otherdevices_lastupdate[devName]
year = string.sub(s, 1, 4)
month = string.sub(s, 6, 7)
day = string.sub(s, 9, 10)
hour = string.sub(s, 12, 13)
minutes = string.sub(s, 15, 16)
seconds = string.sub(s, 18, 19)
return os.difftime(timeNow, os.time{year=year, month=month, day=day, hour=hour, min=minutes, sec=seconds})
end
-- loop through all the changed devices
for devName,devValue in pairs(devicechanged) do
if (devName=='PUSHBUTTON_light_external') then
-- Example: press and release pushbutton in less than 1 second => toggle lights ON/OFF
-- press and release pushbutton for more than 1 second => switch lights OFF
if (debug > 0) then print('EVENT: devname="'..devName..'" and value='..devValue) end
-- 1 short pulse => toggles lights ON/OFF
-- 1 long pulse => lights OFF
if (devValue=='Off') then
-- pushbutton released
-- compute pulse length
pulseLen=timeElapsed(devName)
if (debug>0) then print("EVENT: pushbutton released, pulseLen="..tostring(pulseLen).."s") end
if (pulseLen<=1 and otherdevices['LightOut2']=='Off') then
-- short pulse, and commanded device is OFF => ON
commandArray['LightOut2']='On'
commandArray['LightOut3']='On'
else
-- long pulse, or commanded device was ON
commandArray['LightOut2']='Off'
commandArray['LightOut3']='Off'
end
end
end
end
return commandArray
[/code]
Another LUA script to manage pushbuttons
The following script is very similar to the previous one, but manages more pulse lengths:
in this example,
if pushbutton pulse is 1s or less => turns light1 ON,
if pushbutton pulse 2s => turns light2 ON,
if pushbutton pulse 4s => turns light3 ON
Each output must be configured to be automatically disabled after a certain number of seconds, else the script have to be modified to also turn off the outputs.
[code]-- LUA script for Domoticz, used to manage one or more pushbutton switches
-- Written by Creasol, https://creasol.it
--
-- Domoticz passes information to scripts through a number of global tables
--
-- devicechanged contains state and svalues for the device that changed.
-- devicechanged['yourdevicename'] = state
-- devicechanged['svalues'] = svalues string
--
-- otherdevices, otherdevices_lastupdate and otherdevices_svalues are arrays for all devices:
-- otherdevices['yourotherdevicename'] = "On"
-- otherdevices_lastupdate['yourotherdevicename'] = "2015-12-27 14:26:40"
-- otherdevices_svalues['yourotherthermometer'] = string of svalues
--
-- uservariables and uservariables_lastupdate are arrays for all user variables:
-- uservariables['yourvariablename'] = 'Test Value'
-- uservariables_lastupdate['yourvariablename'] = '2015-12-27 11:19:22'
--
-- other useful details are contained in the timeofday table
-- timeofday['Nighttime'] = true or false
-- timeofday['SunriseInMinutes'] = number
-- timeofday['Daytime'] = true or false
-- timeofday['SunsetInMinutes'] = number
-- globalvariables['Security'] = 'Disarmed', 'Armed Home' or 'Armed Away'
--
-- To see examples of commands see: http://www.domoticz.com/wiki/LUA_commands#General
-- To get a list of available values see: http://www.domoticz.com/wiki/LUA_commands#Function_to_dump_all_variables_supplied_to_the_script
--
-- Based on your logic, fill the commandArray with device commands. Device name is case sensitive.
--
debug=1 -- 0 => do not write debug information on log. 1 => write some information to the Domoticz log
commandArray = {}
timeNow=os.time() -- current time in seconds
function timeElapsed(devName)
-- compute number of seconds since last update, for the specified variable name
s=otherdevices_lastupdate[devName]
year = string.sub(s, 1, 4)
month = string.sub(s, 6, 7)
day = string.sub(s, 9, 10)
hour = string.sub(s, 12, 13)
minutes = string.sub(s, 15, 16)
seconds = string.sub(s, 18, 19)
return os.difftime(timeNow, os.time{year=year, month=month, day=day, hour=hour, min=minutes, sec=seconds})
end
-- loop through all the changed devices
for devName,devValue in pairs(devicechanged) do
if (devName=='PUSHBUTTON_light_external') then
-- Example: press and release pushbutton in less than 1 second => toggle lights ON/OFF
-- press and release pushbutton for more than 1 second => switch lights OFF
if (debug > 0) then print('EVENT: devname="'..devName..'" and value='..devValue) end
-- 1 short pulse => toggles lights ON/OFF
-- 1 long pulse => lights OFF
if (devValue=='Off') then
-- pushbutton released
-- compute pulse length
pulseLen=timeElapsed(devName)
if (debug>0) then print("EVENT: pushbutton released, pulseLen="..tostring(pulseLen).."s") end
if (pulseLen<=1) then
-- short pulse
commandArray['LightOut1']='On'
elseif (pulseLen>=2 and pulseLen<=3) then
-- medium pulse, 2s
commandArray['LightOut2']='On'
elseif (pulseLen>=4 and pulseLen<=6) then
-- long pulse, 4s
commandArray['LightOut3']='On'
end
end
end
end
return commandArray[/code]
Need help? join the DomBus channel on Telegram!
- Details
- Category: Domotics
Extracting a field from a multi-value sensor
Some devices in Domoticz contains mmm
ltiple values, separated by semicolon ';' :
- kWh meters contain both power and energy, for example "950;11658" where 950 is the power
- Temperature/Humidity sensors, for
ultiple values, separated by semicolon ';' :
- kWh meters contain both power and energy, for example "950;11658" where 950 is the power
- Temperature/Humidity sensors, for example "21.3;57" where temperature is 21.3°C and humidity 57%
- Wind sensor, for example "135;ESE;3;9;12.4;12.4" where 3=wind speed*10 and 9 is gust*10 (windspeed=0.3m/s and gust=0.9m/s)
To extract a field from the device string, using a lua script, it's possible to use the following code:
devValue=otherdevices['WindSensor']
--devValue='109;ESE;8;15;123' The 3rd field, "8", contains the wind speed * 10
i=0
for str in devValue:gmatch("[^;]+") do
i=i+1
if (i==3) then -- extract the third field
windSpeed=tonumber(str)/10
break
end
end
print("windSpeed="..windSpeed)
if (windSpeed>5) then
-- close the solar curtain, blinds, ...
-- ToDo...
-- if (otherdevices['devicePosition']=='Open') then
-- commandArray['deviceMotor']='Close for 50 seconds'
-- end
end
ESPEasy sensors stopped working with Domoticz
Since 2023, Domoticz configuration denies by default access to the JSON API using plain http (not encrypted) protocol.
To enable http, select Setup -> Settings -> Security -> API Protection: Allow (enabled)
Add icons to smartphone to enable and disable alarm system
It's very useful to have in the smartphone an icon to enable away alarm when leaving the house, and one to deactivate the alarm system before entering the house.
Domoticz supports many HTTP commands to activate scenes, groups, switches, ... and smartphones have many applications that can be used to call such URLs.
- Install on your smartphone the HTTP Shortcuts app
- Create a new regular shortcut, specifying a name (in the example Alarm Away)
- Specify the URL to call the Alarm Away group/scene (you have to edit that group/scene to get its idx, 13 in the example) writing the right parameters (IP, PORT, idx)
- Enable base autentication, specifying the domoticz username and password
- Choose an icon
- Save, and add the icon to your smartphone home screen.
- Duplicate this icon, edit the new one, change name to Alarm Off, change icon, change URL replacing On with Off , save and add icon to the home screen.
Now you have two icons on the smartphone, one to activate alarm system and one to disable it.
How to change Domoticz graph sampling time
Domoticz, by default, show 3 graphs: a daily graph with 1 sample every 5 minutes, a monthly graph and a yearly graph.
In some cases, 5 minutes is a very huge time if sensors data varies quickly: in these cases it's possible to reduce sampling interval for example to 1 minute (databases with sensors data will be much greater). In other cases, sensors data is very slow, so it's possible to set a longer sampling interval to save size and extend flash memory life.
To set a different sampling interval, it's possible to do as shown in the post https://www.domoticz.com/forum/viewtopic.php?f=47&t=10183&start=20#p129866
Edit the file DOMOTICZ_DIR/www/views/setup.html
Search for "shortlogtable" and add the following before the </table>-tag:
[code]<tr>
<td align="right" style="width:60px"><label><span data-i18n="Interval"></span>: </label></td>
<td><select id="comboshortloginterval" name="ShortLogInterval" style="width:60px" class="combobox ui-corner-all">
<option value="1">1</option>
<option value="5">5</option>
<option value="10">10</option>
<option value="15">15</option>
</select> Minutes
</tr>[/code]
Save it, delete your browser-cache and refresh your browser. I had problems with chrome keeping the old setup page even after deleting the cache, but using incognito mode worked to display the new page.
Finally, enter domoticz -> Setup -> Settings -> Log History and set the History value to 1 minute or longer sampling time.
- Details
- Category: Domotics
Introduction
Home automation systems have two main goals:
- make the building smart, adding new features and automations
- save power consumption
but to get advantage of such technologies, it must be EASY!
Domoticz is a free open source software that works as a home automation system controller, and it's quite easy to be implemented by people with a minimum programming skill.
It's written in C++, requires very low resources, is multi-platform and manages a large quantity of domotic hardware (sensors, actuators, I/Os, ...).
Although it best matches a linux platform (e.g. Raspberry PI single board controller, with less than 3W power consumption, equipped with Raspbian Linux OS, or Rock Pi S that consumes less than 0.5W), it works also on Windows and MacOSX.
Pros
- Optimized to work with computer with low resources: 0.5GB of RAM and 1GHz dual-core CPU is enough for almost any home automation system!
- Uses less than 50MB of disk, excluding backups.
- Written in a low-level programming language, C++: it's fast and light.
- Supports several programming languages (python, perl, php, lua) for plugins (used to implement new hardware and protocols) and scripts (used to create automations and to manage the installed devices).
- Almost all configurations are done by WebUI: no need to edit files!
- WebUI can be customized, and also it's possible to use Dashticz to implement a different WebUI (check picture )
- Very stable, easy updates with no worries.
- WebUI can be used by any web browser supporting HTML5, is responsive so it works well with PC, tablet and smartphone. Also, some APPs for Android and iOS are available, but not needed.
- The webUI also integrates the floorplans and roomplans to show a layout with all sensors/actuators inside.
Cons
- Lack of support for some hardware type
- WebUI may look "old-style"
Some screenshots and videos of Domoticz panels, shown in a PC browser
Energy panel, showing car charging, heat pump, photovoltaic, imported and exported power and controls related to energy/power.
Vehicle panel, showing car charging (using our DomBusEVSE module to make a DIY wallbox), total charging energy, also divided in energy from photovoltaic and from the grid, current battery level and range, charging power factor to measure the efficiency, vehicle distance and location, ...
Heat pump panel, showing the current power consumption, photovoltaic power, setpoints, status, ... The complete panel is very long, containing also the valve status, rooms temperature and humidity, ... It's possible to note that heatpump power is automatically managed by a Domoticz automation (script) to consume all power from photovoltaic.
Hot water panel, using a boiler with integrated heat pump, showing some controls directly integrated in the heat pump, and some external sensors.
Burglar alarm panel, with 3 working modes, display status (to see IPcams), sirens, some lights, PIR and magnetic contact sensors.
Floorplans (thanks to Paolo Patt. for the video)
What you can do with Domoticz
- Lights: turns ON/OFF by pushbuttons, at specific time (e.g. turn on 25 minutes after sunset and turn off 40 minutes before sunrise). Dimming and changing color.
- Doorbell: captures a snapshot from IPcam when someone ring the bell, and send the picture to one people or a group by Telegram: also email and many other notification systems are implemented.
- Gate, pedestrian door, garage door, main door can be open remotely (from smartphone, for example): when amazon delivery man ring the bell and you're away, you can see the picture on Telegram then you can open the gate to let him enter and deliver goods for you!
- Weather sensors: outdoor temperature, humidity, pressure, rain, wind, wind direction, .... can be monitored and recorded in graphs
- Monitors room temperature, relative humidity, CO2 and manages the heating/cooling/ventilation system in a smart way
- Monitors the power consumption/production from/to electric grid, sending alert when power consumption reaches a threshold above which there will be an imminent power disconnection, and activating/disabling appliances to optimize power usage
- When power from renewable sources is available (e.g. solar photovoltaic), it can manage the heat pump to consume most energy from renewable sources
- Monitors the rainwater tank level used for garden and vegetable garden irrigation
- Fully manage the alarm sensors (magnetic contact sensors, PIRs, radars, ...) and sirens, to get a fully functional and customizable burglar alarm system
- ...
Hardware support
- RaspberryPI and RockPI GPIOs
- DomBus modules
- ESP8266, ESP32 and derivated: cheap WiFi modules with several I/Os which can manage several device types
- RFXcom, Zwave, Enocean wireless devices at 433/868/915 MHz
- ZigBee devices, at 2.4GHz
- several 1wire and I2C bus devices
- Philips Hue (RGB led lamps)
- LAN GPIOs and sensors (Denkovi, Lantronix, ...)
- several solar inverters
and many other devices and protocols.
Check the article that shows in brief how to design a domotic system using DomBus modules !!
RaspberryPI
Althought Domoticz works in many platforms, including Windows and Mac, a good solution is Raspberry, a single-board computer hardware with quad-core ARM MCU that is stable, cheap and normally consumes less than 3W.
Normally Raspberry is equipped with a Raspbian operating system (Debian GNU/Linux for Raspberry), and as any Linux operating system supports many services like web, dhcp, dns, ftp, Samba, mail, ... safely and reliably.
RockPI S
This is a very small single board computer with quad-core CPU, 512MB of RAM, and very low power consumption: 400mW normally. An ideal solution for Domoticz, if working without many scripts (automations) requiring a lot of CPU.
Domoticz and Creasol DomBus modules
We are an electronic company producing home automation system modules optimized for high reliability and very low power consumption, available with 2 different firmwares:
- DomBus proprietary protocol, working with Domoticz
- Modbus standard protocol, working with almost any home automation systems
Creasol DomBus modules and Domoticz
What operating system are you using for Domoticz?
- Linux (Raspberry PI, Rock PI, NUC, PC, ....)? You can install the Creasol DomBus plugin in two ways:
- by using the Python Plugin Manager or Domoticz Plugin Manager, if you have installed it: this is a python plugin that permits you to easily install and update other python plugins.
- by fetching the Creasol DomBus plugin in this way:
cd /home/pi/domoticz/plugins #enter the domoticz/plugins directory
git clone https://github.com/CreasolTech/CreasolDomBus
- Windows: in the domoticz dir, enter (or create) the plugins folder, create a CreasolDomBus subfolder and put in the plugin.py and CreasolDomBusProtocol.py that you can download from https://github.com/CreasolTech/CreasolDomBus .
Restart Domoticz, and in Setup -> Hardware you'll find a new Creasol DomBus hardware: add an instance, giving a name (e.g. dombus), selecting the serial port attached to the RS485/USB converter (or virtual serial port attached to a network/RS485 module), and click on Add button.
When you connect a new DomBus module, you'll find a new device in the Domoticz Switches panel : select it (Edit button) and change it's address to a unique one, by modifying the the device Description field adding the text ,HWADDR=0x0001 (set the addresss to 1, if this is the first module), or writing an address of your choice. Click on Save button , then reloading the Switches panel (or Utility panel, ....) you'll find new devices associated to that module.
Next attached modules will be shown in the same way, and similarly you'll have to change the default address to 0x0002, 0x0003 and so on. Each module, one unique address! Domoticz will add automatically one device for each module port.
Also, many modules ports can be configured in different ways, for example a digital input can also be configured as water/gas/energy counter, twinbutton (UP/DOWN button controlled by a single port), temperature sensor NTC, analog input (to measure a voltage or a resistor value), distance sensor, ...
With Domoticz, configuration can be done by simply writing the device Description field.
Also, DomBus modules (with DomBus protocol) supports DCMD commands: similarly to KNX, it's possible to set a port to automatically activate different devices , for example if a button has been pushed shortly, toggle the light (connected to the same module or to another DomBus module), if it has been pushed for 1 second turn ON another device, if it has been pushed for 2 seconds do something else, and if 4 seconds ... It's clear that in this way it's possible to write simple automations very very easily, and they works also if the main controller (Domoticz) is down.
Finally, with DCMD commands it's also possible to activate Domoticz scenes/groups.
For very complex systems it's also possible to use more USB/RS485 adapters (or network/RS485 modules) to have different buses, for example one for each floor, enabling one DomBus hardware plugin for each bus. In this way if a bus stop working (for maintenance, for example), other buses continue to work.
In this case DCMD commands work only inside the same bus: it's not possible to automatically activate devices in another bus without passing through the Domoticz controller.
- Details
- Category: Domotics
Sometimes sensor or counter data registered by Domoticz in the database may be wrong due to bad measure or counters inited from a wrong value.
What to do?
Check the device chart with all values, and use shift+click on the bad values to cancel them from the database.
In case of counters, if you have to change the current energy value (or else), you have to:
1. Stop domoticz (service domoticz stop or other command)
2. Make a backup of domoticz.db database: (cp domoticz.db backups/domoticz_20231216.db or something else)
3. Connect to the database using the command sqlite3 domoticz.db
4. Modify the counter values in Meter_Calendar (or other table) using the following queries:
.tables
select * from Meter where DeviceRowID=1722 order by Date;
update Meter set Value=Value-56000 where DeviceRowID=1722 and Date>='2023-11-28 21:10:00';
update Meter_Calendar set Value=Value-56000 where DeviceRowID=1722 and Date>='2023-11-28 21:10:00';
5. also, you have to modify the last value for that device with the sql query
update DeviceStatus set sValue='6;518227.4281' where ID=1722;
Of course you have to use the right idx value corresponding to your device, and right values and date.
The examples above are only examples.
The step 5 is used to set the current value of the meter: your problem was that you updated the Meter and Meter_Calendar tables, but not the DeviceStatus tables, so when domoticz restarted, it continued to use the bad value.
I hope this can be helpful for you!
Domoticz: LUA script to create SelfConsumption, SelfSufficiency, TotalUsage, TotalProduction devices
- Details
- Category: Domotics
The script_time_selfconsumption.lua file, available at https://github.com/CreasolTech/domoticz_lua_scripts , permits to update 5 devices in Domoticz measuring the self-consumption and self-sufficiency of the building, when one or more power sources are available (photovoltaic on the roof, photovoltaic in the garden, wind turbine, ...)
The script will update the following utility meters:
- TotalProduced energy/power: (the array POWERMETER_GENS in config_power.lua contains the list of meters measuring power for each plant)
- SelfConsumption power: totalProduced-exportedPower
- TotalConsumption energy/power: selfConsumption+importedPower
- SelfConsumption percentage: selfConsumption/TotalProduced
- SelfSufficiency percentage: selfConsumption/TotalConsumption
Script installation
Enter the GitHub project https://github.com/CreasolTech/domoticz_lua_scripts and download script_time_selfconsumption.lua config_power.lua, globalfunctions.lua and globalvariables.lua into the DOMOTICZ/scripts/lua directory.
The following variables should be defined in config_power.lua:
PowerMeterImport='PowerMeter Import' -- Meter measuring import power
PowerMeterExport='PowerMeter Export' -- Meter measuring export power
POWERMETER_GENS={'PV_PowerMeter', 'PV_Garden'} -- list of devices measuring power from renewable plants (PV on the roof, PV on the garden, wind, ...)
-- The following 5 devices have to be created manually (Setup -> Hardware -> Create virtual device)
POWERMETER_USAGE='Power_Used' -- Electric+Counter virtual device (to be created manually)
POWERMETER_PROD='Power_Produced' -- Electric+Counter virtual device (to be created manually)
POWERMETER_SELF='Power_SelfConsumption' -- Electric+Counter virtual device (to be created manually)
PERCENTAGE_SELF='Perc_SelfConsumption' -- Percentage virtual device (to be created manually)
PERCENTAGE_SUFF='Perc_SelfSufficiency' -- Percentage virtual device (to be created manually)
Check the domoticz log for any errors, and wait at least 5 minutes to see the new devices charts.
Updating the database domoticz.db
The following operations are NOT RECOMMENDED because CAN DAMAGE THE DATABASE.
If you have months or years of data, and you want to import all data in the new meters, you can get information from the database, save in a CSV file to elaborate with a spreedsheet program, then add them to the database. ALWAYS MAKE A BACKUP OF THE DATABASE before each operation!
In my case, I have two solar photovoltaic systems, a powerImport device and powerExport device measuring the power from grid and power to grid. Domoticz is running in Linux OS. In the following instructions, comments describing each action are rapresented with #text...
cd /home/pi/domoticz #enter domoticz directory
cp domoticz.db /home/backup/domoticz_202407011753.db #make a backup of database
sqlite3 domoticz.db #run sqlite client program
sqlite> .output /tmp/file1.csv
sqlite> SELECT * FROM Meter_Calendar WHERE DeviceRowID=105 ORDER BY Date; #105=idx of first solar meter
sqlite> .output /tmp/file2.csv
sqlite> SELECT * FROM Meter_Calendar WHERE DeviceRowID=1942 ORDER BY Date; #192=idx of second solar meter
Open file1 and file2 with libreoffice or other spreedsheet program, then merge the column by using the same date in the same row, then add a column with the sum of the two energies in each row, and another column with the counter value, as shown in the following picture.
where 2104 is the idx of the new POWERMETER_PROD value (you can get it entering the Utility panel in Domoticz, and clicking on Edit button on that device).
Save the file in /tmp/file3.csv then
sqlite3> .mode csv
sqlite3> .import /tmp/file3.csv Meter_Calendar
sqlite3> UPDATE DeviceStatus SET sValue="0;35732997" WHERE ID=2104;
The second line imports the file data in the existing table with day-by-day data of every meter device, the third line update the meter status with the current counter value. Replace 35732997 with the last couter value in the file3.csv + today energy, in Wh.
Check the POWERMETER_PROD chart: you should see the total produced power in the last days, months or years.
Now, get exported energy data from the PowerMeterExport
device (idx=967 in my case):
sqlite> .output /tmp/fileExport.csv
sqlite> SELECT * FROM Meter_Calendar WHERE DeviceRowID=967 ORDER BY Date;
then open fileExport.csv and compute, for each date, SelfConsumption=ProductionEnergy-ExportedEnergy, and import data with the commands
sqlite> .import /tmp/selfConsumption.csv Meter_Calendar
sqlite> UPDATE DeviceStatus SET sValue="0;13673479" WHERE ID=2100;
where 2100 is the idx of the created POWERMETER_SELF device, and 13673479 is the last counter value + today SelfConsumption energy.
Calculate the selfConsumption_percentage=int(SelfConsumption*100/ProductionEnergy) and export a CSV file with the fields
idx,perc,perc,perc,date
then import in the database with the command
sqlite> .import /tmp/selfConsumption_perc.csv Percentage_Calendar
With percentage device you don't need to update the DeviceStatus table: that's needed only for counters.
Export in a spreedsheet the imported power (from grid), then calculate the TotalUsedEnergy=SelfConsumption+ImportedEnergy, and finally calculate the SelfSufficiency_percentage=int(selfConsumption*100/TotalUsedEnergy); import all data in the same way explained above.
- Details
- Category: Domotics
Introduzione
Perché questa pagina? In Italia la propaganda per il fossile imperversa: ricordiamo che l'Italia, nonostante muoiano prematuramente oltre 90 mila persone a causa delle polveri sottili, ogni anno versa circa 30 miliardi di euro in sussidi alle fonti energetiche fossili (2022): forse anche per questo c'è una insistente disinformazione che circola nei media e nei social.
Bando quindi alle chiacchiere da bar e veniamo alle auto elettriche!
Critiche ricorrenti ai veicoli elettrici
Dopo 8 anni bisogna cambiare la batteria!
Non è vero: di solito la batteria è garantita 7-8 anni con almeno il 70% di autonomia residua, e questo non significa che debba morire appena scaduta la garanzia. In gennaio 2021, prima di acquistare l'auto elettrica, leggevo di un taxista di Modena che aveva percorso con la propria auto elettrica oltre 400mila km, ed un'altra persona che ne aveva percorsi addirittura 630mila km. Beh, mi auguro di poter cambiare l'auto dopo 18 anni dall'acquisto, anziché tenerla finché avrò esaurito la batteria!
Non ci sono sufficienti colonnine di ricarica
Secondo https://www.motus-e.org/fake-news/ sul suolo nazionale sono presenti 33 mila punti di ricarica accessibili al pubblico (marzo 2023). Per avere un metro di comparazione, i distributori di benzina in Italia sono circa 21 mila, mentre gli impianti di distribuzione del metano sono fermi a poco più di 1.400 (Dati EAFO). La rete delle infrastrutture per la ricarica pubblica in Italia è peraltro in continuo e costante ampliamento.
Il problema sono le batterie perché usano metalli rari
Informazioni del 2023: mentre i telefoni e piccoli dispositivi attualmente utilizzano batterie Li-NMC (Litio, Nichel Manganese Cobalto) le quali hanno un'elevata densità di potenza (e sono quindi compatte), le auto elettriche si stanno orientando verso la tecnologia LFP (Litio Ferro Fosfato) che hanno una densità minore ma costano anche meno, non contenendo il cobalto. Mentre il Ferro è il metallo più abbondante sulla crosta terrestre, il Litio è il quarto metallo in ordine di abbondanza, quindi sono componenti tutt'altro che rari, tant'e' che lo stesso litio, presente nella quantità di 6-9kg per ogni auto, dopo il picco di costo dd fine 2021 ora sta diminuendo il suo prezzo in quanto sono state aperte nuove fonti di approvvigionamento.
Il problema delle batterie è lo smaltimento
Per le auto è fondamentale che la batteira abbia una elevata efficienza. Ma si stima che dopo 10-15 anni la batteria di un'auto possa diventare un punto critico (autonomia ridotta del 20% rispetto all'autonomia iniziale): in tal caso, oppure nel caso di smaltimento di un'auto, la batteria può essere impiegata come accumulo statico per case o altre strutture. Ad esempio lo stadio di Amsterdam è coperto da pannelli fotovoltaici e impiega numerose batterie delle prime Nissan Leaf rottamate (2012, ...) per l'accumulo di energia.
Dopo il riuso (quindi dopo 20 anni o più) potranno comunque essere riciclate al 95%, ovvero i minerali saranno recuperati interamente per generare nuove batterie o nuovi prodotti.
Qui potrete trovare il video di un agente di commercio altoatesino che ha percorso 300.000 km con la sua e-Golf vedendo l'autonomia scendere del 10%:
Costo chilometrico più alto rispetto al diesel
Ci sono colonnine veloci (150kW o più di potenza) il cui costo a consumo è veramente alto, 0.89€/kWh, ma bisogna essere anche un po' furbi: ci sono le tariffe flat!
Acquisti un "abbonamento" e in un mese hai N kWh di energia che puoi ricaricare a tariffa fissa, a prescindere dal tipo di colonnina. Se li finisci prima del tempo, acquisti un nuovo "abbonamento". Funzionano come le ricaricabili, ma poi si rinnovano ogni mese se non vengono disattivate.
Prendiamo la tariffa più svantaggiosa: 0.40€/kWh.
Con 1kWh si percorrono circa
- 5km in autostrada, a 130km/h => 8€/100km
- 7.5km in extraurbana => 5,35€/100km
Come vedi i costi sono decisamente inferiori rispetto al costo chilometrico per un'auto diesel o ibrida!
Il futuro è l'auto ad idrogeno
L'auto ad idrogeno è un'auto elettrica che, anziché avere la batteria, ha una cella combustibile.
Essendo che il processo di produzione dell'idrogeno "verde" ha un rendimento del 50-60% e il rendimento della cella combustibile è di gran lunga inferiore. Il risultato è che il costo a km di un'auto ad idrogeno è 3 volte quello di un'auto elettrica.
Ma allora perché si parla tanto di idrogeno verde nella tassonomia dell'Europa?
La produzione di idrogeno verde (da fonti rinnovabili) viene attualmente concepita come sistema di stoccaggio di energia nel momento di maggior produzione per l'utilizzo
- nell'industria chimica, ad esempio per la produzione di ammoniaca
- nella produzione di e-fuels, ovvero combustibili sintetici da impiegare in futuro in aerei e navi.
Produzione di idrogeno per la conversione in energia elettrica? NO, non conviene.
Esempio: autobus Solaris Urbino Hydrogen: ha una cella combustibile da 70kW, una batteria al titanato di litio da 29kWh, e con una carica di idrogeno da 37.5kg ha un'autonomia di 350km. Con il costo finale dell'idrogeno a 13.7€/kg (stazione di rifornimento di Bolzano, realizzata con 9.5 milioni di euro di cui 5 milioni di € di fondi europei), il costo per percorrere 350km risulta di 510€, 145€/100km. Il costo dell'idrogeno diminuirà con il tempo.
Facendo un confronto, l'autobus elettrico Iveco E-Way, con batteria da 350kWh, ha un'autonomia di 570km ed un costo di 19€/100km (calcolato con tariffa di ricarica 0.31€/kWh corrispondente ad un abbonamento Enel X-Way).
Allora il futuro sono i biocarburanti!
Solo per soluzioni estreme dove è richiesto un alta concentrazione di energia che le batterie non possono garantire.
Un ettaro di terreno coltivato a ricino per ottenere biocarburante consente di ottenere all'anno 46MWh di energia equivalente. Un ettaro di parco solare fotovoltaico produrrebbe in un anno 625MWh di energia elettrica, quindi la produzione di biocarburante non è conveniente. Fonte
Un altro studio che confronta la produzione di biodiesel (che comunque è un inquinante, producendo durante la combustione ossidi di azoto, benzoapirene e polveri sottili, tutti cancerogeni):
* Con 1mq di suolo posso coltivare colza per produrre biocarburante necessario a percorrere 2km
* Con 1mq di pannello fotovoltaico posso produrre energia elettrica per percorrere 900km
Fonte: https://www.vaielettrico.it/biocarburanti-vs-elettrico/
Fake news sui veicoli elettrici smentiti dal dirigente del Consiglio Nazionale delle Ricerche di Bologna
Due video in cui vengono date informazioni chiare e scientifiche:
https://www.youtube.com/watch?v=iS4eBzMAgQo
https://www.youtube.com/watch?v=hMq_-0rD1YQ
e-fuels, biocarburanti, accumulatori: https://youtu.be/eJN0AQX9sPg
Pericolo incendio su auto elettriche
Costi di esercizio di auto elettriche, ibride, gpl a confronto
I costi si riferiscono ad un'auto di proprietà, ed i costi vengono calcolati in modo standardizzato. Nel caso di auto elettriche, si considera la ricarica fatta alle colonnine pubbliche.
https://www.vaielettrico.it/costi-di-esercizio-a-confronto-elettriche-ibride-gpl/
Informazioni utili
- La potenza si misura in Watt, o kW (1000W). L'energia in Joule, Wh (corrispondente alla potenza di 1W per un'ora di tempo), kWh (corrispondente a 1kW di potenza per la durata di un'ora).
- La capacità della batteria viene in genere misurata in kWh: una batteria da 50kWh ha la possibilità di fornire una potenza di 50kW per un'ora di seguito, prima di scaricarsi completamente, oppure una potenza di 20kW per 2 ore e mezzo (se vai in autostrada a 130km/h probabilmente consumi 20kW, quindi avrai autonomia di 2 ore e mezzo).
Se devo caricare la batteria a 6kW di potenza, il tempo di ricarica dallo 0 al 100% sarà almeno di 50kWh / 6kW = 9h (dividiamo sia le cifre che le unità di misura!).
Analogamente, il tempo di ricarica dal 30% all'80% (metà capacità, ovvero 25kWh) sarà di circa 5 ore. - Al punto precedente ho scritto "almeno", perché il processo di ricarica non ha rendimento al 100%: c'è un'elettronica di controllo da alimentare, una pompa di calore per il raffreddamento della batteria (in estate), perdite sul convertitore AC/DC e FPC, perdite sui cavi... il rendimento nella ricarica varia molto a seconda della potenza (migliora con potenze alte) e potrebbe aggirarsi sull'85-90%. Teniamo quindi presente che per ricaricare l'auto buttiamo il 10-15% di energia, quindi anche i tempi di ricarica sono il 10-15% superiori rispetto alla formuletta del punto 2.
- Auto ibride e auto elettriche: due mondi molto diversi, e lo vedi sollevando il cofano. Un'auto mild-hybrid, full-hybrid e peggio ancora una plugin-hybrid hanno il cofano strapieno di componenti (che possono rompersi e che richiedono manutenzione periodica). Se apri invece il cofano di un'auto elettrica dentro trovi molto poco e ampi spazi vuoti.
L'auto elettrica non richiede cambi d'olio, filtro aria, filtro carburante. Non ha frizione e spesso non ha il cambio (solo modelli sportivi hanno in genere un cambio automatico a 2 marce). Nell'auto elettrica devi cambiare il filtro abitacolo, ogni 30mila km circa, e i pneumatici. Neanche le pastiglie dei freni si cambiano, in quanto si utilizza quasi sempre la frenata rigenerativa. - Benefici economici di un'auto elettrica: oltre alla riduzione del costo chilometrico, i tagliandi sono praticamente una formalità, non si paga bollo per 5 anni, e dopo i 5 anni si paga 1/4 del bollo calcolato su una "potenza termica" (quella riportata in libretto) bassissima: ad esempio la mia auto ha una potenza di 150kW, ma nel libretto di circolazione è riportata una potenza termica di 29kW. Praticamente dopo i 5 anni pagherò un importo irrisorio di bollo (ma questo è un dato attuale: in futuro le cose possono cambiare!).
- Meglio un accumulatore grande (tanta autonomia, a costo e peso maggiori) o un accumulatore più piccolo (meno autonomia, ma costo e poso inferiore)?
A parte il costo, minor peso significa minor consumo di pneumatici. Inoltre una maggior capacità di batteria implica quasi sempre un maggior tempo di ricarica, quindi quando capiterà di fare un viaggio molto lungo bisognerà fare più soste ma probabilmente più brevi rispetto ad un'auto con autonomia superiore.
Ho pianificato un viaggio di 1100km da Pieve di Soligo (Veneto) a Santa Maria di Leuca (Puglia) attraverso il sito https://www.abetterrouteplanner.com : con Kia Niro (con batteria da 64kWh, 450km autonomia, ricarica a max 77kW) mi basta fare 5 ricariche impiegando 3 ore 21 minuti di ricarica. Con una Peugeot e208 (con batteria da 50kWh, 340km di autonomia, ricarica a max 100kW) devo fare 7 ricariche impiegando solo 2 ore e 55 minuti.
Batterie grandi consentono di avere grandi autonomie, ma richiedono tempi di ricarica più lunghe a parità di potenza.
Quindi il fattore determinante nell'auto è la potenza massima di ricarica, e nei viaggi lunghi conta molto una buona programmazione delle ricariche: la potenza di ricarica è massima quando la batteria è scarica, e man mano che si ricarica la potenza deve necessariamente diminuire per non rovinare la batteria (non si deve superare la tensione massima consentita), quindi la soluzione più intelligente è ricaricare quando la batteria è intorno al 10% terminando la ricarica intorno all'80% o meno. - La ricarica domestica o al lavoro è certamente la soluzione più comoda: quando l'auto è parcheggiata si ricarica.
Il sistema EVSE presente nel sistema di ricarica consente di specificare al caricatore di bordo nell'auto la potenza massima che può assorbire in quel momento.
Si possono utilizzare dei cavi con presa schuko per caricare l'auto a 8-10-16A (da 1.5 a 3kW circa): è la soluzione più economica, lenta e bisogna stare attenti a non oltrepassare il limite di potenza contrattuale per evitare i distacchi, in quanto i cavi di ricarica non hanno un sistema per verificare la potenza prelevata dalla rete.
Si possono usare anche wallbox che misurano la potenza prelevata dalla rete elettrica: in questo modo la wallbox potrà specificare dinamicamente la potenza massima che l'auto potrà prelevare al fine di evitare distacchi e minimizzare il tempo di ricarica, oppure stabilendo quanta potenza al massimo prelevare dalla rete. Ad esempio, se ho il fotovoltaico e stabilisco che la wallbox potrà prelevare al massimo 0 Watt dalla rete, utilizzerò solo energia rinnovabile dal fotovoltaico per caricare l'auto. Se ho il contatore da 5kW e imposto nella wallbox una potenza massima di 5500W, utilizzerò la massima potenza disponibile per la ricarica e questa verrà variata in base ai consumi istantanei della casa (forno, lavatrice, eccetera) per non superare mai la potenza che ho impostato. - Importanza di non caricare a bassa potenza per non sprecare energia: nel seguente video viene mostrato come varia il fattore di potenza quando si ricarica un'auto. I caricatori di bordo lavorano male a bassa potenza, pertanto è bene ricaricare sempre ad almeno 4kW.
- Ricarica pubblica: ci sono due tipi di colonnine, AC (in corrente alternata) e DC (in corrente continua).
Le colonnine di ricarica in AC forniscono una corrente alternata, a 230V monofase o 400V trifase, che verrà convertita in corrente continua dal caricatore a bordo auto (On Board Charger). Come detto nel punto precedente, fornisce anche un segnale di controllo (Control Pilot) attraverso cui specifica la corrente massima di ricarica (segnale PWM 1KHz con duty cycle variabile), cosicché l'OBC nel tempo massimo di 6s dovrà adattare la corrente di ricarica al limite massimo imposto dalla colonnina. Solitamente gli OBC hanno una potenza massima di ricarica pari a 7, 11 o 22 kW.
Per ricaricare la batterie con velocità maggiori serve un caricatore dotato di semiconduttori molto costosi e impianto di raffreddamento forzato: nasce per questo la colonnina di ricarica DC, che ha il sistema di conversione da corrente alternata trifase a corrente continua specifico per caricare la batteria secondo le indicazioni fornite dal Battery Management System presente nell'auto. In sostanza, l'auto comunica alla colonnina DC la percentuale di carica, la tensione massima e la corrente massima di ricarica, che variano in funzione alla temperatura e allo stato di carica della batteria, e seguono un certo profilo di carica, e la colonnina fornisce energia in base a tali parametri. Ci sono colonnine DC a 25, 50, 75, 100, 150, 250, 350kW, che funzionano sia a 350-400V sia a 800V (alcune batterie, per aumentare la velocità di ricarica, lavorano a 800V massimi).
Dal grafico sottoriportato si evince che la velocità (potenza) massima di ricarica si ha quando la batteria è molto scarica, per poi diminuire quando la batteria raggiunge il 75-80%, e questo è uno dei motivi per cui, nei viaggi molto lunghi in cui si devono eseguire più ricariche, conviene eseguire ricariche brevi fino al 70-80% piuttosto che voler raggiungere per forza il 100% di ricarica.
Ricaricando la batteria al 100% inoltre si perde la possibilità per i primi km di sfruttare la frenata rigenerativa, in quanto la batteria non avrebbe la possibilità di accumulare energia essendo già carica completamente.
Modalità di pagamento per ricaricare il veicolo elettrico
Vengono elencate le modalità per pagare le ricariche al proprio veicolo, con la premessa che non essendo un esperto potrebbero esserci delle imprecisazioni.
- Attraverso app su smartphone (Nextcharge, Be Charge, Enel X Way, A2A E-Moving, Shell Recharge, EV Way, ...).
Si scarica l'app, si crea un account, si definisce la modalità di pagamento (inserendo i dati di una carta di credito/debito, di solito).
Esiste l'interoperabilità fra i gestori delle colonnine, così dall'app di Enel X Way è possibile ad esempio vedere anche le colonnine di Be Charge, A2A, Hera, eccetera, ma probabilmente non si vedranno le colonnine DriWe o di altri operatori minori.
L'app Nextcharge ha un costo di ricarica generalmente più alta, ma è l'app che vede la maggior parte dei gestori, ed è molto ben fatta. - Attraverso RFID, in formato tessera o portachiavi, che è possibile acquistare dopo aver installato l'app del gestore.
Nextcharge credo fornisca ancora gratuitamente la card RFID dopo l'attivazione del wallet (portafogli virtuale: si carica con 20-50€, poi però ogni anno va ricaricato con almeno 20€ quindi la card o l'app vanno utilizzate!). Altri gestori chiedono un contributo di 5-10€ per avere la card.
La card o portachiavi RFID sono comodissime ed immediate da utilizzare: si passa sulla colonnina per abilitare la ricarica, e la si ripassa per terminare la ricarica. - Plug&Charge: è un sistema in fase di consolidamento che consente alla colonnina di ricarca (mediante un lettore presente nel connettore) di leggere un tag RFID presente sull'auto al fine di identificare il conto associato all'auto da cui prelevare l'importo di ricarica. E' il sistema più semplice e immediato da utilizzare, può funzionare solo su colonnine tethered ovvero che includono il cavo di ricarca, ed al momento funziona su pochissime colonnine e pochissimi tipi di auto.
- Carte di debito o credito: alcune colonnine supportano anche questa modalità, che però risulta alquanto scomoda in quanto è necessario poi specificare anche i propri dati fiscali.
Inoltre vi sono diversi tipi di modalità di pagamento relative ad app e RFID:
- addebito dei costi di ricarica su carta di credito/debito (Enel X Way, Be Charge, ...)
- creazione di un wallet ricaricabile con addebito nel wallet (Nextcharge, Be Charge, ...)
- abbonamento mensile per avere uno sconto sulle tariffe del 10-40% (Be Charge, ...)
- tariffa flat per tot kWh mensili (Enel X Way, A2A, ...). Ad esempio con l'abbonamento A2A E-Moving Medium si paga 29€ per poter caricare fino a 80kWh, ovvero al costo di 0.36€/kWh. Prima della scadenza, la tessera flat può essere chiusa nel caso non si intenda rinnovarla per il mese successivo. Sono sistemi molto utili per il periodo estivo in cui si fanno viaggi lunghi e tante ricariche, essendoci tariffe flat ancora più convenienti per caricare diverse centinaia di kWh da qualsiasi colonnina a tariffe molto convenienti.
Per iniziare consiglierei di scaricare l'app Nextcharge per poter individuare quasi tutte le colonnine presenti e per ricariche saltuarie (in quanto non sono economiche), e A2A E-Moving qualora si faccia viaggi lunghi e si sia interessati a ricariche flat in Italia.
Tariffe di ricarica in Italia applicate dai diversi operatori italiani e stranieri
Consulta il sito web https://tariffev.it
Curiosità
Quanto costa percorrere con l'auto elettrica 15mila km in un anno?
Dipende da quanto si paga l'energia elettrica e come si ricarica. L'immagine fornisce in sintesi il caso reale (non estremo) di ricarica prevalentemente durante il giorno (le giornate in estate sono lunghe, e si può ricaricare anche nel weekend) e disponibilità di un impianto fotovoltaico sul tetto, senza accumulo, il costo nel 2022 per percorrere 15mila km, riscaldare e raffrescare casa, far funzionare lavatrice, lavastoviglie, 2 frigoriferi, 1 congelatore, eccetera, è stato di negativo (ovvero il corrispettivo per la vendita dell'energia è stato superiore alla somma delle bollette elettriche e delle ricariche dell'auto eseguite alle colonnine pubblichedi cui 64€ per la ricarica alle colonnine pubbliche).
L'elettrificazione di casa e della mobilità è certamente un ottimo investimento: oltre alla riduzione dei costi, il beneficio economico è impagabile. Immagina di uscire per una passeggiata e non sentire la puzza di smog dovuto al trasporto e al riscaldamento a legna/pellet!!!
Come riportato nell'immagine, l'impianto fotovoltaico è l'artefice del cambiamento (verso un mondo meno inquinato) e del risparmio, ma hanno contribuito in maniera significativa anche l'auto elettrica e l'impianto domotico, utilizzando il software free Domoticz che attraverso uno script controlla la pompa di calore in modo da privilegiare il consumo nei momenti in cui l'elettricità costa meno e il rendimento risulta migliore.
Aggiunge alcune considerazioni: va benissimo l'impianto fotovoltaico a SUD d'inverno, se si usa la pompa di calore: la maggior parte dei consumi avviene nei mesi di dicembre/gennaio in cui ci sono poche ore di luce ed in cui il sole sorge a sud-est e tramonta a sud-ovest. Al contrario, nei 6 mesi caldi, il sole sorge a est e tramonta a sud: in questo caso il fotovoltaico su due falde rivolte a est e ovest consente di avere produzioni anche di prima mattina e in tardo pomeriggio, quando l'energia da fotovoltaico scarseggia ed i costi risultano più alti, contribuendo quindi sia a stabilizzare la rete sia ad avere una migliore remunerazione evitando il "picco di mezzogiorno" in cui ci sarà presto un eccesso di produzione elettrica.
Il seguente grafico mostra l'andamento del prezzo (linea rossa) e dell'energia richiesta dall'Italia ora per ora, stimata per domani. Normalmente, nei giorni lavorativi, il prezzo sale al mattino (quando c'e' tanta richiesta di energia e ci sono tanti impianti fotovoltaici "stupidi" che impiegano l'energia per ricaricare l'accumulatore), e poi alla sera quando viene meno l'energia dal fotovoltaico; nelle belle giornate di sole, da aprile a ottobre, si può invece osservare un calo dei prezzi nelle ore pomeridiane (quando c'e' tanta produzione fotovoltaica e gli accumulatori sono carichi).
Il seguente grafico mostra l'andamento dei prezzi orari dell'energia in una giornata di weekend soleggiato, sabato 27 maggio 2023: si può notare come l'elevata produzione da fotovoltaico induca una drastica riduzione dei prezzi, a dimostrazione che le energie rinnovabili contribuiscono a ridurre il costo dell'energia.
Sarebbe tuttavia opportuno che l'energia venga pagata dal consumatore in base al PUN orario, come avviene in Danimarca, affinché l'utente sia protagonista della stabilizzazione della rete: nel caso specifico sarebbe infatti opportuno che le auto elettriche vengano caricate quando il PUN è basso ovvero quando c'e' un eccesso di produzione.
Consiglio: nel caso di fotovoltaico rivolto a est e ovest è possibile installare 8kW circa di pannelli fotovoltaici collegati ad un inverter da 6kW (proprio perché non c'e' il picco di produzione). Meglio comunque sarebbe un tracking solare in grado di garantire una produzione quasi costante durante il giorno: maggior informazioni nella pagina in inglese con alcuni esempi sul tracking solare
Quali sono i consumi di una casa con riscaldamento/raffrescamento con pompa di calore e impianto radiante?
Ho fotovoltaico senza accumulo, e non sono contrario all'accumulo a prescindere. Più avanti penso di installare un piccolo accumulo per superare le ore serali in cui il costo è alto (essendo alti i consumi serali).
Sono di Treviso, ho impianto da 7.2kWp sul tetto, su falde a est e ovest, che d'inverno rende come un 4.5kWp a sud.
Riscaldo casa con pompa di calore, e nei mesi critici (dicembre/gennaio) il PV produce circa 4-10kWh/giorno e devo importare circa 30-40kWh al giorno. In questo caso le batterie non servono, soprattutto perché ho la pompa di calore che, grazie all'impianto domotico autocostruito, insegue i consumi del fotovoltaico (se produce molto, aumenta i suoi consumi).
Negli altri periodi importo circa 4-5kWh al giorno: di notte la PDC non funziona, e d'estate raffresco il pavimento di giorno in modo da accenderla solo quando il fotovoltaico produce.
Nel 2022 l'energia elettrica per alimentare e riscaldare casa, e percorrere anche 15mila km con l'auto elettrica, mi è costata meno di zero (ho guadagnato 117€ grazie alla remunerazione dell'energia immessa in rete).
Quindi, per le mie esigenze, posso dire che:
* la maggior parte di energia viene importata d'inverno, e qui l'accumulo non serve a nulla a meno che tu non abbia un fotovoltaico di potenza esagerata che produce a mezzogiorno molto più di quanto consumi la PDC
* se ottimizzi l'uso degli elettrodomestici (accendendoli di giorno) e puoi ricaricare l'auto di giorno, ti basta un accumulo che copra il tuo fabbisogno notturno, che in genere è basso
* se puoi caricare l'auto solo di notte puoi pensare ad un accumulo più grande, ma tieni presente che stoccare e recuperare energia non è un processo senza perdite!
* l'auto elettrica si ricarica bene durante la pausa pranzo in cui la potenza dal fotovoltaico è massima. Nei mesi invernali la ricarico invece di notte.
Comunque sto valutando la possibilità di installare un accumulo da 6-10kWh per migliorare l'autoconsumo da marzo a ottobre, consapevole che i vantaggi non saranno economici bensì di sistema, nel senso che ridurrò l'impatto di casa sui consumi dalla rete.
Energia prodotta dal fotovoltaico sul tetto: Treviso, 2700Wp verso est + 4500Wp verso ovest
Energia importata dalla rete (fotovoltaico 7.2kWp, no accumulo, ampia casa A4 con pompa di calore)
Energia immessa in rete
Quanto consuma l'auto elettrica in montagna?
In salita consuma, in discesa ricarica. La disponibilità di una grande batteria consente di poter immagazzinare molta energia, a differenza delle auto ibride o ad idrogeno.
Ad esempio a febbraio 2022 ho fatto un viaggio di piacere sulle Dolomiti venete/trentine. Salito in cima al Passo Pordoi (2239m SLM) lo stato di carica della batteria era 59%. Da li sono sceso a Canazei, Moena, risalito al Passo San Pellegrino, Falcade, Agordo, Trichiana, e risalendo verso il Passo San Boldo, a circa 400m SLM lo stato di carica era ancora al 59%. In sostanza ho percorso 106km sfruttando l'energia accumulata scendendo dal Passo Pordoi.
E' possibile autocostruirsi un sistema di ricarica / wallbox che si integri con la domotica?
Si, bisogna ovviamente essere abbastanza esperti di elettronica/informatica/impianti elettrici.
Ci sono diversi moduli EVSE in commercio che controllano la ricarica del veicolo e si integrano con sistemi domotici attraverso collegamento WiFi, LAN o RS485. Creasol produce un modulo, ad uso sperimentale, che supporta i protocolli DomBus e Modbus RTU, e può essere utilizzato con qualsiasi sistema domotico opensource (Node_RED, HomeAssistant, ioBroker, OpenHAB, Domoticz, ....).
Energia rinnovabile in Italia
Collegamenti HVDC
Terna, il gestore dell'infrastruttura di rete di trasmissione italiana ha in cantiere, a partire dal 2023, di installare due reti dorsali HVDC per portare 2GW di potenza dal Sud Italia e isole verso il Nord. Spesa complessiva 11 miliardi di euro [Fonte]. HVDC sono collegamenti ad 500-600kV in corrente continua, quindi utilizzano due cavi conduttori, offrendo una perdita di circa 3% ogni 400km. Richiede delle costose stazioni di conversione AC/DC e DC/AC per la conversione in trifase e il collegamento quindi alla rete HVAC esistente (trifase a 115kV, 220kV o 380kV).
Parchi eolici offshore
Sono installazioni di turbine eoliche al largo della costa, su pali fissati sul fondale (se fondale basso) o su piattaforme galleggianti ancorate al fondale.
I vantaggi delle installazioni offshore sono:
- ridotto impatto visivo: a 20km o più dalla costa si intravedono appena
- maggiore velocità del vento e minor turbolenze, dovute alla superficie piatta
- maggiore disponibilità di vento
Attualmente (2023) hanno un costo (a parità di potenza) superiore rispetto alle installazioni onshore (in terra ferma) dovute al costo della piattaforma galleggiante ed ancoraggio.
Facendo un paragone con il punto precedente, con 9 miliardi di euro sarebbe possibile installare parchi eolici offshore per una capacità di 3GW (magari in alto tirreno o adriatico) da collegare direttamente alla rete elettrica del Nord Italia. Forse sarebbe una soluzione più vantaggiosa rispetto a quella di installare tutto al Sud e dover investire capitali enormi per poi interconnettere il Sud al Nord, dal momento che il Nord attualmente richiede almeno 10GW di potenza rinnovabile.
Produzione annua in relazione alla velocità del vento
Il sito web di Energy Hunters risulta molto ricco di informazioni relative all'eolico.
Interessante è anche la caratteristica degli aerogeneratori, avvero la producibilità annua di energia in funzione della velocità del vento:
La potenza aerodinamica varia con il cubo della velocità, ma ci sono molti aspetti da dover tener presente fra cui la capacità dell'aerogeneratore di variare l'inclinazione della pala per ottimizzare la produzione e mettersi in sicurezza in caso di elevate ventosità.
Fotovoltaico
Efficienza delle diverse tecnologie fotovoltaiche in relazione allo sviluppo (clicca per scaricare PDF ad alta risoluzione).
- Details
- Category: Domotics
A very cheap and useful fire alarm system is presented below. The idea is to use simple temperature sensors and get an alert on building internal sirens and Telegram when the temperature in a room increases quickly.
As temperature sensors are commonly used in any room for climatization, no extra sensors are needed.
Fire alarm requirements
- Single board computer with low power consumption, like Rock PI S or Raspberry or Nuc.
- A microSD for Rock PI S or Raspeberry with operating system and Domoticz free open-source software to manage all sensors and automations reliably.
- script_time_fireAlarm.lua file (already installed in the Domoticz microSD shown at previous step)
- temperature sensors
Temperature and humidity sensors for home automation systems
If you want to try our DomBusTH module, it integrates a temperature and relative humidity sensors, as like as RGW led, 4 I/Os, 2 outputs, in a small board that can be placed on a blank cover.
This is the perfect board to be placed in every room where temperature and humidity should be monitored for climate control. Through the 2 outputs it's possible to control 2 relays to open/close a shutter, for example. The 4 I/Os can be connected to alarm sensors (magnetic contact sensors applied to windows/doors, PIRs) or pushbuttons.
Also, using the script below it's possible to realize a fire alarm system that works also with this kind of temperature sensor.
The following video shows the DomBusTH module installed on a blank cover, measuring temperature and relative humidity, showing the current imported (red) or exported (green) power in kW, having a touch sensor used to select two different functions, and 6 I/Os (2 I/Os connected to a piezo buzzer).
Fire alarm script
On https://github.com/CreasolTech/domoticz_lua_scripts it's possible to find two scripts:
- script_time_fireAlarm.lua , the script that check every minute the temperature on each room and verify that it does not increases to fast
- config_fireAlarm.lua , the configuration file where it's possible to list all zones, defining the temperature device name and temperature increase rate.
When the temperature in a room increases, in 1 minute, more than the value specified for that room, a notification is sent to a Telegram group (or channel) and, optionally, one or more devices can be activated: for example it can activate the internal siren for few seconds, and the light in bedroom during the night.
- Details
- Category: Domotics
Introduction
This article shows how to manage the heat pump and ventilation system (HVAC) with Domoticz open-source software installed on a Rock PI S or Raspberry PI (but any other hardware should be OK), to use the most energy from renewable sources (photovoltaic system in this case) reducing the electricity bill.
First, a smart building should not have thermostats to regulate room temperature, because they usually are not so smart as a domotic controller. It's preferred to have a temperature (and humidity) sensor in some rooms and modify the outlet water temperature to get the best comfort and power consumption.
Controlling a building with radiating system, heat pump and photovoltaic on the roof is a bit complex, because several items must be kept into account:
-
outdoor min and max temperature
-
room temperatures (called diff, difference from set point and room temperature)
-
variation of diff with the time (derivative of diff on time)
-
current power from grid (if negative, some extra power is available from solar photovoltaic, and it's better to use it increasing heat pump power)
-
and finally, maybe you want to reduce power consumption during the peak hours (usually 7-9 in the morning, and 18-21 in the evening) to contribute to the electricity grid stability!
The goal is to get a comfortable temperature in all rooms, maybe reducing the temperature when rooms are not used, and overheat the building, during winter, when extra power from photovoltaic is available: if setpoint is 21°C but extra power from photovoltaic is available, setpoint can be dinamically raised to 21.5 or 22°C for example.
For this reason thermostats are not a smart solution, if they don't know the current building power consumption! It's better to have temperature/humidity sensors in some rooms and let the home automation system decide what to do!
Domoticz supports several scripting languages, and LUA script has been chosen in this case because very clear so it's easy to learn, use and customize.
Two different methods were used with the heat pump EMMETI Mirai SMI EH1018DC : in the first section it's explained how to control the heat pump by Modbus, changing the water temperature and compressor power, and then a rough control using their ON/OFF inputs (as an example for other heat pumps that have not a bus to control them).
Controlling the heat pump by ModBus
The heat pump has one input to select half power or full power: it's mainly used during the night to reduce noise, limiting the compressor and fan frequency to 50% or so (the compressor frequency/power can be selected from 0 to 100%).
Water temperature is a good solution to maximize the house comfort, while compressor frequency is perfect to control the usage power.
By default the heat pump has an algorithm to compute the outlet water temperature based on current outdoor temperature, and regulate the compressor frequency (power) proportially to the difference between the computed temperature and current water temperature.
The idea is to implement a better control of the outlet water temperature based on:
- difference between room setpoint and current temperature diffTemp
- derivative of diffTemp (it's important to know if the difference between setpoin and temperature is decreasing or increasing!)
- minimum (maximum in the Summer) outdoor temperature
- current power from the photovoltaic system (to improve own consumption)
- peak power of the electrical grid, to reduce power consumption in the peak hours (in the early morning and late afternoon): this is used only to help the electrical network to avoid peak power and high energy prices.
The control algorithm is implemented, in a LUA script that computes the right value of outlet water temperature and compressor frequency (power), using the command mbpoll to set the parameters to the heat pump control by Modbus (RS485).
Heatpump RS485 is connected to the domotic controller (RaspberryPI in this case) by a RS485/USB adapter; also the DomBus31 module is used to control heat pump inputs (thermostat on/off, coil/radiant temperature, heating/cooling and full power/half power.
Actually, heat pump is always configured in "night mode", and lua script controls both
- outled fluid temperature needed to have the right comfort in the house
- compressor power percentage, to regulate power
During the night, both fluid temperature and power are reduced to limit power consumption and fan/compressor noise.
During the day both fluid temperature and power are increased, with the exception of the peak hours 9-10 and 18-21 where it's a good practice to reduce consumptions for a better electricity grid stability.
If there is an extra production from photovoltaic (energy exported to the grid), fluid temperature and power are increased to consume all available energy from photovoltaic. Also, room setpoints are automatically increased in case of extra power from photovoltaic, to reduce the power consumed in the evening or in the night.
The files script_time_heatpump_emmeti.lua and config_heatpump_emmeti.lua are available in the Github https://github.com/CreasolTech/domoticz_lua_scripts
Domoticz plugin to manage Emmeti Mirai SMI heat pump
A plugin for Domoticz that manages heat pumps made by Emmeti is available at https://github.com/CreasolTech/domoticz-emmeti-mirai
- Details
- Category: Domotics
Converting a simple existing door bell to a smart doorbell with Domoticz
The purpose of this document is to illustrate how to configure and connect Domoticz/Raspberry controller to get a snapshot on our Telegram app when someone push the doorbell.
The 12Vac used to supply the door bell chime or buzzer is connected to an optoisolated input on the DomBus23 module, so when the chime/buzzer is supplied, a trigger is sent to Domoticz that activates a script to grab a picture from the IPcam and send it to a Telegram channel or group, so the family members can receive the photo on their smartphones as soon as someone push the doorbell button.
Hardware example using a DomBus module
DomBus23 has many inputs and outputs and can be used to performs other functions, such as opening a pedestrian gate or main door (it has 2 relay outputs), manage a courtesy light with led stripe with dimming function (it has a 30V 12A mosfet), ....
If the doorbell uses 230Vac or 110Vac power, it's possible to connect the chime/buzzer to the IN3 optoisolated input, that supports high voltages.
DomBus modules are designed to have a very low power consumption, less than 10mW, and get a very reliable connection to the domotic controller by RS485 bus (simple shielded cable with 4 wires, 2 for data and 2 for 12V power supply). Using a 12V power supply with lead-acid backup battery permits to get the system working even in case of power outage.
Software configuration
It's assumed that you already have Domoticz installed in a computer, like Raspberry PI or another single board computer, or a PC/Mac.
DomBus modules are connected to the domotic computer through a USB/RS485 adapter, and a 12V power supply.
Select the IN1 input device on Domoticz Switches panel, and specify the script to activate when the doorbell ring.
Download the scripts sendsnapshot.sh and telegramSendText.sh from GitHub and put them in DOMOTICZ/scripts directory.
Edit those files to set the IPCam and Telegram parameters.
How to query ONVIF camera to get the video stream and snapshot URI
Some bad chinese ONVIF ipcams do not have snapshot URI: very bad, but we can generate a snapshot from the video stream, using ffmpeg!!
ONVIF is a standard protocol to query ONVIF ipcams, so it's possible to get ipcam characteristics sending some queries using SOAP system.
A very good tutorial to detect video and snapshot URI of your ONVIF camera can be found at http://me-ol-blog.blogspot.com/2017/07/getting-still-image-urluri-of-ipcam-or.html
How to get a Telegram token and chat_id, needed to send messages/pictures by Telegram
Telegram is a very powerful instant messaging system, similar to whatsapp, but much better because open-source, multi-platform (not only for smartphones....Telegram Desktop works on Linux, Mac, Windows!), and very customizable through its API.
The following instructions can be used to get a photo on Telegram when someone push the door bell button.
Below the step-by-step instructions to create a BOT on Telegram and a channel used to send notifications to you and other people:
- obviously, you must have telegram installed on your smartphone, and also Telegram Desktop on your PC/Mac/Linux : you can download it from https://desktop.telegram.org/
- search in you contact list for BotFather, select it and start it
- type /newbot
- type a name for this bot, for example domApi
- type a username, ending with "bot", for example domApiUserbot
- at this point, BotFather will return you an API key (below an example in bold) that you must store somewhere:
784324329:EETRNJU3jQEGWQdjNv3llb4bnDSDREGuuuL - Now, using your smartphone, create a new channel (not group: channel!), select a name for it (for example Domoticz), set it public and specify a link for it (must be unique), for example t.me/dom123abc
Please note that only the channel owner is able to configure the channel as public!
Add members to this channel: your partner, sons, everyone that should receive domoticz notifications - Enter the channel, and add a new administrator: select the bot that you just created at step 3-6 (search for domApiUserbot or the username typed at step 5)
- Add to that channel any other users you want, if you need to send picture/notifications to those users.
- Open the following URL from your browser (replace the API key with your, and channellink with your):
https://api.telegram.org/bot784324329:EETRNJU3jQEGWQdjNv3llb4bnDSDREGuuuL/sendMessage?chat_id=@dom123abc&text=test - You'll get an output like the following picture: store somewhere the ID (-1001194779203, in this example): this is the ID for your channel, where domoticz have to send notifications, and you have to write it (with the minus sign, if exist) in the sendsnapshot.sh script below (variable TELEGRAMCHATID).
- From Telegram on your smartphone, configure the created channel to set channel type Private.
- On Domoticz, go to Switches, select the doorbell button input, Edit, and write into the "On Action" text box script://sendsnapshot.sh : in this way, every time people push the doorbell button, Domoticz will execute sendsnapshot.sh script that will grab a snapshot from the IPCam and send it to Telegram channel, so every user you have put in that channel will receive the photo of people that rang the door bell.
- Details
- Category: Domotics
Introduction
DomBus modules use RS485 serial bus to communicate: with a 4 wires shielded cable (common alarm cable with 2*0.50mm² + 2*0.22mm² wires inside) it's possible to carry both data and 12Vdc power supply. RS485 can work with up to 1km of cable, using the terminating 100-150 Ohm resistors on the ends of the bus : you can find the terminating resistor in each DomBus module, and it should be enabled through the PCB jumper in the two furthest modules.
DomBus modules are really low power consumption, less than 10mW with no outputs active, so it's possible to supply dozens of modules with no problem. Also, DomBus31 module that has 8 relays, consumes only 600mW when all relays are ON. We believe that power optimization is important: many wifi modules consumes more than 1Watt each, but 1W means more than 8 kWh/year for each WiFi module!
How to build the home automation system
- Choose a reliable power supply for the bus: we suggest to use a 13.5V power supply unit with lead-acid battery charge feature. Power supply should be strong enough to supply domotic bus, network switches and routers, IPCams and NVR, ... , so the whole system can work even in case of power outage.
- Choose a low power domotic controller: for small system you can use Rock PI S , which consumes only 0.4W, or Raspberry PI that is powerful (more ram, higher CPU speed) that consumes 2.3W. Kits with ready to use operating system and software are available from store.creasol.it
- Choose a reliable power supply for the domotic controller, if used: the best solution is a a DC/DC converter with Type-C or MicroUSB connector, supplied by the 13.5V power source, so the domotic controller is protected from blackout.
- Connect the domotic bus data to a RS485/USB adapter, and supply wires to the 13.5V power supply through a fuse. Use RS485 cables or, alternatively, common alarm shielded cables: 2x0.22mm² for data and 2x0.5mm² for Vbus supply. Connect the shield to GND only on one side.
- In any room where you have to measure temperature and humidity, place a DomBusTH module: it is very compact and can be mounted on a blank cover with a 3-4mm hole in the center. It also has red/green leds (that can be used for notifications, like alarm on/off, import/export power, ...), white led (that can be used for notifications and as blackout emergency light), 1x analog input to monitor Vbus, 4x I/Os (that can be connected to switches, pushbuttons, dual buttons, buzzer, energy/gas/water meters with pulsed output, alarm sensors, ...) and 2x open-drain outputs (that can be connected to the DomRelay2 module to get 2 relay outputs to command lights, roller shutter motors, appliances, ...).
- If you need to interface a gate or garage door, you can use DomBus23 module, that has 2x relay outputs (to send open/close/pedestrian commands), 2x low voltage optoisolated inputs (to be connected to photocell power supply or 12/24V light indicating the gate state), 1x 115/230V optoisolated input (to be connected to 230V flash lamp, if needed to get status from this output, or can be used to monitor power outages). Also, DomBus23 has 1x 12-24V 10A mosfet output (can be used to supply a 12/24V led stripe, with dimming function), 2x analog outputs 0-10V (can be used to regulate the heat pump power, valve, or other appliances with 0-10V input, as like as other led dimming modules), and 2x I/Os.
- If you need several inputs for alarm sensors (magnetic contact sensors and PIRs), you can use the compact DomBus12 module that has 7x I/Os (configured as digital inputs, analog inputs, twinbuttons, counters, buzzer outputs, ...) + 2x open-drain outputs (that can be connected to external DomRelay2 module to get 2 relay outputs, or can be configured as digital inputs through PCB jumpers to have totally 9 inputs).
- If you want to make a homemade alarm system and need more inputs and also some outputs, you can use DomBus37 module that has 12x low voltage inputs, 3 AC inputs (100-250Vac) and 3 relays outputs.
- If you need several relay outputs, you can use DomBus31 module that has 6x relays with 5A 250V SPST capability and 2x relays with 10A 250V SPDT capability (terminal block with both normally-open and normally-closed outputs). This is very low power consumption module, that consumes less than 500mW with all 8 relays ON!
- If you need more relays, we have DomBus36 module that has 12 relay outputs in 3 groups: 1 common + 4 relays for each group, to get easy and quick wiring!
- Use DomBusEVSE module to charge the electric car: you can select how much power to get from the grid, from 0% (use only photovoltaic power) to 100% (use all available power) preventing overloads and disconnections.
- Any energy, gas or water meter with pulsed output can be connected to DomBus12, DomBus23, DomBus32, DomBus34 and DomBusTH I/Os.
- Up to 4 Modbus energy meters type DDS238-2 ZN/S can be connected to DomBus34 module and DomBusEVSE module, to measure imported/exported power and energy, voltage, frequency and power factor.
- Use DomBus33 module to manage a light system that uses pushbutton switches that activate step-by-step relays: DomBus33 permits to know the status of the light and control the step-by-step relay coils to toggle, switch on and switch off lights, with the ability to have a button to switch all lights off (or a simple automation that switch off lights when alarm is activated in AWAY mode).
If you're renovating your house don't forget to:
- install magnetic contact sensors on windows, doors, blinds, external and internal sirens, external PIRs or RF radars: using Domoticz it's possible to build a complete alarm system with full notifications (text, pictures, small videos) in Telegram
- install at least one IP cam oriented to the main gate , so you can receive a picture in your smartphone (Telegram) when somebody push the door bell button,
- do not install thermostats to control room temperature: it's much better to install temperature sensors in each room (DomBusTH module) and let Domoticz controls the heater or heat pump : in this way it's possible to overheat (in Winter) or overcool (in Summer) the house when extra power is available from photovoltaic
For any questions please contact us by DomBus Telegram group https://t.me/DomBus , or by email to
What building automation controller?
DomBus modules are provided with two protocols of your choice:
- DomBus protocol, very powerful multimaster protocol that works only with Domoticz controller and permit to have DCMD functions, commands exchanged between modules that permit to get simple automations that works wihtout the need of the domotic controller, like KNX.
In this case you have to install the Creasol DomBus plugin, by using the Python Plugin Manager or downloading it from GitHub - Modbus RTU standard protocol that works with almost any home automation system, like Home Assistant, OpenHAB, Node-RED, ...
In this case you have to install the Modbus integration. More info at the https://www.creasol.it/HomeAssistant page
Some application notes
Let's start!
If you have a Creasol domotic kit, you already have a Single Board Computer (Raspberry, Rock PI, ...) used as domotic controller within the operating system, Domoticz and DomBus already installed and ready to be used, else you have to check documentation to install the operating system and Domoticz on your device.
Connect one DomBus module to the controller, by using a RS485/USB adapter: DomBus modules are usually supplied at 13.5V: in Domoticz, enter the Switches panel and find the last device, named for example dombus - [ff51.1] OUT1 . ff51 is the default address for this module: change module address to get all module ports visible!
To change the module address, click Edit and add to its Description field HWADDR=0x0001 for example, where 0x0001 is the address (in hex format) assigned to that module. Module address must be unique! Click on Save button, refresh the page and all ports for that module will be available. Configure port name and type by click on Edit button, modifying the Name and Description.
For example, to configure a port as digital input, write IN_DIGITAL in the Description field (replacing existing port configuration, like IN_TWINBUTTON or IN_ANALOG .....). Check the module documentation to know, for each port, the supported configurations.
Check the complete alarm system using Domoticz to know how to name PIR/Contact/Sirens devices if you'd like to use our free scripts to realize a complete burglar alarm system with notifications by Telegram, short video when alarm sensors activate, lights randomly ON during the night in away modes, ...
- Details
- Category: Domotics
Short checklist to make a charging station by yourself using Creasol DomBusEVSE module
Following the instructions below you can make an EV charging station that checks the mains power usage to prevent overload, disconnection and also to use only energy from photovoltaic. DomBusEVSE module, once programmed, can works by itself, in stand-alone mode, without the need of a domotic controller.
- Be sure to know what your're doing: you must have knowledge about power dissipation and electric systems. You must be an electric technician to make a wallbox by yourself!
- You also must have computer knowledge and know what is a home automation systems and Modbus protocol.
- DomBusEVSE module is the EVSE controller that permits to communicate with the On-Board Charger of your vehicle, for AC charging, single-phase and three-phase: choose the DomBusEVSE version for your need:
- with DomBus proprietary protocol, working with Domoticz,
- with Modbus standard protocol working with Home Assistant, Node-RED, OpenHAB, and many other home automation systems.
- Find below the diagrams for single-phase and three-phase wiring: you need at least a 2P or 4P RCCB (protection) and contactor, the EV cable, and RS485/USB adapter (or RS485/TCP). Components are available in our store, also available in KITs, but as they are standard they can be found everywhere.
- It's better to use 10mm² wires for 32A and 6mm² wires for 16A wallbox, to minimize power dissipation on cables. Connections must be checked periodically to be sure that, charging at max power, screws are tightened well so that the terminals do not heat up!
- If you have a home automation system with mains energy meter connected to the domotic controller, measuring the grid power (negative in case that power is exported to the grid), you don't need for another meter connected to the EVSE module: just make a simple automation to periodically send (every 1-6s) the current grid power to the EVSE module.
- A power/energy meter measuring the EV charging power/energy is not strictly needed, but recommended. DomBusEVSE supports DDS238-2 ZN/s (single phase) and DTS238-4 ZN/S (three-phase)
Single phase homemade wallbox EV charging station schematic
Three-phase homemade wallbox EV charging station schematic
- Details
- Category: Domotics
Using a water flow sensor with DomBus modules
Water flow sensors are useful to measure the cold and hot water consumption. Some water flux sensors are based on a hall sensor to measure the internal rotor spin, generating pulses up to 100-200 Hz.
Hall water flow sensors are not sensitive sensors, expecially if iron made like the one shown in the picture, so we suggest to choose meters with the best sensitivity, for example 1-30 l/min, using brass material: be careful that if flow rate is lower than 1 liter per minute, sensor will output 0 pulses!
DomBus modules are able to work with high speed sensors, generating up to 500 pulses/seconds, are optimized for very low power consumption and usually have many versatile ports that can be configured as inputs, outputs, counters, sensors, ...
The cheaper DomBus module that can be used with the flow meter is DomBus12, which is able to manage up to 9 GPIO (9 sensors, buttons, switches, ....)
The picture below shows how DomBus37 has been connected to some temperature sensors, alarm sensors, water flow sensor and power/energy meters.
Using the water flow meter, temperature sensors, energy meters with DomBus37 and Domoticz
When DomBus modules are used with Domoticz, (in this case, DomBus37 module programmed with DomBus protocol), you have to configure:
- NTC temperature sensors (10k at 25°C, B=3950) as IN_ANALOG,FUNCTION=3950;
- water flow meter is configured as IN_COUNTER,A=0.0025 (400 pulses per liter) with divider parameter=1000 to convert from litre to m³;
- power/energy meters (DDS238-2) as IN_COUNTER,TYPENAME=kWh,DIVIDER=2000
- Details
- Category: Domotics
This page shows how to make a new fresh image with Raspbian+Domoticz+firewall+backup. Raspbian + Domoticz, updated on 2022-06-10
If you prefer to purchase a high quality SD already programmed, visit our shop.
Writing an image for Raspberry
We're proposing a quick solution to install a pre-configured image of Raspbian for Raspberry PI3 or PI4, completed with latest Domoticz software and configured to preserve MicroSD flash device (flash cannot be safely written more than 10000 times) and exporting a weekly backup that can easily restored in case of problems.
This image was tested on both Raspberry PI3 and Raspberry PI4 hardware, and uses the last Raspbian Buster distribution.
Flashing this image in a microSD, you are immediately ready to configure your Domoticz devices from the web interface.
Image is available at http://dl.creasol.it/raspberry_domoticz_0x12345678.fsa and can be installed from linux or another raspberry using the raspberry_domoticz.sh script; Windows users can use putty to connect their raspberry by SSH protocol, and winscp or filezilla to transfer files between their windows PC and raspberry. Linux users can use their PC to make the copies.
Features
- Works with both Raspberry PI4 and Raspberry PI3
- Raspbian Buster + a recent version of Domoticz
- Optimized to reduce writing on flash: /tmp and /var/log are in ramfs, not SD, and swap is disabled. Domoticz temporary files are written in /tmp, not in SD, extending in this way the memory life
- Firewall with iptables/netfilter, that can be configured editing /usr/local/sbin/myfirewallpi.sh
- Backup that automatically create an incremental backup of files changed; one day per week do a full backup and one day per month do a image creation; backup can be easily exported to an attached USB hard disk or NAS (FTP or CIFS).
- Domoticz is partially configured with some devices and with Creasol Dombus plugin already installed (Domoticz plugin to use Creasol DomBus devices attached to the Raspberry by a RS485 serial bus).
Extracting the image to a microSD
Connect the microSD to a Linux computer or to Raspberry (using a USB memory reader).
Run the following commands to download the raspberry image from our website and extract it on the SD. Windows users can connect to their raspberry console using putty
[code]#become root
sudo su -
#download the image creation/restore script
apt update
apt -y install curl
curl -o /usr/local/sbin/raspberry_domoticz.sh http://dl.creasol.it/raspberry_domoticz.sh
chmod 700 /usr/local/sbin/raspberry_domoticz.sh
#donwload the image
cd /
curl -o /raspberry_domoticz_0x12345678.fsa http://dl.creasol.it/raspberry_domoticz_0x12345678.fsa
#and now start the raspberry_domoticz.sh script
raspberry_domoticz.sh
[/code]
then the raspberry_domoticz.sh script will guide you to write the image /raspberry_domoticz_0x12345678.fsa on a microSD connected to domoticz by a SD memory USB reader.
This is the output of raspberry_domoticz.sh script, in bold the text written by the user:
Would you like to create an image of the SD [SD => IMAGE] (Y/n/ctrl-c)
n (no, don't need to create an image, I need to extract an image!)
Would you like to write an image to new SD [IMAGE => SD] (Y/n/ctrl-c)
y (yes! extract an image to SD)
========== List of attached devices: ==========
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 1 1.9G 0 disk
`-sda1 8:1 1 1.9G 0 part
mmcblk0 179:0 0 58.3G 0 disk
|-mmcblk0p1 179:1 0 400M 0 part /boot
|-mmcblk0p2 179:2 0 4.9G 0 part /
`-mmcblk0p3 179:3 0 24.4G 0 part
Write the name of USB device where image have been placed (for example sda1)
mmcblk0p2 (write the name of device corresponding with root filesystem, where the image was downloaded, or the device containing the image, for example a usb drive)
========== List of files in the selected device ==========
total 508712
....
-rwxr-xr-x 1 root root 520823743 Feb 26 17:39 raspberry_domoticz_0x12345678.fsa
drwx------ 4 root root 4096 Feb 26 17:37 root
...
Write the image filename
raspberry_domoticz_0x12345678.fsa
========== List of attached devices: ==========
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 1 31.1G 0 disk
`-sda1 8:1 1 31.1G 0 part
mmcblk0 179:0 0 58.3G 0 disk
|-mmcblk0p1 179:1 0 400M 0 part /boot
|-mmcblk0p2 179:2 0 4.9G 0 part /mnt/img
`-mmcblk0p3 179:3 0 24.4G 0 part
Write the name of FLASH device to be written (example sdb)
sda (disk device connected to raspberry or PC, with the microSD card)
If you want to translate texts of raspberry_domoticz.sh in a different language, just modify the script adding the corresponding lines text[LANG,NUMBER] : it's very intuitive. Please send to
Access and configuring Raspberry with the programmed image
These are the default credentials for this image:
linux user: pi , password: arangingenni
linux user:root , password: geriandallse
domoticz user: domoticz , password: creasol
It's recommended to change these default passwords!!
Starting raspberry with this image, it will get network configuration from your DHCP server (router), so you can connect it by the browser at url like http://192.168.1.123:8080 (check your dhcp server to get the IP address assigned to raspberry, or do a network scan of your LAN). If you connect raspberry from 192.168.*.* or 172.16.*.* or 10.*.*.* networks, no authentication is required.
Also, ssh service is enabled, so you can enter secure shell (using ssh, putty or any other ssh client) as user pi or root.
How to create an image from Raspberry SD
We've written the bash script raspberry_domoticz.sh (see above) that permits to save a copy of Raspberry memory to a USB drive, and also create new SD with the content of a saved image.
This is useful because:
- flash memory cannot be written forever: normally each flash cell can be written up to 10000-100000 times. The proposed image is optimized to limit SD writes.
- it's always a good idea to have a backup of the running raspberry, so in case of problem it's possible to restore system from an old image
- maybe you need to clone an existing SD and keep images on your PC or NAS
Features:
- images are compressed... it's stupid to have a 16GB image for a 16GB almost-empty SD !!
- images can be restored on different SD sizes, so it's possible to use the same image to write SD card with 32GB size or 8 GB size as well
- creating and restoring an image is really fast, in comparison to other systems
Unfortunally, this system does not work in Windows, but... who are still using windows at these days? Everything is moving to Linux! Android is Linux. Rasbian is Linux. Your routers, access points, TV most probably use Linux operating system! ;-)
Click to download the raspberry_domoticz.sh script, save it to a executable directory on your linux system (e.g. /usr/local/sbin ) and give it the execute permissions.
Run raspberry_domoticz.sh and follow the instructions to create a compressed image from raspberry SD. It works also in live mode, directly from the working linux system, with a high probability of success.
Do you want more? Presentation of the highly reliable DomBus
Frequently Asked Questions FAQ
Some useful commands
ps ax |grep domoticz : lists all active processes showing only the ones with name domoticz
netstat -lnp |grep domoticz : shows the TCP/UDP ports used by domoticz (normally it uses the port 8080)
lsusb : lists devices connected to USB. lsusb -v shows details on USB devices
How to configure raspberry GPIOs
With this raspbian image, GPIOs can be configured editing /etc/rc.local file and setting the needed gpio as out (if output), in if input, or both if bidirectional.
[code]#/etc/rc.local file
#setting gpio using wiringpi tool:
#syntax: gpio export GPIONUMBER out|in|both to set as output, input or I/O
gpio export 24 out # Set as output.
gpio export 23 out
gpio export 22 out
gpio export 27 out
gpio export 18 out
gpio export 17 out
gpio export 25 out #lightOut2
gpio export 8 out #lightOut3
gpio export 7 out #lightOut4
gpio export 12 out #lightOut1[/code]
After edited, type /etc/rc.local to reload the script.
How to update the Creasol DomBus plugin to the latest version?
Just type, from root shell, the command creasoldombus_update.sh
How to configure a static IP for the Raspbian ethernet interface?
Edit the file /etc/dhcpcd.conf ( nano /etc/dhcpcd.conf ) and add the following lines at the end:
interface eth0
static ip_address=192.168.1.250/24
static routers=192.168.1.1
static domain_name_servers=192.168.1.1 8.8.8.8
and save with ctrl-x.
The raspberry cannot be connected by ssh (22 port) or http (8080 port)
Assure that LAN cable is connected to raspberry, and that a DHCP server can assign IP parameters to it.
There's a firewall script installed, /usr/local/sbin/myfirewallpi.sh , that needs that eth0 interface is already configured by DHCP or static IP.
How much does Raspberry PI4 consumes?
As home automation systems were borned to reduce building environmental footprint, it's important to know if a Raspberry is a good hardware for a domotic controller or not, in terms of CPU power, stability, and also energy consumption.
Searching in the www it's possible to find only few articles describing the power consumption of a Raspberry PI, so the best way is to measure the power consumption in practice.
This is the hardware under test, a Raspberry PI4 with 1 GB of ram, connected to LAN and supplied by a DC power supply at 5V
Below, the value of current and voltage with Raspbian O/S measured when
1. at the left, with no any load (very low CPU usage), raspberry power consumption = 5V*0.42A=2.1W normal
2. at the right, with 100% load on the 4 cores, raspberry power consumption = 5V*0.63A=3.15W peak
Firewall configuration
How to enable the IP number that you want to access your raspberry/domoticz from outside?
Edit the firewall script with command nano /usr/local/sbin/myfirewallpi.sh and modify the ADMIN_SOURCE variable adding the IP addresses (or networks) you want to enable:
ADMIN_SOURCE='80.86.145.56/29 149.13.157.0/24 37.0.0.0/8'
where /24 means that the last number in IP address can be any from 0 to 255, and /8 means that only the first number is checked while the remaing 3 numbers can be any from 0 to 255.
Save file with CTRL-s and CTRL-x , then run the script typing /usr/local/sbin/myfirewallpi.sh
How to enable incoming connections to the web server in Raspberry?
Modify the firewall script with command nano /usr/local/sbin/myfirewallpi.sh , and add port 80 (http) or 443 (https) to the variable TCP_SERVICES_IN_wan
then save script (CTRL-s and CTRL-x) and run the firewall script with command /usr/local/sbin/myfirewallpi.sh
- Details
- Category: Domotics
Introduction
NodeMCU v3 is a very useful and powerful controller based on ESP8266 microcontroller with 2.4GHz WiFi, GPIO ports, analog input, I2C bus, UART and 1wire ports, equipped with a dual-in-line strip male connector.
It's a very cheap open-source platform, a bit expensive in terms of current consumption (normally 80mA @5V = 400mW), but very appreciated in home automations and Internet of Things.
Using the ESPEasy firmware, it's possible to combine this card with Domoticz/raspberry home automation controller.
Creasol has designed the DomESP1 board that permits to easily supply the NodeMCU board by a switching mode regulator, and connect inputs, outputs, I2C and 1wire sensors/devices (e.g. DS18B20 thermal and other humidity sensors) by terminal blocks. The board, as shown in the picture, has 4 relay outputs with 5A 250V switching capaibility, and all circuitry to manage I2C bus, 1wire bus, ....
A LED on every input and output permits to check the status of the board and found any problem on wire connections or firmware configuration: LEDs are enabled by pressing the button Test .
The LEDs enable feature and the switching mode power supply lead to a full control of inputs/outputs with an optimized power consumption.
It's possible to purchase:
- the plain DomESP1 board: the client should purchase and program by himself the ESP8266 module, 900 mil header pitch;
- the DomESP1 board, with the ESP8266 module already programmed with the latest ESPEasy firmware.
Installing firmware on NodeMCU board and first configuration
- On Linux, install esptool: for Debian/Ubuntu/similar, run the command
apt update; apt install esptool - Download ESPEasy version 2.0.0 from https://www.letscontrolit.com/wiki/index.php/ESPEasy#Loading_firmware or clicking on https://github.com/letscontrolit/ESPEasy/releases selecting the last version available, and uncompress the zip archive: inside the bin directory you can find several images, read the README.txt to find out which image is for you. For LoLin modules with 4M of ram, a good image is bin/ESP_Easy_mega-20190813_test_core_242_ESP8266_4M.bin
- Connect the NodeMCU board to the PC using a microUSB cable
- Run the command to load the firmware:
on Linux you should install esptool and execute, from the shell,
/usr/bin/esptool --baud 115200 --port /dev/ttyUSB0 write_flash 0 ESPEasy_R120_4096.bin
on Windows or Mac, please read the instructions within the ESPEasy package
You should see on the console the following result:
esptool.py v2.5.0
Serial port /dev/ttyUSB0
Connecting....
Detecting chip type... ESP8266
Chip is ESP8266EX
Features: WiFi
MAC: b4:e6:2d:36:e7:d1
Enabling default SPI flash mode...
Configuring flash size...
Auto-detected Flash size: 4MB
Erasing flash...
Took 1.30s to erase flash block
Wrote 411648 bytes at 0x00000000 in 39.8 seconds (82.7 kbit/s)...Leaving...
Hard resetting via RTS pin... - Enable WiFi on a smartphone or PC, and connect to the SSID ESP_0 using the password configesp
- Set the SSID of the WiFi network where the device will be connected, and associated WiFi password, then click on Connect button.
- At this point, the device will be associated to the selected WiFi network with the given SSID an password.
- Scan the network to find the IP address of the device, and connect to it using a browser: http://DEVICE_IP_ADDRESS
- Configure the main parameters:
- Set the GPIO default configuration:
- Configure devices (e.g. temperature sensors):
- If the two blue LEDs on the NodeMCU board are annoying you, you can remove them, of course: in this case you avoid extra power consumption for useless LEDs.
- Details
- Category: Domotics
Introduction
We have written a plugin for Domoticz that communicates with Kia and Hyundai clouds getting information from the car, and also letting user to set some car parameters (electric charge limites AC and DC, climate temperature, start/stop climate, start/stop charging, ....)
Installation instructions and more information at https://www.domoticz.com/wiki/Vehicles_Hyundai_Kia
Do you want to make your own SMART WALLBOX ?
Follow the instructions at https://www.creasol.it/EVSE to build a Smart Charging Station by yourself to charge your car, van or other electric vehicle!!
Charging the electric car using a DomBusEVSE module
This is an advanced solution that uses the EVSE (Electric Vehicle Supply Equipment) module DomBusEVSE made by Creasol, in Italy: it
- detects plug connection and disconnection, start and stop charging
- detects alarms from vehicle and failure in mains power supply
- interfaces a bidirectional energy meter to know the real time import or export power from grid, and another energy meter to measure the power and energy feed to the vehicle
- operates as stand-alone (no need for a domotic controller) or managed mode (charging current selected by the domotic controller) with the following charging mode: OFF: charging disabled SOLAR: use only energy from renewable plant (power from grid = 0) 25%: max 25% of available power from grid 50%: max 50% of power from grid 75%: max 75% of power from grid 100%: use all available pwoer from grid MANAGED: current value set by domotic controller (automation script for custom charging)
- operating in the a MANAGED mode it's possible to 1. easily set the minimum and maximum battery level 2. easily set the maximum charging current 3. when battery level is below minimum, charge at the max power permitted by the electricity meter (in Italy, alternates 90 minutes at maximum power + 27% and 90 minutes at maximum power + 10%, it's not possible to charge faster! The electrical system must be checked carefully when using maximum power, to avoid overheating and fires!!) 4. when battery level is between minimum and maximum, charge using only power from renewable energy from photovoltaic
Video showing electric vehicle charging by Domoticz
Prerequisites and connection diagram
- electric vehicle with cloud connection, to know the battery state of charge (not mandatory, but recommended when used inside a home automation system)
- Creasol DomBusEVSE module
- bidirectional energy meter, to compute the current import power and export power (optional, in case of photovoltaic/wind system)
- circuit breaker with differential protection (residual current block) type-B
- 2P (single phase) or 4P (3-phases) contactor to enable/disable charging
- 32A EV cable with type-2 or type-1 plug on one side
Click to see the connection diagram to make a smart electric car charger using DomBusEVSE module!
Warnings
Electric car is not a vacuum cleaner, that stay attached to the mains socket for 30 minutes!
Keep in mind that power dissipation on connectors (and cables) is computed as P=RI² where R is the connector/wire resistance, and I² is the square of charging current.
As result, when the charge current is high, the system must be checked to prevent connections and wires from overheating and burning.
- Details
- Category: Domotics
Everybody using an electric vehicle wants to charge the car in a smart way:
- preventing overloads
- using only energy from photovoltaic, in Spring and Summer
- maximizing power factor to get the highest charge efficiency
- controlling and monigoring charging by smartphone/tablet/PC
- integrating the wallbox in the home automation system, to get an efficient load balancing and accumulating energy in the car when energy price is lower.
DomBusEVSE is a charging module available with 2 protocols:
- DomBus protocol (proprietary) for Domoticz
- Modbus protocol (standard) for Home Assistant, Node-RED, OpenHAB, ....
It also works as stand-alone, in case that domotic controller is off-line.
Hardware requirements to make a DIY EV charging station
Making a home-made charging station is quite simple, but needs to know about electric systems and power: charging sessions are usually long and care must be taken to avoid overheating on connections and cables.
EVSE module is quite simple: it measure the power drained from the electrical grid, sends to the car a PWM signal to set the maximum charging power/current through the Control Pilot wire and read the vehicle status through the same wire.
The following items are needed to make a home-made charging station (with links with our store, but as standard devices they may be purchased anywhere):
- DomBusEVSE, that is the charging controller
- Protections: type-B RCCB is recommended
- Contactor, to enable mains power supply (2P for single-phase or 4P for three-phases) and EV cable
- Power meter to measure the EV power, energy, voltage, power factor
- Bidirectional power meter to be placed in the main switchbox to measure the energy exchanged with the Grid, if a power meter is not already available in the home automation system.
More info to make the wallbox are available in the DomBusEVSE page.
DomBusEVSE firmware details
More info about how the EVSE module works are available in the DomBusEVSE page.
Integrating DomBusEVSE in Home Assistant
Install the Modbus integration .
Fetch the configuration files from the github page dedicated to DomBusEVSE and Home Assistant and put them into the HA config directory. You can see configuration files for different modules, so you have to enable what you need and disable the rest.
If you know English, please check this page in English language because other languages will be confused by the unnwanted translation of some parameters name.
Keep note that:
- this EVSE can be configured in "Managed mode" (an automation can periodically set the charging current value, from 6 to MAXCURRENT): in this way the EVSE become stupid and let the external automation to manage charging and balancing through different EVSE connected to the same electrical system.
- normally EVSE is not configured in "Managed mode", but can be configured in Off (don't charge), Solar (Grid power = 0), 25% (use Grid power = 25% of MAXPOWER), 50% (use 50% of MAXPOWER), 75% and 100% (use MAXPOWER from grid). To work correctly, you have to:
- connect a supported power meter (DDS238-2 ZN/S for single-phase, DTS238-4 ZN/S or DTS238-7 ZN/S for three-phase) programmed with slave-address=3 and connected to the additional Modbus port of the EVSE
- if you already have a power/energy meter connected to the domotic system, use a simple automation to write the current power (in Watt) drained from grid (negative if sourced to the grid) to the Grid Power entity. Example is available in the file dombus/dombusevse/dombusevse_automations.yaml The grid power should be written every 2-6s during charging session.
For additional support, enter the DomBus telegram group.
Single-phase homemade wallbox
Three-phase home-made smart wallbox
More info at https://www.creasol.it/EVSE
- Details
- Category: Domotics
We'd like to describe some solutions to measure the energy consumed and produced by the building using Domoticz home automation system and energy meters like DDS238 and SDM120, SDM230 (single phase), SDM630 (threephase).
Having information about the used/produced power is useful to correctly manage loads (or heating/cooling system, electric vehicle charging, ....) in the right way, maximizing the own-produced energy from photovoltaic plant.
Solution 1: interfacing any energy meter with pulsed output using a DomBus module
This solution works with any kind of energy meter with pulsed output.
Normally, energy meters have 1 or 2 pulsed opto-insulated outputs to send 1000, 1666 or 2000 pulsed every kWh imported and exported.
If DomBus modules are used in the home automation system, it's easy to configure one or two input ports as IN_COUNTER to measure the imported/exported power and energy.
The following schema shows a system using DomBus module, but what it's interested in this case is that it shows a Eastron SDM230 energy meter, with 2 pulsed outputs connected to the I/O ports IO8 and IO9 of module DomBus12 (but DomBus23, DomBus33 and DomBusTH can be used as well). This is a reliable solution: if Domoticz controller is stopped, DomBus module continues counting pulses up to 64k (equivalent to 32-64kWh) and when Domoticz resumes, the energy counter is restored correctly without loosing pulses.
Using DomBus12, DomBus23, DomBusTH, DomBus32 or DomBus37 it's very easy to read the pulses from energy meters, compute the instant power and get two devices in Domoticz that show the usage and return power, usage and return total energy and graphs. Below the instructions that refer to Eastron SDM230 energy meter: similar procedure for any other energy meter with pulse outputs, like DDS238 energy meter.
- connect the pulse outputs to any available I/O, for example IO8 and IO9 for DomBus12, IO1 and IO2 for DomBusTH or DomBus23 or DomBus32 or DomBus37. The SDM230 common terminal block should be connected to GND (0V). Other energy meters may have output S0+ that should be connected to the DomBus I/O and S0- to GND.
- configure Pulse1 output, on SDM230, as EXP kWh (check the manual to know how to do that); Pulse2 is pre-configured as IMP kWh (measure the energy imported from grid)
- configure the Domoticz device connected to Pulse2: press Edit on that device, and replace in the Description field IN_DIGITAL or IN_TWINBUTTON (the default value) with IN_COUNTER,TYPENAME=kWh and save. Please note that kWh is CASE SENSITIVE!
Now the device will be automatically moved to the Utility panel and configured as energy meter. Edit it again, write a name (for example PowerMeter_Import), and select Usage type. - if produced energy should be measured, configure the Domoticz device connected to Pulse1 as before: press Edit on that device, and replace in the Description field IN_DIGITAL or IN_TWINBUTTON with IN_COUNTER,TYPENAME=kWh,DIVIDER=2000 (where divider number correspond to the pulses/kWh of your meter) and save.
Now the device will be automatically moved to the Utility panel and configured as energy meter. Edit it again, write a name (for example PowerMeter_Export), and select Return type. - In case of both import and export devices are created, it's needed to specify on Import device the Unit number of the Export device, and vice versa. So, select Setup -> Devices and write down the Unit number corresponding to Import (for example 98), and Export device (for example 99), then go to Utility panel, edit Import device and add to the description ,OPPOSITE=99 (Unit of the Export device) and save; edit Export device and add to the description ,OPPOSITE=98 (Unit of the Import device) and save. In this way, when a pulse is received on Import device, the power on Export device will be immediately set to 0, and vice versa, when a pulse is received on Export device, the power on Import device will be set to 0.
Domoticz needs up to 5 minutes before updating the energy counter correctly.
Check the youtube video that shows the instant power shown on the web browser (Domoticz panel) every 2 seconds.
Solution 2 - Using DDS238-2 ZN/S (single phase) or DTS238-7 ZN/S (three phases) Modbus energy meters with DomBus modules
It's possible to connect up to 4 DDS238-2 ZN/S energy meters to a single DomBusEVSE module. DDS238-2 ZN/S have 2 terminal blocks with A and B signals (RS485 Modbus), so it's possible to connect together up to 4 energy meters to the A/B terminal block of DomBusEVSE module: in this way it's possible to measure, for each meter, import/export power, energy, voltage, frequency and power factor.
Values are updated every 5 seconds.
DomBusEVSE is a module designed to control an electric vehicle charging (Mode-3 EV charging station / wallbox). It supports up to 4 energy meters, single and three phases, providing imported energy and power, exported energy and power, active power (negative if power is fed to the grid), voltage, frequency and power factor.
DomBus34 is a module. It supports up to 4 energy meters, single and three phases, providing imported energy and power, exported energy and power, active power (negative if power is fed to the grid), voltage, frequency and power factor.
TODO: connection schema
Solution 3 - Using ESP8266 module (NodeMCU, Wemos, ...) with Eastron energy meters with ModBus RS485 interface
The energy meter is connected between the first circuit breaker and the circuit breakers used for each zone: in this way it measure the used/produced power globally.
Please choose the energy meter model that integrates the RS485/Modbus interface, so it's possible to connect to ESP8266 board through a RS485 to TLL converter so ESPEasy can read power (positive if used, negative if produced), voltage and other variables.
Lua scripts
Some LUA scripts for Domoticz are available, to manage the house power: in the Winter, they activates electric heaters automatically when exported power (from photovoltaic plant on the roof?) is greater than electric heater power. Similarly, any kind of device can be configured (e.g. dehymidifiers / dryers).
It also send an alert when power usage is above the max available power, to prevent disconnections from the electric grid (overcurrent protection).
Scripts are available in github, https://github.com/CreasolTech/domoticz_lua_scripts
- Details
- Category: Domotics
The tee-inverter WVC-2000 family (WVC-1600, WVC-2400, WVC-2800) is very nice and low price, available in two version: with sub-1GHz transceiver (needs a DTU to manage that protocol and convert to WiFi) and WiFi, connecting to the "Cloud Intelligence" sensor network.
Anyway, we strongly suggest to skip this product because:
- it's not safe: disconnecting it from the grid (power outage or turning OFF the RCBO), the produced voltage jump to 285V then falls, in 30 seconds, down to 248V and remains at 248V until Sunset! This is not safe, the inverter must check for 230V and stop producing in case of power outage to avoid electric shocks.
- very low efficiency inverter: as the inverter sends DC power and AC power telemetries to the Cloud Intelligence, it's easier to compute AC power by DC power ratio, and it's lower than 0.92 (8% loss). Infact, with only 600W output power and 30°C enviroment temperature, the inverter temperature goes to 58°C and this is not good
- very poor MPPT algorithm: comparing the AC power produced by 830Wp panels using this inverter, and another photovoltaic system using SolarEdge inverter, the overall efficiency of this inverter is 0.815 respect to the SolarEdge one.
- high leakage current: it's mandatory to connect the inverter chassis to the Protection Earth due to the leakage current produced, most probably, by the high capacitors connected to the ground in the EMI filter.
- Details
- Category: Domotics
The following application note shows how to measure the level of rainwater (or other liquid) inside a tank, using a waterproof ultrasonic distance sensor JSN-SR04T.
This solution works perfectly with Domoticz home automation system, a complete, free and open source software for domotic applications, using DomBus modules programmed with DomBus firmware.
Also, using the DomBus modules with Modbus firmware, works also with Home Assistant, Node_RED, OpenHAB and other domotic systems supporting the standard Modbus protocol.
The following graph displays the measured level of rainwater inside a tank: level decreases when water is used (during garden irrigation, for example) and increases during rains; below the connection diagrams of the ultrasonic distance sensor to the DomBus1 module, a domotic module that includes 6 inputs, 1 230Vac input and 3 relay outputs, and the configuration of the domoticz device using the linear equation displayed_value=A*sensor_value+B so when the distance sensor measures 0mm (rainwater full), the distance from the tank bottom is 165cm. Parameter "A" is used to convert from mm to cm, and parameter "B" to get the tank level instead of distance from sensor to water level.
The following DomBus modules support the ultrasonic distance sensor:
- DomBus12, with DomBus or Modbus firmware: 9 I/Os module, supporting up to 6 distance sensors + 1 trigger output (IO7) common controlling all sensors
- DomBusTH, with DomBus or Modbus firmware: 6 I/Os module with RGB leds, touch sensor and temperature/humidity sensors, supporting up to 5 distance sensors + 1 trigger output (IO4) controlling all sensors
Documentation for JSN-SR04T waterproof distance sensor
Click to get the JSN-SR04T distance sensor datasheet
Operating voltage | 5 V (it works at 3.3V too) |
Operating current | 30 mA |
Quiescent current | 4-5 mA |
Frequency | 40 kHz |
Measuring range | 25-450 cm |
Resolution | 2 mm |
Measuring angle | 30 degrees |
Sensor dimensions | 23.5 x 20 mm with 2.5 m long cable |
PCB dimensions | 41 x 28.5 mm (to be protected by humidity!) |
Using DomBusTH module to control up to 5 distance sensors
- Connect the 5V power supply and GND to the distance sensor boards (they works also with 3.3V).
- Connect IO1, IO2, IO3, IO5 or IO6 to the "echo" sensor output. In case of IO5 (that is factory configured to works as open-drain output), to use it as input port connected to the "echo" output, you have to open R05 (with a cutter) and short the RO5 (with a solder iron) PCB jumpers. The same for IO6.
- Connect IO4 to the "trigger" sensor input. Also, short the "O4" pcb jumper to use this I/O port as output.
- Configure (by software) IO4 (trigger) and IOx (echo) as DISTANCE (normally these ports are factory configured as digital inputs or outputs). Using Domoticz, just write in the description field of the sensor devices (both trigger and echo ports) the string ",DISTANCE" to set the port as distance sensor. In case of Modbus, program the address 255+portnumber to the value 13, corresponding to the DISTANCE sensor type.
The module returns the distance in millimiters, and is updated every 15s.
Using DomBus12 module to control up to 6 distance sensors
- Connect the 5V power supply and GND to the distance sensor boards (they works also with 3.3V).
- Connect IO1, IO2, IO3, IO4, IO5 or IO6 to the "echo" sensor output. In case of IO5 (that is factory configured to works as open-drain output), to use it as input port connected to the "echo" output, you have to open R05 (with a cutter) and short the RO5 (with a solder iron) PCB jumpers. The same for IO6.
- Connect IO7 to the "trigger" sensor input. Also, short the "RO7" pcb jumper to use this I/O as output.
- Configure (by software) IO7 (trigger) and IOx (echo) as DISTANCE (normally these ports are factory configured as digital inputs or outputs). Using Domoticz, just write in the description field of the sensor devices (both trigger and echo ports) the string ",DISTANCE" to set the port as distance sensor. In case of Modbus, program the address 255+portnumber to the value 13, corresponding to the DISTANCE sensor type.
The module returns the distance in mm, and is updated every 15s.
- Details
- Category: Domotics
In this page some information about photovoltaic systems and renewable energy
Something about solar photovoltaic systems
To charge the eVehicle, and most important to supply the heat pump in the winter, you should have solar photovoltaic system, but where? On the roof or on the garden? What inclination and orientation for the panels?
In the summer there are no problems at all... the day is long and we always have an over-production. But in the autumn and winter?
The following tables and graphs show a simulation of a 2.7kWp photovoltaic system in 5 configurations and 2 dates (Autumn and Winter), for the Northern Italy, using data from the very useful European website https://ec.europa.eu/jrc/en/pvgis
Simulation using data from 20 September 2016
The following table shows the simulation for the begin of Autumn:
The first column shows the time of the day (GMT+1, not DayLight Saving time!), then second column a simulation for the panels on the roof, oriented to EAST with inclination of only 15 degrees from the horizontal line - blue track.
The third column shows the simulation for panels oriented to south direction, 15 degrees inclination - red track.
The forth column shows the simulation for panels oriented to south direction, vertically (90 degrees) - yellow track.
The fifth column shows the simulation of panels in south direction and 70 degrees inclination - green track.
Finally, the sixth column show the performance of a simple solar tracker with vertical axis that can rotate from east toward south and west, with panel inclination 70 degrees - orange track.
It's possible to see that best performances can be achived using a solar tracker... since from Sunrise, the tracking system lead to a very high power that permits to start heat pump without using power from the grid.
Simulation using data from 1 January 2016
In this case, the solar tracking system does not help to improve the power, because the Sun in the Winter rise from south-east and fall to south-west.
Fotovoltaico in Italia, Scambio Sul Posto, remunerazione
Lo Scambio Sul Posto (SSP) è un meccanismo attraverso cui il Gestore dei Sistemi Energetici (GSE) remunera l'energia esportata in rete dai cittadini dotati di impianto solare fotovoltaico.
Spesso si sente dire che "è meglio consumare tutta l'energia prodotta", oppure "accumularla in batterie, perché il GSE non paga nulla". Ma è davvero così?
Se un impianto è dimensionato bene, è maggiore l'energia autoconsumata dell'energia esportata: in tal caso l'energia esportata viene pagata dal GSE in questo modo:
- suddivisione della produzione nelle fasce orarie F1, F2, F3
- per ciascuna fascia, viene moltiplicata l'energia mensile esportata in tale fascia per il Prezzo Unico Nazionale (PUN) medio mensile relativo a tale fascia oraria moltiplicata aumentata del 5% circa
Quindi, il GSE rimborsa, con lo Scambio Sul Posto: ( Export_F1 * PUN_F1 * 1.05 ) + ( Export_F2 * PUN_F2 * 1.05 ) + ( Export_F3 * PUN_F3 * 1.05 ).
Nell'area cliente del portale GSE è possibile vedere i calcoli eseguiti dal GSE sull'energia esportata e autoconsumata. Ad esempio a dicembre 2021 il PUN_F1 era di 0.32€/kWh, probabilmente ben al di sopra del prezzo di acquisto dell'energia elettrica (0.16€/kWh incluse tasse e contributi vari).
Normalmente, chi ha un impianto fotovoltaico esporta di giorno (quando il PUN + alto) e consuma di notte (quando il PUN è inferiore): il risultato è che conviene esportare l'energia anziché accumularla!
Dal punto di vista della remunerazione non cambia molto, tuttavia è preferibile cercar di esportare energia nelle fasce orarie in cui c'e' maggior richiesta: per questo vale la pena consultare, periodicamente, il Gestore Mercati Elettrici https://www.mercatoelettrico.org/it/
Nell'immagine si vede l'andamento del PUN, ora per ora, per l'8 settembre 2022: il PUN medio giornaliero risulta di 0.50€/kWh (500€/MWh) con punta di 0.70€/kWh alle 9 e 0.55€/kWh alle 20.
Il risultato che si evince è che l'accumulatore, per uso residenziale, ha senso SOLO per chi ha usufruito del Superbonus 110% (lo Stato ha finanziato tutto l'impianto, quindi non è giustamente prevista la remunerazione dell'energia esportata), a chi ha una potenza contrattuale troppo bassa per far funzionare gli elettrodomestici di casa (in tal caso l'accumulatore previene il distacco per superamento della potenza massima contrattuale) e a chi è disponibile a spendere per avere energia anche in caso di blackout. Negli altri casi è un costo che non sarà mai ripagato, tantopiù che il processo di ricarica della batteria e di conversione in alternata non hanno efficienza 100%, ma avviene sempre con perdita di energia.
Import / Export power and energy monitoring
Monitoring can be done by using the free and high-reliable home automation system controller Domoticz , one energy meter with pulsed output (like Eastron SDM-230) and a DomBus module (like DomBus12, DomBus23 or DomBusTH).
ToDo: schema
Domoticz collects data permitting to display charts comparing exported/imported energy month-by-month across several years.
The following chart shows the produced energy using a photovoltaic system, 7.2kWp on the roof, east and west orientation, in the last 3 years.
The following charts show the imported energy:
The following charts show the exported energy (energy sourced to the electric grid):
Comparison of photoltaic system: panels oriented to East and West, and panels oriented to South
The following graphs refers two different solar systems, mounted on roof in the North of Italy:
1) 2.7kWp oriented to East + 4.5kWp oriented to West (totally 7.2kWp)
2) 6kWp oriented to South
From the graphs it's clear
- in the Summer daily production is the same (44kWp for the first solution with 7.2kWp, 37kWp for the second with 6kWp)
- in the Winter, daily production of the second solution (panels oriented to South) performs more than double of the first solution (panels oriented to East and West).
Electric vehicles
Interested on electric vehicles? We have a page about electric cars with several FAQ, in Italian language.
Want to charge the electric car using our domotic module? Check https://www.creasol.it/EVSE
- Details
- Category: Domotics
In our store we have several kits already equipped with software to start your home automation system using Domoticz software, a free open-source software written in C++, fast and reliable.
Software update is always a problem with Home Assistant? Try Domoticz, and you'll start loving the Domoticz beta version with auto-upgrade feature, and its stability!
Yes, Home Assistant looks very nice and have tons of integration, but is sometimes complicated to get rid of continuous upgrades with integrations that stop working: if you want a domotic system managing hundreds of devices in a Raspberry PI or even in a Rock PI hardware, Domoticz is much better, because it's fast, low memory usage and reliable.
Our kits uses Linux operating system, because Windows is 100% unsuitable for stable home automation systems that are able to manage lights, heat pump, alarm sensors, energy monitoring and load balancing to optimize own consumption when using photovoltaic on the roof. They have a web UI that is sufficient to manage almost everything: you can access to the Domoticz UI by Smartphone using a browser, app and HTTP shortcuts icons to activate single devices or scenes.
Click to list of all kits available in our store!
- Rock Pi S mini kit: small form factor computer with metal case, high endurance MicroSD with Domoticz already installed and equipped with DomBus plugin.
- Rock PI S kit with DomBus23 module to get 1 led stripe dimmer, 2 relay outputs, 1 230Vac input, 2 12/24V inputs, 2 I/Os and 2 analog outputs 0-10V: it can be used to regulate a 12/24V led strip, open a gate or garage door with smartphone, control lights or other loads, ....
- Rock PI S kit with some parts to make a Smart single-phase wallbox: same as before, adding 1 DomBusEVSE (control EVSE module to make a wallbox), 1 contactor 40A, 2 energy meters, 1 12V power supply + 1 power supply 5V to supply Rock PI S.
- Rock PI S kit with DomBus34 and 1 energy meter to keep account of power and energy consumed by the house with nice charts, activating loads (heaters, dehumidifers, ...) when power from electricity grid goes negative (solar photovoltaic is producing) and monitoring of 230V mains to critical appliances (fridges, heat pump, ...).
- and much more.
Support is available through the Telegram channel DomBus (English language) and DomBus_it (Italian language)
How to use custom icons with Domoticz?
To get a better user interface and floorplan with proper icons, it's possible to check the web page https://www.domoticz.com/wiki/Custom_icons_for_webinterface where are listed two Domoticz icons galleries.
- Details
- Category: Domotics
We produce some reliable and optimized modules that can be used with Domoticz, Home Assistant, OpenHAB, Node-RED and any home automation system controller supporting Modbus protocol.
Our modules can be connected to the domotic controller by RS485 bus: with a cheap and thin 4-wire shielded cable (2x0.50 + 2x0.22mm², commonly used for alarm systems), it's possible to carry both data and power (12 or 24V) to all modules. Using a 12Vdc power supply with backup battery, your domotic system will work even in case of power outage!
DomBus modules, with DomBus protocol, are plug&play: just connect it to the bus and Domoticz will find it, adding only a single module port. Select that device, change address (by writing the new address in Domoticz switch description), then you'll find all module ports in Domoticz.
Each port can be easily configured (as input or output, analog or digital, buzzer/counter/pushbutton, ...) by clicking Edit on the Domoticz switch and writing the configuration on the Description field.
Also, DomBus modules support the possibility to send commands (DCMD) to other DomBus modules (or to itself) when an event occur, to activate one or more outputs automatically, without the need to have a command from Domoticz. In many cases, it's easier to configure DCMD commands instead of programming Domoticz by scripts or blocky! Also, this feature works even when Domoticz is OFF, with a very low latency.
DomBus37 - 12 inputs, 3 AC inputs, 3 SPST relay outputs
Module developed for alarm system, to control one or more sirens, check for 230V voltage detecting power outages, and 12 inputs to interface pushbuttons, alarm sensors, ...
DomBus36: 12 relays module
Din rail module with relays grouped in 3 blocks with a single common (line, neutral, GND, V+, ...) to simplify wiring. Very very low power consumption: only 750mW with ALL 12 relays ON!
DomBus33 - Module with 3 relays, 3 AC inputs, 5 I/Os/DomBus33
Module developed to control 3 existing lights using 230V pushbuttons and step-by-step relay. It permits to control those lights also by the domotic controller (smartphone, tablet, ...) and create automations to turn OFF all lights when exiting the house, for example, or turn ON lights after sunset and turn OFF before sunrise.
DomBus31 - Module with 8 relays, 6 NO relays 250V 5A + 2 NO/NC relays 250V 10A
This module includes 6 relays with 250V 5A capability, and 2 relays with 250V 10A capability. The module consumes less than 10mW in stand-by and less than 500mW with all relays ON!
Please note that some products in the market consumes more than 2W with only 4 relays ON, or even 12W with 8 relays ON!!
It can be mounted on a din rail, as well as in wall boxes.
DomBus23 - Module with 2 relays 250V 5A, with many other functions
This is a very powerful module with many functions. Behind the 2 relay outputs, it includes a 250V optoisolated input, 2x 12/24V optoisolated inputs, 2x IOs, 2 analog outputs 0-10V, optionally 2 open-drain outputs (that can be connected to external relay or DomRelay2 module, shown on the right: in this case you can get totally 4 relays!), and 1 Led stripe dimmer output (with mosfet already included).
Power consumption: less than 10mW in stand-by. Dimmer capability: 12A 30V.
The following application notes shows how DomBus23 can be used to control up to 3 led stripes (1 led strip controlled directly, using the internal high power mosfet, and 2 external led controller by its 0-10V outputs), and how to interface a gate opener or garage door opener.
DomBus12 - 9 I/O compact module within 2 open-drain outputs that can be used to drive 2 external relays
This is a very compact module designed to interface low voltage inputs, for example magnetic contact sensors, PIRs, pushbuttons, ...
It includes 2 open-drain outputs suitable to control external relays. In the right side, the DomRelay2 module that has just 2 relays (12V coil, 250V 5A switching capability) that can be controlled by open-drain or open-collector outputs.
I/Os can be configured in many different ways, including digital and analog input, "twinbutton" mode (controls 2 pushbuttons with a single I/O), buzzer, counter (can be connected to a energy meter to get the imported and exported power/energy, or gas meter, water meter, ...).
DomBusTH - Temperature + humidity sensor, red/green/white leds, 4 inputs and 2 open-drain outputs
This board is designed to be applied to a blank cover with a 3-4mm hole in the center: it can be used to
- measure room temperature and relative humidity
- send notifications by red and green leds
- emergency light, by white led (in case of blackout)
- interface up to 4 pushbuttons or 4 double buttons (totally 8 buttons)
- control a piezo buzzer
- control external relays (even using the DomRelay2 board).
The following application note shows how it's possible to use this module in a bedroom, to control for example a roller shutter motor, a up/down pushbutton, a pushbutton to activate/disable alarm system, sense the temperature and relative humidity, use the LEDs included in the board for notifications (alarm ON and OFF, for example) and as emergency light (in case of power outage).
- Details
- Category: Domotics
Supposing you have a kWh device, in Domoticz, that you want to replace with a new one (the old device is broken, for example). To import all data from the old device into the new one, you have to:
- select the old device (click on Edit button)
- click on Replace button and select the name of the new device
In this way, Domoticz transfers all history from the old device to the new one.
If for some reason this procedure did not work, you can do in this way (this is the procedure for Linux/unix):
- keep note of the idx for the old device: click on Edit button for the old device and write down its idx value (called OLD_DEVICE_IDX, later)
- write down the idx of the new device (called NEW_DEVICE_IDX, later)
- open the domoticz database: from the terminal/shell, enter the domoticz directory and type the command
sqlite3 domoticz.db - check calendar data from the old device, writing the query
select * from Meter_Calendar where idx=OLD_DEVICE_IDX - in case the device is not a meter, but a rain , percentage or other type of device, use the command
.tables
to find out the name of the database table that contains data for that device, and write the same query as point #4 selecting the right table name (replacing Meter_Calendar with Rain_Calendar, Percentage_Calendar, Temperature_Calendar, ...) - Now change the idx for the historic data to the new device idx, using the query
update Meter_Calendar set DeviceRowID=NEW_DEVICE_IDX where idx=OLD_DEVICE_IDX
Specify the right table name, if device is not a meter. - .quit to exit sqlite3 program.
In this way the historic data of the old device has been set to the new device.