The Vera Community forums have moved!

General => Temperature Monitoring & HVAC Control => Topic started by: ipstas on March 12, 2019, 04:27:35 pm

Title: Free graphs for your temp/power sensors
Post by: ipstas on March 12, 2019, 04:27:35 pm
Free graphs / gauges visualization https://www.hundredgraphs.com (https://www.hundredgraphs.com)

Works really simple, you just need a lua file (provided as well), change it to your liking with devices id and serviceId, add to your Luup files. Edit your Startup Lua to include

monitcode = require("Moniton")

Start pushing data
Select what feed is going to be used
Select linear or gauge
Give a title and save
It comes to your dashboard by itself

Let me know if you have any questions
Title: Re: Free graphs for your temp/power sensors
Post by: tomtcom on March 12, 2019, 07:04:17 pm
Wow, great find.

Can you provide more details on these files? I read what you posted but I'm not entirely sure what all is needed. Perhaps a few step by step bullets?

Sent from my VS995 using Tapatalk

Title: Re: Free graphs for your temp/power sensors
Post by: ipstas on March 12, 2019, 07:43:06 pm
- download Moniton.lua from https://www.hundredgraphs.com/files/Moniton.lua
- get API key from your Settings https://www.hundredgraphs.com/settings
- update Moniton.lua with new API key
- update same file with device ids you want to push
- go to Vera to Apps/Develop Apps/Luup files and upload that file
- in Edit Startup Lua add line
monitcode = require("Moniton")
After Luup restart Vera should be pushing data every 1 minute

On hundredgraphs you will be able to see new data under /Feeds
Next step go to /Graphs and click on + to add a new Graph

Select Feeds
Choose Linear or Gauge
Add title and units
Save

Now that graph should go to your dashboard like in that demo https://www.hundredgraphs.com/demo

Some docs are there https://www.hundredgraphs.com/apidocs
Title: Re: Free graphs for your temp/power sensors
Post by: Don Phillips on March 12, 2019, 08:52:28 pm
+1 - I hope to get time this fall to try this out.
Title: Re: Free graphs for your temp/power sensors
Post by: tomtcom on March 12, 2019, 08:58:15 pm
Awesome ipstas! You are a rock star! I will be trying this out.

Sent from my VS995 using Tapatalk

Title: Re: Free graphs for your temp/power sensors
Post by: ipstas on March 13, 2019, 01:00:06 pm
my pleasure. If you need something else, just ask. I am the one behind it

Here or preferably at https://www.hundredgraphs.com/#contact. Forum here doesn't send any notifications, I might miss it
Title: Re: Free graphs for your temp/power sensors
Post by: jvanhambelgium on March 13, 2019, 04:45:26 pm
I can't seem to be able to download the required Monitor.lua file ? I get a 404 / non-existing error for this link

https://www.hundredgraphs.com/files/Moniton.lua

Normal ?
Title: Re: Free graphs for your temp/power sensors
Post by: akbooer on March 13, 2019, 04:46:46 pm
I can't seem to be able to download the required Monitor.lua file ? I get a 404 / non-existing error for this link

That link works fine for me.
Title: Re: Free graphs for your temp/power sensors
Post by: jvanhambelgium on March 13, 2019, 04:50:20 pm
I can't seem to be able to download the required Monitor.lua file ? I get a 404 / non-existing error for this link

That link works fine for me.

The link here in the forums indeed works, on the website itself in the API-key section there is also a link an that one does not work for me.
Links are exactly the same ... weird ....


Title: Re: Free graphs for your temp/power sensors
Post by: sebby on March 13, 2019, 05:44:58 pm
I can't seem to be able to download the required Monitor.lua file ? I get a 404 / non-existing error for this link

That link works fine for me.

The link here in the forums indeed works, on the website itself in the API-key section there is also a link an that one does not work for me.
Links are exactly the same ... weird ....
I had the same issue on the website.  link here works just fine.
Title: Re: Free graphs for your temp/power sensors
Post by: ipstas on March 13, 2019, 07:00:29 pm
wow! thanks for pointing out. Fixed
Title: Re: Free graphs for your temp/power sensors
Post by: korttoma on March 14, 2019, 02:57:32 am
Thanks for this @ipstas works nicely!!
Title: Re: Free graphs for your temp/power sensors
Post by: ipstas on March 14, 2019, 11:51:37 am
@korttoma Glad to help. If any questions/suggestions/ideas, please feel free to ask.
Title: Re: Free graphs for your temp/power sensors
Post by: wilme2 on March 14, 2019, 05:03:07 pm
After Luup restart Vera should be pushing data every 1 minute

Looks great!

Is there a way to push less frequently?  My Vera is really busy - adding something that runs 1440 times a day is problematic.  But if I could push say every 10 minutes...
Title: Re: Free graphs for your temp/power sensors
Post by: ipstas on March 14, 2019, 06:38:07 pm
There is a variable in lua file
local updateInterval = 60

You can  change it to any seconds you want (not less than 60). I am personally pushing every 60 secs. But I think average user would be ok with 600 (ten minutes). Vera by itself is not updating stuff too often
Title: Re: Free graphs for your temp/power sensors
Post by: Gabriel on March 15, 2019, 07:19:11 am
1-
What about moving the variables array into startup.lua ( before monitcode = require("Moniton") )?
That would allow to update the monitored sensors within the startup.lua (which can be modified directly from IU7 or AltUI), instead of having to download/modify/update the Moniton.lua file.

