Previously I have been using exclusively ESPEasy, supported by NodeRed, Grafana, and Blynk. I am beginning my journey towards a Raspberry Pi based system and have chosen Domoticz as my 'Home Automation' platform. But to be honest, my needs are relative modest, so saying home automation platform is really overkill.
So... my conundrum... how to migrate from the ESPEasy 'rules' based programming to Domoticz dzVents or LUA? I must confess I am no programmer, but have managed to muddle my way through the ESPEasy rules setup. So I am here looking for some tips, hints, and ideas for essentially consolidating the 2 x ESPEasy platforms to a single Raspberry Pi running Domoticz.
Here's my setup...
I have a small room that contains a rack of computer servers etc (yes I work in ICT) and on cooler days sucking air from the outside keeps the room cool. And on hot days I close a damper and the first ESPEasy turns on the air conditioner in the room via an infrared LED.
ESPEasy unit 1 - has 2 x 1 wire temperature sensors and a Infrared LED transmitter connected to a ESP 8266 NodeMCU. Temp sensor 1 monitors the inside temp and Temp sensor 2 monitors the outside.
ESPEasy unit 2 - has 2 relays connected to the ESP 8266 NodeMCU. Relay 1 opens and closes a damper to the outside world, and relay 2 turns a fan on and off.
Here's the ESPEasy Rules code...
ESPEasy1
Code: Select all
On System#Boot do
notify 1, "%sysname% is started" // Send email
timerset,1,30
heatpumpir,daikin,0,3,0,23,4,2 // Send StopHP IR code on Start
TaskValueSet 4,1,0 // Set Heat Pump status to 0
TaskValueSet 4,2,[Temp1#Temperature] // Set initial inside temperature
TaskValueSet 4,3,[Temp2#Temperature] // Set initial outside temperature
timerset,4,15 // Set Timer 4 to 15 seconds
endon
On Rules#Timer=1 do
timerset,1,30
TaskValueSet 4,2,[Temp1#Temperature] // Update inside temp
TaskValueSet 4,3,[Temp2#Temperature] // Update outside temp
if [counter#InTemp] >= 25
Event,StartHP
endif
if [counter#InTemp] <= 23 and [counter#OutTemp] < 19
Event,StopHP
endif
endon
On PIR#switch=1 do
lcdcmd,on
timerset,2,15
Endon
On StartHP Do
If [counter#status]=0
heatpumpir,daikin,1,3,0,23,4,2
TaskValueSet 4,1,1
EndIf
EndOn
On StopHP Do
If [counter#status]=1
heatpumpir,daikin,0,3,0,23,4,2
TaskValueSet 4,1,0
EndIf
EndOn
On Clock#Time=All,3:25 do
timerSet,3,55
Endon
on Rules#Timer=3 do
WifiDisconnect
Reboot
endon
on Rules#timer=4 do
Publish %sysname%/IP,%ip%
Publish %sysname%/Temp1/Temp,[counter#InTemp]
Publish %sysname%/Temp1/Humidity,[Temp1#Humidity]
Publish %sysname%/Temp2/Temp,[counter#OutTemp]
Publish %sysname%/Temp2/Humidity,[Temp2#Humidity]
Publish %sysname%/AirCon/Status,[counter#status]
timerSet,4,15
endon
Code: Select all
On System#Boot do
notify 1, "%sysname% is started" // Send email
timerset,1,30 // Set timer 1 to 30 seconds
timerset,2,30 // Set timer 2 to 30 seconds
timerset,4,30 // Set timer 4 to 30 seconds
gpio,12,1 // Turn off the fan
gpio,14,1 // Close the damper
TaskValueSet 7,1,0 // Set Damper to Close
TaskValueSet 7,2,0 // Set Fan to Off
Let,1,22 // Set lower temp to 22
Let,2,24 // Set upper temp to 24
endon
On Rules#Timer=1 do
timerset,1,30
if [Temp1#Temperature] >= [var#2] and [status#Damper]=1
Event,StartFan
endif
if [Temp1#Temperature] <= [var#1] or [status#Damper]=0
Event,StopFan
endif
endon
On Rules#Timer=2 do
timerset,2,30
if [Temp2#Temperature] < 19 and [counter#Dummy]=0
Event,OpenDamper
endif
if [Temp1#Temperature] >= 25
Event,CloseDamper
endif
endon
On OpenDamper Do
If [status#Damper]=0
gpio,14,0 // Open the damper
TaskValueSet 7,1,1
EndIf
EndOn
On CloseDamper Do
If [status#Damper]=1
gpio,14,1 // Close the damper
TaskValueSet 7,1,0
EndIf
EndOn
On StartFan Do
If [status#Fan]=0
gpio,12,0 // Turn on the fan
TaskValueSet 7,2,1
EndIf
EndOn
On StopFan Do
If [status#Fan]=1
gpio,12,1 // Turn off the fan
TaskValueSet 7,2,0
EndIf
EndOn
On ACStatusOn
Let,3,1
EndOn
On Clock#Time=All,3:26 do
timerSet,3,55
Endon
on Rules#Timer=3 do
WifiDisconnect
Reboot
endon
on Rules#timer=4 do
Publish %sysname%/IP,%ip%
Publish %sysname%/Damper/Status,[status#Damper]
Publish %sysname%/Fan/Status,[status#Fan]
Publish %sysname%/Door/Status,[StudioDoor#State]
timerSet,4,30
endon
Ok, that's it. Any help guidance greatly appreciated. If I've not been clear enough with my description then please ask me more questions.
I really hope someone on here has a similar setup, and can provide examples on the dzVents or LUA setup they used?
Thanks, Mark