Do not look @ the browser.xl15 wrote:But it seems to me that it is the dummy switch that has the lag/delay?
Just llok @ the time's
And when you have working hardware..... it will be great software!!!!
Be careful addictive stuff !!!!
Moderator: leecollings
Do not look @ the browser.xl15 wrote:But it seems to me that it is the dummy switch that has the lag/delay?
Ingmar wrote:I would like to make a counter for the toilet, to keep track of how often we flush the toilet (and how much water we use with that). I was thinking about mounting a simple switch to the toilet flush button, which is connected to a Wemos/NodeMCU device which can pass it on to Domoticz that would need to sum it up per day and calculate the amount of water used. Even better is to have 2 switches; one for the big flush and one for the small flush.
But I can't figure out how to get it working... what kind of decive do I need to set up in ESP easy anyway? Who can help
Thnx for the reply. I just want to know what kind of device i need to choose from the list in the configuration screen of the espeasy firmware, so that it will send a signal to Domoticz. Then Domoticz needs to count how many times the toilet button has been pressed. How do I do that? Is that some kind of counter?Derik wrote:Ingmar wrote: I was thinking about mounting a simple switch to the toilet flush button, which is connected to a Wemos/NodeMCU device which can pass it on to Domoticz that would need to sum it up per day. Even better is to have 2 switches; one for the big flush and one for the small flush.
But I can't figure out how to get it working... what kind of decive do I need to set up in ESP easy anyway? Who can help
Perhaps by a cheap watermeter:
https://www.wildkamp.nl/Watermeter-type ... oCRyLw_wcB
Built a sensor on it...
http://www.esp8266.nu/index.php/IR
Or perhaps a:
http://www.ebay.com/itm/Arduino-Infrare ... 2078387314
If theat one is working
And build a contact @ the button..
You can count the water and you can count the times flush..
all this with 1 esp..
And you can switch also a motion to so you light is off and on'
And perhaps the temp in the room..
Code: Select all
-- Lua-script for info-upload to ESP8266 with OLED SS1306
-- (c)2017 Toulon7559 rev. 01 [but you are free to adapt the script for personal use]
-- Line 04 = Definition of function(s) and Setting of references
function round(num, dec)
if num == 0 then
return 0
else
local mult = 10^(dec or 0)
return math.floor(num * mult + 0.5) / mult
end
end
baseurl = "http://192.168.0.131/control?cmd=oled"
-- Line 16 = Call Meteo-info from Domoticz-database
Binnen_Temp_RV_Baro = 'WS7000_Temp_RV_Baro'
sTemp, sRV, sComfort, sBaro = otherdevices_svalues[Binnen_Temp_RV_Baro]:match("([^;]+);([^;]+);([^;]+);([^;]+)")
sTemp = round(tonumber(sTemp),1);
print ('Temp = '.. sTemp)
sRV = round(tonumber(sRV),1);
print ('RV = '.. sRV)
sComfort = tonumber(sComfort);
print ('Comfort = '.. sComfort)
sBaro = tonumber(sBaro);
print ('Baro = '.. sBaro)
UploadURL0A = baseurl .. ",3,1,T=".. sTemp .."C"
UploadURL0B = baseurl .. ",4,1,V=".. sRV .."%"
print (UploadURL0A)
print (UploadURL0B)
-- Line 33 = Call Production-info from Domoticz-database
Production = 'PVO_Generation_A7'
sPwr1, sEnergy1 = otherdevices_svalues[Production]:match("([^;]+);([^;]+)")
sPwr1 = round(tonumber(sPwr1),0);
print ('Pwr1 = '.. sPwr1)
sEnergy1 = round(tonumber(sEnergy1),0);
print ('Energy1 = '.. sEnergy1)
UploadURL1 = baseurl .. ",5,1,PV=".. sPwr1 .."W"
print (UploadURL1)
-- Line 44 = Call Consumption-info from Domoticz-database
Consumption = 'PVO_Consumption_A7'
sPwr2, sEnergy2 = otherdevices_svalues[Consumption]:match("([^;]+);([^;]+)")
sPwr2 = round(tonumber(sPwr2),0);
print ('Pwr2 = '.. sPwr2)
sEnergy2 = round(tonumber(sEnergy2),0);
print ('Energy2 = '.. sEnergy2)
UploadURL2 = baseurl .. ",6,1,In=".. sPwr2 .."W"
print (UploadURL2)
-- Line 55 = Perform upload
commandArray = {}
commandArray['OpenURL']= UploadURL0A
-- commandArray['OpenURL']= UploadURL0B
-- commandArray['OpenURL']= UploadURL1
-- commandArray['OpenURL']= UploadURL2
return commandArray
Code: Select all
if sPwr1 > 999 then
UploadURL1 = baseurl .. ",5,1,PV=".. sPwr1 .."W"
else UploadURL1 = baseurl .. ",5,1,PV=0".. sPwr1 .."W"
end
if sPwr1 <100 then
UploadURL1 = baseurl .. ",5,1,PV=00".. sPwr1 .."W"
end
if sPwr1 <10 then
UploadURL1 = baseurl .. ",5,1,PV=000".. sPwr1 .."W"
end
Code: Select all
2017-02-22 19:55:00.438 LUA: Temp = 20.8
2017-02-22 19:55:00.438 LUA: RV = 48
2017-02-22 19:55:00.438 LUA: Comfort = 1
2017-02-22 19:55:00.438 LUA: Baro = 1000
2017-02-22 19:55:00.438 LUA: http://192.168.0.131/control?cmd=oled,3,1,T=20.8C
2017-02-22 19:55:00.438 LUA: http://192.168.0.131/control?cmd=oled,4,1,V=48%
2017-02-22 19:55:00.438 LUA: Pwr1 = 0
2017-02-22 19:55:00.438 LUA: Energy1 = 14812156
2017-02-22 19:55:00.438 LUA: http://192.168.0.131/control?cmd=oled,5,1,PV=0W
2017-02-22 19:55:00.438 LUA: Pwr2 = 432
2017-02-22 19:55:00.439 LUA: Energy2 = 37099768
2017-02-22 19:55:00.439 LUA: http://192.168.0.131/control?cmd=oled,6,1,In=432W
2017-02-22 19:55:00.439 EventSystem: Fetching url...
2017-02-22 19:55:00.439 EventSystem: Script event triggered: /home/pi/domoticz/scripts/lua/script_time_ESP8266F_upload01.lua
Code: Select all
2017-02-22 19:55:00.751 Error: Error opening url: http://192.168.0.131/control?cmd=oled,3,1,T=20.8C
Code: Select all
http://192.168.0.113/control?cmd=GPIO,12,1
Users browsing this forum: No registered users and 0 guests