2-
What about not pushing the data when the current value is identical to the previous one? That would reduce the load on Veras and on the backend.
Title: Re: Free graphs for your temp/power sensors
Post by: Forzaalfa on March 15, 2019, 07:56:59 am
Cool!

Any chance these graphs could be shown in i.e. Imperihome, og do you have to go to that dashboard site?
Title: Re: Free graphs for your temp/power sensors
Post by: ipstas on March 15, 2019, 12:04:43 pm
1-
What about moving the variables array into startup.lua ( before monitcode = require("Moniton") )?

2-
What about not pushing the data when the current value is identical to the previous one? That would reduce the load on Veras and on the backend.

1. I would prefer not to, the right way would be for somebody step up and create a plugin instead. Messing with startup lua is IMHO the wrong way to do it.

But I will think about better options. For example I can make a way to dynamically update that list on HundredGraphs and Vera would pull it up from there

2. Ah, but the plugin doesn't remember what it has submitted last time. And for the backend it just upserts the data. It doesn't matter much if you have pushed 8 unchanged and 2 changed variables or only 2 that were changed
Title: Re: Free graphs for your temp/power sensors
Post by: ipstas on March 15, 2019, 12:12:17 pm
Cool!

Any chance these graphs could be shown in i.e. Imperihome, og do you have to go to that dashboard site?

those graphs are generated dynamically and in fact locally by your browser, so no images on a server, only raw and aggregated data (when you for example requested a monthly graph). I will look into what IH can do, but for now I don't see much of the option unless it is embedded

Android app is coming if it helps
Title: Re: Free graphs for your temp/power sensors
Post by: ipstas on March 16, 2019, 09:56:35 am
Upd: new version of lua file. Now it sends data over https so you can have a bit more privacy over transferred data.

Please make sure you have updated Startup too. Now it looks like
monitcode = require("Moniton")
monitcode.HGTimer(600)

where 600 is time in seconds, now you can change it dynamically without changing a file itself

A question.
- Does anybody uses IFTTT for anything?
- Or anybody needs that data read for anything (API read access)?
Title: Re: Free graphs for your temp/power sensors
Post by: Talisker on March 16, 2019, 10:11:22 am
I have followed the instructions, checked and double checked that I have followed them line by line, but my vera is not pushing any data.  I can do a https push from my web browser and that works fine.  Any suggestions of what I could do or check? Thanks.
Title: Re: Free graphs for your temp/power sensors
Post by: ipstas on March 16, 2019, 10:23:40 am
I think it was a bug in that lua file before. If you manually can do that https://www.hundredgraphs.com/api?key=AAbbCC&node=10&json={House:2111.571,Total:2111.571} with your key of course and your feeds come up, then https://www.hundredgraphs.com (https://www.hundredgraphs.com) accepts data.

Then if your DEBUG = true, you should be able to see in the log lines like

50      03/16/19 2:27:00.100    luup_log:0: [Moniton] Logger:  HGTimer 1 60 <0x73576520>
50      03/16/19 2:27:00.103    luup_log:0: [Moniton] Logger:  collected vars: 26 <0x73576520>
50      03/16/19 2:27:00.104    luup_log:0: [Moniton] Logger:  sending data: &debugtrue&version=3.16.2019&node=1&json={House:2026.537} <0x73576520>
50      03/16/19 2:27:00.297    luup_log:0: [Moniton] Logger:  sent data status: 200 <0x73576520>
50      03/16/19 2:27:00.298    luup_log:0: [Moniton] Logger:  next in 60 <0x73576520>


If you don't see it, it is definitely a problem with lua. Next step would be - just copy and paste the whole file in Test Luup code (Lua) and let me know if it came as Success of Failed
Title: Re: Free graphs for your temp/power sensors
Post by: Talisker on March 16, 2019, 10:50:28 am
Thanks for the prompt response ipstas.

I don't actually know where to find the log, but I did paste my Monitcode.lua into Test Luup code (lua) and it came back Success.   I have attached my file in case you can see where I have made an error.
Title: Re: Free graphs for your temp/power sensors
Post by: ipstas on March 16, 2019, 11:21:13 am
You know that API key in the file gives unrestricted write access over api? I would regenerate it now

I ran the code it definitely works (i have changed the key so it would not mess with your data, but I see it is pushing). I forgot to mention when you are running it manually you need to add 1 more line at the end. Like this
HGTimer(600)
It starts the timer.

Now can you try these 2 in the Test Luup code (Lua)
monitcode = require("Moniton")
monitcode.HGTimer(600)


And it will popup in the log

To see logs. If you have ALTUI go to Misc/OS Command/Tail logs and just run default or use this
grep Monito /var/log/cmh/LuaUPnP.log. Other way is to access that log over ssh on your Vera

Of course make sure you have these 2 in your Startup Lua
monitcode = require("Moniton")
monitcode.HGTimer(600)


