Sometimes the question is posted "what (project) have you put together with domoticz" or questions seeking some inspiration.
In this post i will summarize what i have created as ideas for others.
(@mods : move this post if you think is best fitting on another threat, just posted it here because all is based on lua)
When i started, i knew nothing, all is learned on the job. I had no scripting skills at all and no knowledge of any form of automation.
LUA
First of all i am working in lua only (no dz events) because thats how it started back then, and it took a lot of time to learn and understand.
So i kept with what i learned and never ported to dz events.
I learned the hard way in lua that you always have to check current value before to set a new value to avoid loops ending in crashing domoticz , or massive domoticz slow down due to constantly repeated actions.
And in if-then constructions for devicechanged, also check always agains a value, just to exclude nil values that can throw a lot of errors in a short time.
I have roughly 10 device scripts end 20 time based script. I have created a separate function file thats loaded in each script and is my storage place for all functions in lua (reuse what's possible in all scripts)
RPI/X86
For stability reasons i transferred in 2018 most to windows on an old laptop : I was tired of SD cards getting corrupted, and this was closest to my skill set. (This is an old small laptop using not too much energy, i mounted a ssd drive) I never had any problems any more. Domoticz runs on Windows very stable in my opinion. (But i've learned that all the same things are possible on RPI also with ssd and so. Thinking not to change a winning team i keep what ive got until hardware breaks. I have already an RPI running as testing platform.) I am always one version behind, and check forum before updating production env. If things are reported i wait till things are solved. Lately i never had to wait but i'll keep the habit
Open Hardware monitor
I use open hardware to monitor CPU temp, CPU %, HD Temp, HD % usage, Mem % usage.
CPU % was really helpfull to keep domoticz up to speed. HD usage is handy to do a cleanup at a certain point, i have plenty of discspace, it it helps in performance.
Python libs
I use a lot of python scripts (not plugins) with the Domoticz JSON api to get values in sensors. I try to avoid plugins, as over the years i experienced them going out of support after some time. I use maintained python libs, try to understand them and add some domoticz interaction, Over the time i get better at this, but in reality python is beyond my skills. I just manage to make a json call with values to domoticz.(Sometimes with a lot of help on Python forums)
This gives me a good feeling of being in controll. Off course the always changing api's are a pain in the *** because then the libs needs adjustment. Sometimes i can do this myself and sometimes i have to wait or find a new lib.
Windows schedular
I have set up windows scheduler with batch files to get external data (HTML/JSON) into text files. I recently made this move as this is running in a separate process thus speeding up domoticz a lot. The text files are written to a ram drive --> Much faster access from domoticz & cleared on reboot. Domoticz is now making no calls, just reads the files (disk.IO)
Scraping
I use : - chrome canary to scrape &
- curl.exe for windows (not the default thats in windows at the moment!) to plain read stuff.
Till now i was able to get anything i wanted.
Nature monitoring :
Dutch RIVM has a big set of usable data below what i use from them :
- NO, NO2, Pm10, PM2.5, O3, SO2, C7H8, C8H10, LKI --> If one of them get at an alarm level the inhome vent system shuts down.
Seawater temperature --> No interaction just nice to now in summer when going to the beach
Sea wave size --> No interaction, nice to know when going out (rental) boating.
River water levels --> Telegram message when rising above x level nearby like a "floating alert"
Earthquakes : Monitoring Local and world, relevant and interesting to monitor
Lightning/ thunderstorms: gives telegram message : useful to disconnect antenna when closing to my home.
Rain & wind & outside temperature : Rain values --> used to close external window shutters
Outside Temperature : used to adjust air-conditioning & stop inhome ventilation if needed. Also used to set up heating parameters in winter. Also closing the curtains and outside window shutters when sunny and hot outside.
Grip level monitoring : Dutch C2000 government alarm levels, used to stop vent when a building nearby is on fire (or other triggers) and when really close the outside windows shutters are closed
NL alert & Amber-Alert : Also nice to know. When nearby generates a telegram message.
Garbage calendar : display on custom page a message in the morning so i dont forget
Whether alerts from https://www.meteoalarm.org/nl/live/ : Notification for today and tomorrow on telegram + close outside window shutters if needed ( time frames are reported on the alerts.)
Energy monitoring : Telegram gives an alert on things strange/ out of range values. Also some custom sensors to be able to check the energy bill more precisely and to reduce costs
Solar panel monitoring as input for Energy monitoring & to activate things on sunny moments ( save energy)
IR blaster so anything that used IR can be managed by domoticz ( also as backup for airco, tv and local in room heater)
Water usage and warm water* usage : to be able to check the energy bill more precisely and to reduce costs, also leakage detection.
Ventilation as you can read its managed by a lot, also by indoor air quality, temp and humidity. I have a selector switch where i can set a focus.
light bulbs color and light intensity is managed on a set of parameters like present light (lux), time of day, movement and other triggers. It is completely automated and can be adjusted with physic wired and wireless switches (zigbee) ánd colors intensity. Sometimes also as a signal to a certain situation, like alarm settings, presence detection or some exception. In general more movement = intenser light.
I have energy measuring smart plugs on :
- Television/ audio set
Washing machine Gives message when finished based on Elektra use, shuts off when current > offset (fire prevention)
Drying machine Gives message when finished based on Elektra use, shuts off when current > offset (fire prevention)
Dishwashing machine Gives message when finished based on Elektra use, shuts off when current > offset (fire prevention)
Fridge Gives message when not closed based on Elektra use.
central heating system used for warm water usage detection together with water meter. Heating and warm water are combined, but each has a different power consumption profile. That's how i can distinguish them.
Internet :
Disables external loading scripts when I-net connection problem occurs as i load a bunch of data from internet (pinging first hop outside provider network) & notify on telegram when back normal.
Also logging speed test download and upload every hour.
Traffic (Waze :
Morning : Home-work Afternoon : Work-Home (travel time & distance)
When not normal at 7h00 and at 16h00 it sends a message to telegram.
Air-conditioning :
fully controllable in domoticz, but scripts run this fully automatic based on measured values from in home sensors (=not airco sensors). Heating, cooling, drying as efficient as possible taking energy usage into account , e.g. airco on when hot and sun is shining, but pause when its getting cloudy for >5 min. (Not stopping as many start stop reduce lifespan of mechanical parts, i set the wished temp close to current temp, result = airco using less energy.)
Airco is fully automated, cooling and heating. This takes solar energie into account, for uptimum use of solar energy. I never adjust manual ( not needed) Works in conjunction with curtain, central heating, radiator vents, solar, external and internal temperature sensors, all on all floors. If heating takes to long then downstairs an extra elektric heater will jump in to speedup ( during solar energy)
Movement & lightning :
I have many movement sensors (also equipped with temp and light sensors)
These are used for fully automated lamps.
I have a custom page in domoticz showing on a plan where is movement in a room and what is the room temperature.
Smart lighting is not only based on movement but also on energy usage of earlier mentioned equipment.
I cook electric --> energy usage is setting cooking vent, central vent and kitchen lighting
Door opening sensors --> special light settings inside and outside, also stops heating when not closed in time or gives an alert when leaving
Bathroom :
Detecting when shower is in use with movement, water and energy usage. When showering > 5 min lights will sign. When waking up & movement max lights in bathroom for shaving. If we push a button a special dimmed light scene is activated.
Toilet :
Toilet in use >3 min. then vent on
Safety :
Smoke detection : cutting of electricity where needed, water off and external window shutters closed (keep oxygen out) , all vent off, all sealing lights dimmed on & floor light max ( below smoke, as smoke rises)
Sounds by domoticz :
I announce important messages (with Text to speech) on each floor. Like things are ready or an exception occurred.
Scraping :
Scraping latest news headlines.
Scraping missed and wanted persons within 50 km radius
15 Scenes for recurrent handlings
Outdoor scene, bases on movement, party etc
Alarm Scene
Movie scene in 2 rooms
Audio scene in all rooms, with audio following the movement --> Nice playing spotify and music is where you are.
....
AV receiver settings
All adjusted based on who is in tha house and what is happening ( muzic, movie, party, streaming)
Took a while to see patterns and most used settings for those, but its almost running fully controlled by domoticz
Planes:
Using ADSB to monitor nearby airplanes distance, alt, speed, type, call sign ( collect data if needed to be able to file a report (later on) if i want to, just get only data based on criteria i've set)
iRobot :
Cleaning is started by domoticz when not at home, directed to spaces based on the movement sensor detections. (Where nobody has been , no cleaning needed.)
Curtains and outdoor window shutters managed by all kind of parameters to close/ open. Even if i forget to close a windows, one of the benefits is the rain is never coming inside ... Curtains are in summer closed based on lux and temp preventing sun to heatup the room on sunny side of my home. In winter they are closed nd opened based on outside temp, heating on or off and many more things.
Radiator ventilators are in summer used in conjunction with the airco to get air circulation when airco is cooling (+ Radiator is also cooling airflow a bit) and the airflow from airco is more diffused. In winter the radiator vents are used to spread the heat more and faster true the room speeding up the heating (10 min less heating needed to get the set temperature)
Local ground temperature --> Gardena used, give message on low temp usable info for driving
Local ground moisture --> in conjunction with wether conditions and temperature : watering the garden
Door locks --> Doors locked when away, open when arriving home, unlatch the door when i arrive by car, open garage door when i arrive at a bike.
Face recognition & presence detection --> I use an old android phone, catch recognition notifications from cams and send to domoticz with Tasker (no APi). This android phone is located next to the pc ( I never take it with me) Face recognition is used to arm and disarm security. Works pretty well, just need a backup in case something's not working well : I use telegrambot as backup to be able to interact.
Also send a message with picture to telegram (high-res) when not home and not recognised person enters! Till today never had a picture and hope it keeps that way
Phone monitoring Tasker sends some parameters to domoticz based on certain events. This way the home is warm when arriving, lights are adjusted and more.
BT & network monitoring & presence detection ALL BT mac and network Mac are captured and analyzed, (all beacons) --> used for present and trespassing detection. Together with face recognition & face profile storage, I have quite a profile now on any one moving on my property.
Security
I have also implemented some countermeasures when some tries to access my home (without permission) or when being unknown to the system, including a phone call phoning out ( using TTS to make the message). The kids feel very secure because of this when being home alone, they have also a panic button.
I have build a sensitivity selector for the alarm threshold. Sometimes when very windy it can trigger some movement sensors, they can be excluded by a simple tap. The selectorswitch sets 4 levels of detection with different values for x time movement when "Armed away" or "Armed home". Opening doors triggers always immediatly the security system resulting in some actions.
The security system has a special mode when face-recognised persons are detected, with different actions based on time and the person being recgnised. If enabled even with custom personalised greatings via TTS. ( it scares people, so its mostly disabled)
Google agenda & outlook agenda interaction with tablet on the wall for appointments and notes I made.
Telegram bot i can adjust anything by telegram, again, if i need to adjust something's going wrong and i will take a look into how to avoid later on. So telegram is used to inform silently or with notification and telegram can be used to interact.
RPI as smart speaker I have a living room RPI with a speaker mounted, with text to speech i have it announcing what's going on or is detected. I am trying to get it to listen also like a smart speaker but have had no luck at the moment.
Script Timing protection I measure running time of each script and have set some general tressholds --> also a total of all time- and device- based scripts. This way if something is causing a delay, let say a sensor is behaving strange, i made a typo, something wrong on an external python script, it will be easy to find the cullprit. Saved me a lot of time in error tracking. Timing is a thingy especialy if you want to send/ receive things from/to internet. (This can make domoticz very slow, but there are ways to avoid that)
Inter(net) connectivity I have nothing sending/ receiving data from internet directly from within domoticz. As domoticz waits to finish the call, your lights and device values will wait too, i found it annoying back in 2020 and made batch scripts, called by windows schedular saving data into a text file on a ram drive. Once a day the ram drive is flushed. This way domoticz never has to wait. Took a while to make it usable but runs smooth now and domoticz is lighting fast. (yes you can't run tasks in schedular every 10 sec but if you are creative in the trigger settings: by default only once a minute is possible on windows schedular, so make a trigger with seconds delay on top of the initial trigger and you can run every 10 sec..)
Network
All devices are on a VLAN and i have a pFsense firewall running with strict rules how things can communicate to each other and/or to the internet. Never disclose anything to the internet directly, In 2018 i have been hacked due to crappy firmware of a device connected to domoticz. That was a big learning lesson.
Now i only work true reversed proxy (also on LAN), external access only by VPN, i've altered the index page with 2 lines, to set a super cookie, and with PHP a Browser ID, local ip, wan IP and country location are stored in domoticz database on logon. (If not originating from my country you will be redirected to a decoy site, also when not accesing via the reverse proxy you get the decoy, nothing can directly 1:1 communicate on the LAN with domoticz website.
Wall mounted Tablet
I have a tablet on the wall in a central place (to display what srelevant at that moment with a custom template)
I dont use the tablet to adjust things, if i need to adjust something in domoticz, my script is not working well, so i'll adjust that rather.
(BUT : i'll keep normal use like light switches to, just for when people visiting or something's broken. You can always fall back to the original interaction with the lamp or device.)
The tablet shows a dynamic filled template with for us most usable date from domoticz.
That pages shows only what's relevant at that specific moment. Fixed on the site is who's present and energy consumption.
So it could display a domoticz message, NL alert, breaking news, travel time and so on.... what ever is relevant at the time you look at it. No direct sensors, and its lean and clean.
When the front door opens it shows a warning to strangers (with an attention for facerecognition and BT/Wifi beacon scanning)
When domotics is "Armed home" or "Armed away" the tablet shows the security panel on the right side of the page, making it easy to disarm.
Domoticz has also another template website, where anyone can type a message that can be send to broadcast with TTS to a selectable device.
I can even start casting a youtube movie to a television or another casting receiver from this site.
Feel and effect
Probably i forgot some, just when things fail i remember how many i have done in domoticz. (My goals is not to adjust anything by hand)
For most things i have also running monitoring for when something fails or when i forget something (e.g. to turn something off)
So anything i could think of is managed by domoticz and automated. ( suggestions ?)
The energy bill is reduced with about 15-25% by smart mangement of gas and elekticity use.
The water measurement made me discover a small leak about 3-4 liter a day. I would have never discoverd this without domoticz (or when it was to late and had done a lot of damage)
WAF
Biggest problem is the Wife Acceptance Factor ... But if its easy to use and feels natural it helps a lot. So i do not trial and error in working env. but test, test and test again before implementing.
Conclusion
Anything is possible, your imagination/creativity is the limit.
Domoticz is very flexible and you can interact with almost anything ...
p.s. This year is my 9-year anniversary on domoticz ( the first period i was not on the forum)
<edit : many typo's and add things i forgot to mention>