Page 1 of 1
How to scrape humidity only from wtgr800?
Posted: Sunday 24 April 2016 10:51
by BarryT
Good Morning,
is it possible to only scrape the "humidity" from a WTGR800 sensor?
i can't find it on the forum, nor the internet.
I want to make a irrigation system with it, so need some (variable?) values in blocky to turn on/off a (virtual switch) watervalve.
Re: How to scrape humidity only from wtgr800?
Posted: Sunday 24 April 2016 10:59
by georgesattali
Hello,
you may find examples here
https://www.domoticz.com/wiki/Smart_Lua_Scripts
I use :
Code: Select all
smoistsensorTemp, smoistsensorHumidity = otherdevices_svalues["TempHum1"]:match("([^;]+);([^;]+)")
debug("-- Irrigation ==> [TempHum1] - Soil Temperature: " .. smoistsensorTemp .. " ")
debug("-- Irrigation ==> [TempHum1] - Soil Humidity: " .. smoistsensorHumidity .. " ")
See ya, GD
Re: How to scrape humidity only from wtgr800?
Posted: Sunday 24 April 2016 11:04
by BarryT
Hi George, i've looked into there but that's not very easy
2016-04-24 11:03:01.884 Error: EventSystem: in /home/pi/domoticz/scripts/lua/script_device_hum.lua: /home/pi/domoticz/scripts/lua/script_device_hum.lua:2: attempt to call global 'debug' (a table value)
Thank you..
Re: How to scrape humidity only from wtgr800?
Posted: Sunday 24 April 2016 11:07
by georgesattali
Sorry,
debug is a function of mine, you can replace it with print to see the values in "Setup / Log" of Dz.
Re: How to scrape humidity only from wtgr800?
Posted: Sunday 24 April 2016 11:32
by BarryT
2016-04-24 11:31:05.661 (rflink) Temp + Humidity (Grondvochtigheid)
2016-04-24 11:31:05.856 LUA: -- Irrigation ==> [TempHum1] - Soil Temperature: 17.0
2016-04-24 11:31:05.856 LUA: -- Irrigation ==> [TempHum1] - Soil Humidity: 99
okay, it seems that it prints the output, but now i want it to an (virtual) device so i can use it in blocky!
thanks

Re: How to scrape humidity only from wtgr800?
Posted: Sunday 24 April 2016 11:44
by BarryT
Why is it so hard to export a variable value to an (virtual) device, so i can switch on/off things when a value is to low or to high..?
maybe i need to work with variables?
anyway, this drives me really crazy.
working with temperatures in blocky is no problem at all, but for humidity it doesnt work

Re: How to scrape humidity only from wtgr800?
Posted: Sunday 24 April 2016 15:53
by woody4165
This is the result if you
where xxxxxx is the idx number of my wtgr800 connected via RFLink
Code: Select all
{
"ActTime" : 1461505766,
"ServerTime" : "2016-04-24 15:49:26",
"Sunrise" : "06:17",
"Sunset" : "19:59",
"result" : [
{
"AddjMulti" : 1.0,
"AddjMulti2" : 1.0,
"AddjValue" : 0.0,
"AddjValue2" : 0.0,
"BatteryLevel" : 0,
"CustomImage" : 0,
"Data" : "22.0 C, 51 %",
"Description" : "",
"DewPoint" : "11.40",
"Favorite" : 1,
"HardwareID" : 15,
"HardwareName" : "RFLinkB3C",
"HardwareType" : "RFLink Gateway USB",
"HardwareTypeVal" : 46,
"HaveTimeout" : false,
"Humidity" : 51,
"HumidityStatus" : "Comfortable",
"ID" : "xxxx",
"LastUpdate" : "2016-04-24 15:48:55",
"Name" : "TempExt",
"Notifications" : "false",
"PlanID" : "0",
"PlanIDs" : [ 0 ],
"Protected" : false,
"ShowNotifications" : true,
"SignalLevel" : "-",
"SubType" : "WTGR800",
"Temp" : 22.0,
"Timers" : "false",
"Type" : "Temp + Humidity",
"TypeImg" : "temperature",
"Unit" : 0,
"Used" : 1,
"XOffset" : "0",
"YOffset" : "0",
"idx" : "xxx"
}
],
"status" : "OK",
"title" : "Devices"
}
In my Frontpage.html (by G3rard) I just grab the field "Humidity" and "Temp" to get a number only value.
Re: How to scrape humidity only from wtgr800?
Posted: Sunday 24 April 2016 16:40
by Toulon7559
@BarryT
Just wondering about your question:
1) Is the humidity-sensor of wtgr800 showing itself under Dashboard/ Devices (possibly in combination with Temperature)?
2) Subsequently (when activated under Devices), does the humidity-sensor of wtgr800 then show itself under the list of 'blocky'-elements?
List viewed according to sequence Setup > Events > Devices > Humidity
Re: How to scrape humidity only from wtgr800?
Posted: Thursday 28 April 2016 17:32
by BarryT
Toulon7559 wrote:@BarryT
Just wondering about your question:
1) Is the humidity-sensor of wtgr800 showing itself under Dashboard/ Devices (possibly in combination with Temperature)?
2) Subsequently (when activated under Devices), does the humidity-sensor of wtgr800 then show itself under the list of 'blocky'-elements?
List viewed according to sequence Setup > Events > Devices > Humidity
1) Yes it is showing itself, indeed with combination temperature.
I just want to have them as "single" values in a dummy.
2) Yes i seen them in blocky, ofcourse as single ones (temp and humidity).
I just want to have the values as single ones.
I have many devices, and the temperature and humidity takes up much space in the (index) layout of my mobile device.