This is what starts the loop, otherwise you have just a file sitting there doing nothing
Title: Re: Free graphs for your temp/power sensors
Post by: Talisker on March 16, 2019, 11:38:02 am
Great stuff.  I am now getting my data pushed through.  I very much appreciate your help.  I will also take your advise and change my API key!
Title: Re: Free graphs for your temp/power sensors
Post by: ipstas on March 16, 2019, 12:09:39 pm
no problem at all
Title: Re: Free graphs for your temp/power sensors
Post by: ipstas on March 17, 2019, 01:01:21 pm
Would somebody need a push/sms about energy/temp spike?
Title: Re: Free graphs for your temp/power sensors
Post by: tomtcom on March 17, 2019, 02:20:22 pm
**Re-editing post**

A graph doesn't display in the dashboard but does in the graphs tab.

Title: Re: Free graphs for your temp/power sensors
Post by: Cor on March 18, 2019, 05:16:06 am
 :( I can't get it to work.

I changed the API key and the local VARIABLES , I think with the last one I did something wrong.
but what?

Attached a screenshot of the startup LUA and the moniton file which I uploaded.




Code: [Select]
-- API Key
local API_KEY = "BN741D9X" -- grab that KEY from your settings on https://www.hundredgraphs.com/settings
local NODE_ID = 1
local TOTAL = 'Total'
local version = '3.16.2019'

-- Upload Frequency in seconds. We do not accept updates more often than 60 sec
local updateInterval = 600

-- Log debug messages
local DEBUG = true
local remotedebug = false

-- Setup your devices here. You can use a function to calculate the power as illustrated in the sample.
-- For device logging, use: key, deviceId, serviceId, serviceVar
-- For function based logging, use: key, calculate, serviceVar
-- if you want power to be counted for Total use countTotal=true
local VARIABLES = {
{ key='Boiler Temperature', deviceId=480, serviceId="urn:upnp-org:serviceId:TemperatureSensor1", serviceVar="CurrentTemperature"},
{ key='Outside Temperature', deviceId=268, serviceId="urn:upnp-org:serviceId:TemperatureSensor1", serviceVar="CurrentTemperature"},
{ key='Living Room Temperature', deviceId=37, serviceId="urn:upnp-org:serviceId:TemperatureSensor1", serviceVar="CurrentTemperature"},
{ key='Corridor Temperature', deviceId=40, serviceId="urn:upnp-org:serviceId:TemperatureSensor1", serviceVar="CurrentTemperature"},
{ key='Radiator Temperature', deviceId=481, serviceId="urn:upnp-org:serviceId:TemperatureSensor1", serviceVar="CurrentTemperature"},
{ key='Buffer Temperature', deviceId=478, serviceId="urn:upnp-org:serviceId:TemperatureSensor1", serviceVar="CurrentTemperature"},
{ key='Ambient Temperature', deviceId=479, serviceId="urn:upnp-org:serviceId:TemperatureSensor1", serviceVar="CurrentTemperature"},
{ key='Garage Temperature', deviceId=416, serviceId="urn:upnp-org:serviceId:TemperatureSensor1", serviceVar="CurrentTemperature"},
{ key='Hobby Temperature', deviceId=228, serviceId="urn:upnp-org:serviceId:TemperatureSensor1", serviceVar="CurrentTemperature"},
{ key='Hobby Humidity', deviceId=230, serviceId="urn:micasaverde-com:serviceId:HumiditySensor1", serviceVar="CurrentLevel"},
{ key='Bathroom UP Humidity', deviceId=88, serviceId="urn:micasaverde-com:serviceId:HumiditySensor1", serviceVar="CurrentLevel"},
{ key='Bathroom Down Humidity', deviceId=79, serviceId="urn:micasaverde-com:serviceId:HumiditySensor1", serviceVar="CurrentLevel"},
{ key='Bathroom UP Temperature', deviceId=87, serviceId="urn:upnp-org:serviceId:TemperatureSensor1", serviceVar="CurrentTemperature"},
{ key='Bathroom Down Temperature', deviceId=78, serviceId="urn:upnp-org:serviceId:TemperatureSensor1", serviceVar="CurrentTemperature"},
-- { key="Energy", deviceId = 301, serviceId='urn:micasaverde-com:serviceId:EnergyMetering1', serviceVar="Watts", countTotal=false },
-- { key="Energy2", deviceId = 301, serviceId='urn:micasaverde-com:serviceId:EnergyMetering1', serviceVar="Watts", countTotal=true },
-- { key='Lock', deviceId=437, serviceId="urn:micasaverde-com:serviceId:HaDevice1", serviceVar="BatteryLevel"},
-- { key='Temperature', deviceId=355, serviceId="urn:upnp-org:serviceId:TemperatureSensor1", serviceVar="CurrentTemperature"},
-- { key='Tripped', deviceId=331, serviceId="urn:micasaverde-com:serviceId:MotionSensor1", serviceVar="Tripped"},
-- { key='Humidity', deviceId=318, serviceId="urn:micasaverde-com:serviceId:HumiditySensor1", serviceVar="CurrentLevel"},
-- { key='BedroomHum', deviceId=385, serviceId="urn:micasaverde-com:serviceId:HumiditySensor1", serviceVar="CurrentLevel"},
-- { key='House B', deviceId=13, serviceId="urn:upnp-org:serviceId:SwitchPower1", serviceVar="Status"}, -- Send switch status
-- { key='Computer', calculate=function() return (IsComputerPingSensorTripped() and 38 or 1) end, serviceVar="Watts" }, -- Send variable value
-- { key='Other', calculate=function() return 15 end, serviceVar="Watts" } -- Send a constant value
}


-- You shouldn't need to change anything below this line --

Many thanks,
Cor


Title: Re: Free graphs for your temp/power sensors
Post by: tomtcom on March 18, 2019, 07:25:50 am
:( I can't get it to work.

I changed the API key and the local VARIABLES , I think with the last one I did something wrong.
but what?

Attached a screenshot of the startup LUA and the moniton file which I uploaded.




Code: [Select]
-- API Key
local API_KEY = "BN741D9X" -- grab that KEY from your settings on https://www.hundredgraphs.com/settings
local NODE_ID = 1
local TOTAL = 'Total'
local version = '3.16.2019'

-- Upload Frequency in seconds. We do not accept updates more often than 60 sec
local updateInterval = 600

-- Log debug messages
local DEBUG = true
local remotedebug = false

-- Setup your devices here. You can use a function to calculate the power as illustrated in the sample.
-- For device logging, use: key, deviceId, serviceId, serviceVar
-- For function based logging, use: key, calculate, serviceVar
-- if you want power to be counted for Total use countTotal=true
local VARIABLES = {
{ key='Boiler Temperature', deviceId=480, serviceId="urn:upnp-org:serviceId:TemperatureSensor1", serviceVar="CurrentTemperature"},
{ key='Outside Temperature', deviceId=268, serviceId="urn:upnp-org:serviceId:TemperatureSensor1", serviceVar="CurrentTemperature"},
{ key='Living Room Temperature', deviceId=37, serviceId="urn:upnp-org:serviceId:TemperatureSensor1", serviceVar="CurrentTemperature"},
{ key='Corridor Temperature', deviceId=40, serviceId="urn:upnp-org:serviceId:TemperatureSensor1", serviceVar="CurrentTemperature"},
{ key='Radiator Temperature', deviceId=481, serviceId="urn:upnp-org:serviceId:TemperatureSensor1", serviceVar="CurrentTemperature"},
{ key='Buffer Temperature', deviceId=478, serviceId="urn:upnp-org:serviceId:TemperatureSensor1", serviceVar="CurrentTemperature"},
{ key='Ambient Temperature', deviceId=479, serviceId="urn:upnp-org:serviceId:TemperatureSensor1", serviceVar="CurrentTemperature"},
{ key='Garage Temperature', deviceId=416, serviceId="urn:upnp-org:serviceId:TemperatureSensor1", serviceVar="CurrentTemperature"},
{ key='Hobby Temperature', deviceId=228, serviceId="urn:upnp-org:serviceId:TemperatureSensor1", serviceVar="CurrentTemperature"},
{ key='Hobby Humidity', deviceId=230, serviceId="urn:micasaverde-com:serviceId:HumiditySensor1", serviceVar="CurrentLevel"},
{ key='Bathroom UP Humidity', deviceId=88, serviceId="urn:micasaverde-com:serviceId:HumiditySensor1", serviceVar="CurrentLevel"},
{ key='Bathroom Down Humidity', deviceId=79, serviceId="urn:micasaverde-com:serviceId:HumiditySensor1", serviceVar="CurrentLevel"},
{ key='Bathroom UP Temperature', deviceId=87, serviceId="urn:upnp-org:serviceId:TemperatureSensor1", serviceVar="CurrentTemperature"},
{ key='Bathroom Down Temperature', deviceId=78, serviceId="urn:upnp-org:serviceId:TemperatureSensor1", serviceVar="CurrentTemperature"},
-- { key="Energy", deviceId = 301, serviceId='urn:micasaverde-com:serviceId:EnergyMetering1', serviceVar="Watts", countTotal=false },
-- { key="Energy2", deviceId = 301, serviceId='urn:micasaverde-com:serviceId:EnergyMetering1', serviceVar="Watts", countTotal=true },
-- { key='Lock', deviceId=437, serviceId="urn:micasaverde-com:serviceId:HaDevice1", serviceVar="BatteryLevel"},
-- { key='Temperature', deviceId=355, serviceId="urn:upnp-org:serviceId:TemperatureSensor1", serviceVar="CurrentTemperature"},
-- { key='Tripped', deviceId=331, serviceId="urn:micasaverde-com:serviceId:MotionSensor1", serviceVar="Tripped"},
-- { key='Humidity', deviceId=318, serviceId="urn:micasaverde-com:serviceId:HumiditySensor1", serviceVar="CurrentLevel"},
-- { key='BedroomHum', deviceId=385, serviceId="urn:micasaverde-com:serviceId:HumiditySensor1", serviceVar="CurrentLevel"},
-- { key='House B', deviceId=13, serviceId="urn:upnp-org:serviceId:SwitchPower1", serviceVar="Status"}, -- Send switch status
-- { key='Computer', calculate=function() return (IsComputerPingSensorTripped() and 38 or 1) end, serviceVar="Watts" }, -- Send variable value
-- { key='Other', calculate=function() return 15 end, serviceVar="Watts" } -- Send a constant value
}


-- You shouldn't need to change anything below this line --

Many thanks,
Cor

It looks right to me. Mine stopped working yesterday around 3:45PM EDT I believe. Hasn't updated since then.
Title: Re: Free graphs for your temp/power sensors
Post by: korttoma on March 18, 2019, 08:14:38 am
My graph is still working as expected.
Title: Re: Free graphs for your temp/power sensors
Post by: Cor on March 18, 2019, 08:46:31 am
:( I can't get it to work.




Been playing a bit with it , it seems it has something to do with the names I gave it.
Code: [Select]
{ key='Bathroom Down Humidity', deviceId=79, serviceId="urn:micasaverde-com:serviceId:HumiditySensor1", serviceVar="CurrentLevel"},I changed this to
Code: [Select]
{ key='Bathroom ', deviceId=79, serviceId="urn:micasaverde-com:serviceId:HumiditySensor1", serviceVar="CurrentLevel"},And inserted that as the only one, now it is working for that one.....

 Cor
Title: Re: Free graphs for your temp/power sensors
Post by: akbooer on March 18, 2019, 09:17:22 am
...it seems it has something to do with the names I gave it.

So far as I can see from the code, the parameters are not URL-encoded, so spaces and other characters may indeed cause problems.
Title: Re: Free graphs for your temp/power sensors
Post by: Talisker on March 18, 2019, 03:03:56 pm
For some reason I seem to be able to set up linear graphs, but not gauges? 

https://www.hundredgraphs.com/dashboard/Talisker

Any suggestions?  I've check the variable names.
Title: Re: Free graphs for your temp/power sensors
Post by: Cor on March 18, 2019, 03:30:01 pm
@ Akboer: Thanks; that was indeed the problem , now data is getting through.

A Question for Ipstas: Would it be possible to see a more detailed number when you click or hover on a line? For example the temperature in my heating room is ca 32.62 degrees C. The scales are from 0-35. I would like to now if the Temperature probe is working correctly , so I need to see the detailed number up to at least one decimal.

Outside Temperature is now 0.7 degrees C, scale is from 0-2.2 which is much better. although it would be nice to show a number when you hover over it , or click on a line.

Another question: is it possible to show the memory usage of vera? see attached picture from datamine

Thanks,
Cor
Title: Re: Free graphs for your temp/power sensors
Post by: tomtcom on March 18, 2019, 06:32:59 pm
...it seems it has something to do with the names I gave it.

So far as I can see from the code, the parameters are not URL-encoded, so spaces and other characters may indeed cause problems.
I thought that too but the commented examples in the lua file seemed to indicate otherwise. I'll change mine back and maybe that's my issue too.

Sent from my VS995 using Tapatalk

Title: Re: Free graphs for your temp/power sensors
Post by: ipstas on March 19, 2019, 01:45:12 am
1st. I apologize, it is still in beta version. So sometimes it doesn't work as expected, sometimes it is slow or just simply doesn't work at all

That said.

2nd. Gauges had a problem for a couple of last days, mostly due to the fact I was trying to set the max automatically and it takes a bit more from the server that I have expected to. So there is a new sheriff in town. If you had gauges before, you might want to save that graph again with new Max for that gauge manually. Just go to your Graphs, select your Gauge, put your Max and click Save. That's it.

3rd. If you have a heavy load on a vera, try to load a new version from https://www.hundredgraphs.com/files/Moniton.lua (https://www.hundredgraphs.com/files/Moniton.lua)
Don't forget to change your Startup lua. And now you could change your collection period to like 600 secs in startup
monitcode = require("Moniton")
monitcode.HGTimer(600)


Again, thanks for your patience, I am working on it to be more stable

Now, for some questions.
- Can there be spaces in a feed name. Hell if I know! :) Never tried, could be another bug. Theoretically yes it can, practically I have to check it.
- Decimals. I was trying to round it and maybe it was not the best way. So for now if you want to see a decimal you can set a gauge and the last 5 reports with the raw numbers will be pulled together with the gauge. All other places are getting rounded numbers for now. I will think a bit more how to make it nicer.
- Negative mins. I am in Fahrenheit zone. So -1C is 31F for me ;) Linear picks the negative mins by itself, but gauge needs a manual input, I will add it later.
- Memory usage. Whatever Vera can report, you can use for a feed. I just don't know really what is the serviceId for that.
- It keeps accepting data even when it is slow (but you might want to change it to 600 secs or so), the best way to see if you have new data incoming is at Feeds
- But it could be that Vera has stopped sending it. Mine did it for some unknown reason. Easy fix is just run that in the Test Luup code (requires at least 3.16.2019 version of lua file):
monitcode = require("Moniton")
monitcode.HGTimer(600)

That will restart the timer again
Title: Re: Free graphs for your temp/power sensors
Post by: Cor on March 19, 2019, 11:13:09 am
I am trying the system memory , but there is no data being pushed out .... anyone has an idea what I do wrong , or how to do it correctly?

The info I found ( also see attachments):
device type: urn:schemas-cd-jackson-com:device:SystemMonitor:1   
variables:
memoryFree
memoryUsed
memoryAvailable

from this I made:
Code: [Select]
{ key='Veramfree', deviceId=16, serviceId="urn:schemas-cd-jackson-com:serviceId:SystemMonitor:1", serviceVar="memoryFree"},
{ key='Veramused', deviceId=16, serviceId="urn:schemas-cd-jackson-com:serviceId:SystemMonitor:1", serviceVar="memoryUsed"},
{ key='Veramavail', deviceId=16, serviceId="urn:schemas-cd-jackson-com:serviceId:SystemMonitor:1", serviceVar="memoryAvailable"},

But no .... it is most likely wrong.

Thanks,
Cor
Title: Re: Free graphs for your temp/power sensors
Post by: ipstas on March 19, 2019, 02:36:53 pm
Do you see something like that in Lua log?

50   03/19/19 12:48:43.100   luup_log:0: [Moniton] Logger:  HGTimer 1 60 <0x7358c520>
50   03/19/19 12:48:43.103   luup_log:0: [Moniton] Logger:  collected vars: 26 <0x7358c520>
50   03/19/19 12:48:43.103   luup_log:0: [Moniton] Logger:  sending data: &debug=false&version=3.16.2019&node=1&json={House:1714.481} <0x7358c520>
50   03/19/19 12:48:43.345   luup_log:0: [Moniton] Logger:  sent data status: 200 <0x7358c520>


If you do, Vera sends it, if you don't the timer has not started
then try this in Test Lua Code
monitcode = require("Moniton")
monitcode.HGTimer(600)


it starts timer
Title: Re: Free graphs for your temp/power sensors
Post by: Cor on March 19, 2019, 04:22:50 pm
@ Ipstas: I am getting data through  from the temperature sensors. The 3 memory are just reporting "0".,

Quote
3/19/2019, 9:16:00 PM Verau 0

Code: [Select]
{ key='Veraf', deviceId=16, serviceId="urn:schemas-cd-jackson-com:serviceId:SystemMonitor:1", serviceVar="memoryFree"},
{ key='Verau', deviceId=16, serviceId="urn:schemas-cd-jackson-com:serviceId:SystemMonitor:1", serviceVar="memoryUsed"},
{ key='Veraa', deviceId=16, serviceId="urn:schemas-cd-jackson-com:serviceId:SystemMonitor:1", serviceVar="memoryAvailable"},

Anyone has an idea what I am doing wrong?
Quote
The info I found :
device type: urn:schemas-cd-jackson-com:device:SystemMonitor:1   
variables:
memoryFree
memoryUsed
memoryAvailable

But how to insert it correctly?

Thanks,
Cor



Title: Re: Free graphs for your temp/power sensors
Post by: ipstas on March 19, 2019, 05:13:54 pm
try to run that on AltUI Test Lua Code

local mem = luup.variable_get('urn:schemas-cd-jackson-com:serviceId:SystemMonitor:1', "memoryAvailable", 16)
print(mem)


If should give you something. Otherwise you might have wrong device id or maybe wrong service id
Title: Re: Free graphs for your temp/power sensors
Post by: dgb on March 19, 2019, 07:39:25 pm
@ Ipstas: I am getting data through  from the temperature sensors. The 3 memory are just reporting "0".,

Quote
3/19/2019, 9:16:00 PM Verau 0

Code: [Select]
{ key='Veraf', deviceId=16, serviceId="urn:schemas-cd-jackson-com:serviceId:SystemMonitor:1", serviceVar="memoryFree"},
{ key='Verau', deviceId=16, serviceId="urn:schemas-cd-jackson-com:serviceId:SystemMonitor:1", serviceVar="memoryUsed"},
{ key='Veraa', deviceId=16, serviceId="urn:schemas-cd-jackson-com:serviceId:SystemMonitor:1", serviceVar="memoryAvailable"},

Anyone has an idea what I am doing wrong?


You have taken the device urn "urn:schemas-cd-jackson-com:device:SystemMonitor:1" , and tried to modify it to be a service id... and you have gotten it wrong.

The correct service id for System Monitor should be "urn:cd-jackson-com:serviceId:SystemMonitor".

The easiest way to get the correct urn for a device variable is to go to the device setup page and select "advanced", then select the "variables" tab, then hover your mouse over the variable you want to use... It will display the correct urn for that variable...
Title: Re: Free graphs for your temp/power sensors
Post by: tomtcom on March 19, 2019, 07:57:00 pm
We talked about spaces in between the key name as that is single quote. How about a variable that has a space in it's name where it is double quotes? I get 0 for value.

{ key='HeatSetpoint', deviceId=116, serviceId="urn:upnp-org:serviceId:TemperatureSetpoint1_Heat", serviceVar="CurrentSetpoint Heat"},
{ key='CoolSetpoint', deviceId=116, serviceId="urn:upnp-org:serviceId:TemperatureSetpoint1_Cool", serviceVar="CurrentSetpoint Cool"}
Title: Re: Free graphs for your temp/power sensors
Post by: ipstas on March 19, 2019, 11:37:36 pm
Variable name is not pushed to HG, which means if Vera can read it, then sure you can push the value from it.

It is only 2 things are pushed: the key and the value, the rest is required only to read internally
Title: Re: Free graphs for your temp/power sensors
Post by: dgb on March 19, 2019, 11:46:51 pm
We talked about spaces in between the key name as that is single quote. How about a variable that has a space in it's name where it is double quotes? I get 0 for value.

{ key='HeatSetpoint', deviceId=116, serviceId="urn:upnp-org:serviceId:TemperatureSetpoint1_Heat", serviceVar="CurrentSetpoint Heat"},
{ key='CoolSetpoint', deviceId=116, serviceId="urn:upnp-org:serviceId:TemperatureSetpoint1_Cool", serviceVar="CurrentSetpoint Cool"}


Spaces are not valid characters in a variable name... The current setpoint variables for all three (general, heat and cool) are all "CurrentSetpoint"... They are differentiated by the service ID, either "urn:upnp-org:serviceId:TemperatureSetpoint1", "urn:upnp-org:serviceId:TemperatureSetpoint1_Heat" or "urn:upnp-org:serviceId:TemperatureSetpoint1_Cool"... The variable names displayed in the device settings uses the space delimited name because the vera code cheats when generating the html for the thermostat devices.

Code: [Select]
{ key='HeatSetpoint', deviceId=116, serviceId="urn:upnp-org:serviceId:TemperatureSetpoint1_Heat", serviceVar="CurrentSetpoint"},
{ key='CoolSetpoint', deviceId=116, serviceId="urn:upnp-org:serviceId:TemperatureSetpoint1_Cool", serviceVar="CurrentSetpoint"}
Title: Re: Free graphs for your temp/power sensors
Post by: Cor on March 20, 2019, 04:04:25 am
@ dgb:


You have taken the device urn "urn:schemas-cd-jackson-com:device:SystemMonitor:1" , and tried to modify it to be a service id... and you have gotten it wrong.

The correct service id for System Monitor should be "urn:cd-jackson-com:serviceId:SystemMonitor".

The easiest way to get the correct urn for a device variable is to go to the device setup page and select "advanced", then select the "variables" tab, then hover your mouse over the variable you want to use... It will display the correct urn for that variable...

Yes , got it , it works now ... many many thanks !

@ ipstas:
Thanks for your hard work! this works much better for me as datamine. when I had a luup restart , it took everytime ca 15-20 minutes for the luup restart to finish, causing half the stuff not working like virtual switches. Now that I have removed the plugin , less than 30 seconds :-)

