Hi all,
I have a arduino that update some virtual temperature(pool,outdoor,house) sensor from ethernet card. Everything is solid and work good. Is there a way to monitor the min and max of these virtual sensor? I know that datamine do this put i just want simple referen e without the need to use usb key
Should be easy enough.
Do you have a fixed period in mind (eg. last 24 hours)
or would you want a manual reset? (like traditional max/min thermometer)
Sorry for the delay, i will like week.
Or only when i manually reset it.
OK, so I’m assuming from your original post that you have the temperature stored in a virtual temperature sensor device providing the standard service. I suggest two scenes:
- [tt]“Max/Min Update”[/tt], scheduled every minute, say, with the following Luup code:
local DEV = 272 -- *** SET THIS TO YOUR OWN DEVICE ID ***
local SID = "urn:upnp-org:serviceId:TemperatureSensor1"
local DEG, MAX, MIN = "CurrentTemperature", "MaximumTemperature", "MinimumTemperature"
local get, set = luup.variable_get, luup.variable_set
local deg = tonumber((get(SID, DEG, DEV)) or 0)
local max = tonumber((get(SID, MAX, DEV)) or deg)
local min = tonumber((get(SID, MIN, DEV)) or deg)
set(SID, MAX, math.max(max, deg), DEV)
set(SID, MIN, math.min(min, deg), DEV)
- [tt]“Max/Min Reset”[/tt], which you can schedule, say, weekly, or run manually (or both)
local DEV = 272 -- *** SET THIS TO YOUR OWN DEVICE ID ***
local SID = "urn:upnp-org:serviceId:TemperatureSensor1"
local DEG, MAX, MIN = "CurrentTemperature", "MaximumTemperature", "MinimumTemperature"
local get, set = luup.variable_get, luup.variable_set
local deg = get(SID, DEG, DEV)
set(SID, MAX, deg, DEV)
set(SID, MIN, deg, DEV)
The code creates two new variables on the selected device [tt]“MaximumTemperature”[/tt], [tt]“MinimumTemperature”[/tt], so should be immune to system resets. How you display these is up to you. For example:
[ol][li]view from the Advanced tab of the device[/li]
[li]put the values into a Virtual Container[/li]
[li]create two new virtual temperature devices, one to hold the maximum, the other for the minimum[/li][/ol]
Hope this helps.
thanks very much
that good
Hi, this seems relevant to what I’m trying to do. I have some LUA code (which I don’t understand) written in French (which I do!) to login to Netatmo weather stations (via the web I think?) and to retrieve the various data it measures. However I have no idea how to take the LUA code and load it on my Vera3 with UI5 - I tried to create a file and a device, but am left with nothing more. I have two sets of code. One mentions Vcontainers, the other doesn’t. Happy to supply the files/url’s if it helps. I’d love to see this packaged up for others to benefit from. Help! and thanks…
@Robjsewell Have a look here:
http://forum.micasaverde.com/index.php/topic,13489.msg116339.html#msg116339
Appreciate your help a_lurker, and have made some progress. However, I can’t install VXCntainer twice, nothing happens? Or do I need to install another device using the install file? I’m guessing at most of all this! Also not sure what to do with your code, do I save that as a D_ file, upload it and link it to a new device? Lastly there are four variables in the code for authentication but Im only aware of two, my userid and password. I’ll Google around to try to work it out and reply for others’ benefit if I crack it!
@Robjsewell Best to move this conversation to over here where it belongs:
http://forum.micasaverde.com/index.php/topic,13489.msg116440.html#msg116440