Still setting up everything I want, I have a problem (see attachment):
-Some graphs are not showing ( I do get feeds every 10 minutes) , made graphs ( tried several times) but the first 3 graphs are not showing, just the titles are showing ( Bath D, Bath up, CPU load).

Some requests:
-Minus Temperatures; ( see "outside"-graph), goes through the graph, but as you said before , this is since you have Fahrenheit. You think it is possible to change this?
-It would be nice if there is a possibility to change the name of a line to a custom name. Now it shows as written in the moniton.lua "key", which doesn't accept spaces and so on. For example I have 10 temperature sensors , in the moniton.lua file I have to give them all a different name. On the graphs it should just say "temperature" for example".
-When you click or hover over a graph the actual number with digits.

Again many thanks for your work ,
Cor
Title: Re: Free graphs for your temp/power sensors
Post by: klimbo on March 20, 2019, 04:45:08 am
hi,
I have adhered to the directions, checked and twofold watched that I have tailed them line by line but i think there is a probleme
any suggestions ? Tutuapp (https://tutuapp.uno/) 9apps (https://9apps.ooo/) Showbox (https://showbox.run/)
Title: Re: Free graphs for your temp/power sensors
Post by: tomtcom on March 20, 2019, 08:38:14 am
We talked about spaces in between the key name as that is single quote. How about a variable that has a space in it's name where it is double quotes? I get 0 for value.

{ key='HeatSetpoint', deviceId=116, serviceId="urn:upnp-org:serviceId:TemperatureSetpoint1_Heat", serviceVar="CurrentSetpoint Heat"},
{ key='CoolSetpoint', deviceId=116, serviceId="urn:upnp-org:serviceId:TemperatureSetpoint1_Cool", serviceVar="CurrentSetpoint Cool"}


Spaces are not valid characters in a variable name... The current setpoint variables for all three (general, heat and cool) are all "CurrentSetpoint"... They are differentiated by the service ID, either "urn:upnp-org:serviceId:TemperatureSetpoint1", "urn:upnp-org:serviceId:TemperatureSetpoint1_Heat" or "urn:upnp-org:serviceId:TemperatureSetpoint1_Cool"... The variable names displayed in the device settings uses the space delimited name because the vera code cheats when generating the html for the thermostat devices.

Code: [Select]
{ key='HeatSetpoint', deviceId=116, serviceId="urn:upnp-org:serviceId:TemperatureSetpoint1_Heat", serviceVar="CurrentSetpoint"},
{ key='CoolSetpoint', deviceId=116, serviceId="urn:upnp-org:serviceId:TemperatureSetpoint1_Cool", serviceVar="CurrentSetpoint"}
Thank you for that. I wouldn't have know. I'll update it.

Sent from my VS995 using Tapatalk

Title: Re: Free graphs for your temp/power sensors
Post by: ipstas on March 20, 2019, 10:21:52 am
About negative numbers. I will try to push an update today

@tomtcom can you make graphs which not working public and give me a link to your dashboard? Also, by any chance do you have 2 or more same feeds used in different graphs?
Title: Re: Free graphs for your temp/power sensors
Post by: ipstas on March 20, 2019, 06:58:40 pm
hi,
I have adhered to the directions, checked and twofold watched that I have tailed them line by line but i think there is a probleme
any suggestions ?

You kinda need a bit more specific. What is not working exactly?
Title: Re: Free graphs for your temp/power sensors
Post by: tomtcom on March 20, 2019, 07:03:59 pm
About negative numbers. I will try to push an update today

@tomtcom can you make graphs which not working public and give me a link to your dashboard? Also, by any chance do you have 2 or more same feeds used in different graphs?
Both graphs are now public. Hopefully you see the lock battery graph doesn't show. It only shows in the graphs tab.

I confirm there are no overlapping values in the two graphs.

I'll fix the variable issue for the temperature graph later.

https://www.hundredgraphs.com/dashboard/tomtcom

Sent from my VS995 using Tapatalk

Title: Re: Free graphs for your temp/power sensors
Post by: ipstas on March 20, 2019, 07:37:40 pm
Both graphs are now public. Hopefully you see the lock battery graph doesn't show. It only shows in the graphs tab.

Great, I ll check it out today, hopefully you will have a fix by tomorrow
Title: Re: Free graphs for your temp/power sensors
Post by: tomtcom on March 20, 2019, 09:04:23 pm
Both graphs are now public. Hopefully you see the lock battery graph doesn't show. It only shows in the graphs tab.

Great, I ll check it out today, hopefully you will have a fix by tomorrow
I was fixing my temperature graph and the graph for lock battery now shows. Not sure if you did something or my messing with the other graph did something.

Sent from my VS995 using Tapatalk

Title: Re: Free graphs for your temp/power sensors
Post by: ipstas on March 20, 2019, 10:04:26 pm
yes, just pushed an update. I think that was the one
Title: Re: Free graphs for your temp/power sensors
Post by: Cor on March 22, 2019, 02:30:10 am
@ Ipstas:  thanks for your work , it is looking much better , I also noticed the negative values with the temperature.!!! great!.

One more thing , I noticed the graph doesn't show decimals. The left side ( for temperatures) does show halves , but the feed is rounded up. Would it be possible to show the actual feed  , or the actual nuber when you click a dot? 
Also the CPU load for that reason doesn't show anything. CPU load is between 0.15 and 1.2 , the graph goes from 0-120 I only get a flat line.
I made those 2 graphs public:
https://www.hundredgraphs.com/dashboard/Corvl (https://www.hundredgraphs.com/dashboard/Corvl)

Cor
Title: Re: Free graphs for your temp/power sensors
Post by: ipstas on March 22, 2019, 10:28:14 am
Rounding or not rounding... it is the question.

New version: numbers on graphs are rounded to 1 decimal
Title: Re: Free graphs for your temp/power sensors
Post by: Cor on March 24, 2019, 05:41:51 am
 :D Awesome.... very very nice!

Thanks,
Cor
Title: Re: Free graphs for your temp/power sensors
Post by: tomtcom on March 24, 2019, 11:39:56 am
Hello ipstas,

1. If Chrome is not in full screen by hitting the maximize button on the desktop, the graphs on the dashboard spill into the settings on the right for D, W, Y and min, max, avg.
2. Hundredgraphs didn't appear to load at all with Internet Explorer on the desktop.

This is Windows 7, Chrome up to date as of today and IE for whatever last updates MS gives us.

Title: Re: Free graphs for your temp/power sensors
Post by: ipstas on March 24, 2019, 02:37:40 pm
Thanks for pointing out for IE, it is fixed (IE must die).
Size: now it is responsive

Again, thanks for your input. It is important to know
Title: Re: Free graphs for your temp/power sensors
Post by: tomtcom on March 24, 2019, 03:58:34 pm
Thanks for pointing out for IE, it is fixed (IE must die).
Size: now it is responsive

Again, thanks for your input. It is important to know
Lol, you're welcome and yes IE must die.

Sent from my VS995 using Tapatalk

Title: Re: Free graphs for your temp/power sensors
Post by: tomtcom on March 24, 2019, 07:18:49 pm
Another question for clarification please.

I have the HG Timer in startup lua for 600. I know as everyone does vera luup engine reloads more than it ever should. Does luup reload not cause the HG Timer to restart?

I ask because after 22 hours my graphs didn't update until I did a vera reboot and then it all kicked in.

If startup lua doesn't run until a reboot then we'll have to build something around it otherwise logging will be constantly missed.

What's your opinion?
Title: Re: Free graphs for your temp/power sensors
Post by: ipstas on March 24, 2019, 07:53:23 pm
yeah, that's bugging me too.
Lua doesn't have any useable interval function. So the only way to make it updating is to call delay function from HGTimer function which will call HGTimer again after the delay. If for any reason delay is screwed up HGTimer will not be called again until lua startup or reboot or user manually run in Lua test window
Code: [Select]
monitcode = require("Moniton")
monitcode.HGTimer(600)

Like Uroboros and sometimes Uroboros has missed its own tail.

I am not sure what would be the best way to go around that, fow now I think I can do push notifications in a browser to let user know feeds are stalled.

Also, I have just updated Moniton.lua, made it a bit more robust, you can try that one