Originally posted by vasrc
Announcement
Collapse
No announcement yet.
Propane Monitoring
Collapse
X
-
Originally posted by vasrcJust create an Event that runs once a day (or as often as you want an update) and have it run this script. You'll need to create two HS3 devices. One for Tank Level (range 1-100, % suffix, 2 dec places) and one for Tank Status (0-Off/100-On).
Enter the two HS3 virtual devices in the script along with the Tank Utility User and Password.
Change TankUtility.txt to TankUtility.vb and place in your scripts directory.
Z
Code:Compiling script C:\Program Files\HomeSeer HS3\scripts\TankUtility.vb: Type 'JavaScriptSerializer' is not defined. Compiling script C:\Program Files\HomeSeer HS3\scripts\TankUtility.vb: Namespace or type specified in the Imports 'System.Web.Extensions' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases.
Comment
-
Originally posted by macrho View PostHaving a compilation error and so far my google search skills aren't helping me:
Code:Compiling script C:\Program Files\HomeSeer HS3\scripts\TankUtility.vb: Type 'JavaScriptSerializer' is not defined. Compiling script C:\Program Files\HomeSeer HS3\scripts\TankUtility.vb: Namespace or type specified in the Imports 'System.Web.Extensions' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases.
Windows or Linux HS3 platform?
You need System.Web.Extensions.dll in the bin/scripting directory.
Z
Comment
-
I'm on Windows 7 embedded. This is in my settings.ini file:
ScriptingReferences=System.Drawing;System.Drawing.dll;System .Web.Script.Serialization;System.Web.Extensions.dll
I dropped the dll here: C:\Program Files\HomeSeer HS3\Bin and copied it from: C:\Windows\Microsoft.NET\Framework\v4.0.30319
am still having errors:
Compiling script C:\Program Files\HomeSeer HS3\scripts\TankUtility.vb: Namespace or type specified in the Imports 'System.Core' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases
I restarted HS3 too
Comment
-
Originally posted by macrho View PostI'm on Windows 7 embedded. This is in my settings.ini file:
ScriptingReferences=System.Drawing;System.Drawing.dll;System .Web.Script.Serialization;System.Web.Extensions.dll
I dropped the dll here: C:\Program Files\HomeSeer HS3\Bin and copied it from: C:\Windows\Microsoft.NET\Framework\v4.0.30319
am still having errors:
Compiling script C:\Program Files\HomeSeer HS3\scripts\TankUtility.vb: Namespace or type specified in the Imports 'System.Core' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases
I restarted HS3 too
ScriptingReferences=System.Web.Script;System.Web.Extensions. dll
System.Web.Extensions.dll is located in:
/bin/scripting/
Z
Comment
-
Ok, I have now:
ScriptingReferences=System.Drawing;System.Drawing.dll;System .Web.Script;System.Web.Extensions.dll
System.Web.Extensions.dll located in: C:\Program Files\HomeSeer HS3\Bin\scripting
I only edited the lines noted in your VB file and it still throws error after restarting hs3:
Code:Error Compiling script C:\Program Files\HomeSeer HS3\scripts\TankUtility.vb: Type 'JavaScriptSerializer' is not defined. Error Compiling script C:\Program Files\HomeSeer HS3\scripts\TankUtility.vb: Type 'JavaScriptSerializer' is not defined. Error Compiling script C:\Program Files\HomeSeer HS3\scripts\TankUtility.vb: Type 'JavaScriptSerializer' is not defined. Dec-30 4:04:14 PM Error Compiling script C:\Program Files\HomeSeer HS3\scripts\TankUtility.vb: Namespace or type specified in the Imports 'System.Web.Script.Serialization' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases. Error Compiling script C:\Program Files\HomeSeer HS3\scripts\TankUtility.vb: Namespace or type specified in the Imports 'System.Core' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases.
Comment
-
Originally posted by macrho View PostOk, I have now:
ScriptingReferences=System.Drawing;System.Drawing.dll;System .Web.Script;System.Web.Extensions.dll
System.Web.Extensions.dll located in: C:\Program Files\HomeSeer HS3\Bin\scripting
I only edited the lines noted in your VB file and it still throws error after restarting hs3:
Code:Error Compiling script C:\Program Files\HomeSeer HS3\scripts\TankUtility.vb: Type 'JavaScriptSerializer' is not defined. Error Compiling script C:\Program Files\HomeSeer HS3\scripts\TankUtility.vb: Type 'JavaScriptSerializer' is not defined. Error Compiling script C:\Program Files\HomeSeer HS3\scripts\TankUtility.vb: Type 'JavaScriptSerializer' is not defined. Dec-30 4:04:14 PM Error Compiling script C:\Program Files\HomeSeer HS3\scripts\TankUtility.vb: Namespace or type specified in the Imports 'System.Web.Script.Serialization' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases. Error Compiling script C:\Program Files\HomeSeer HS3\scripts\TankUtility.vb: Namespace or type specified in the Imports 'System.Core' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases.
ScriptingReferences=System.Drawing;System.Drawing.dll,System .Web.Script;System.Web.Extensions.dll
Comment
-
Originally posted by vasrc View PostPut a comma in between the two entries:
ScriptingReferences=System.Drawing;System.Drawing.dll,System .Web.Script;System.Web.Extensions.dll
Happy New Year
Comment
-
Interesting. I will post the one I wrote. I assumed the device and token won't change-- so mine makes the one JSON call to tank utility, but you have to get your token and device number.
The line below would need to be updated....
'Change 012345 with your device number
'Chance abcdef.ghijkl.mnop-qrst-uvwyz with your token
Dim Query As String = hs.GETURL("https://data.tankutility.com/api/devices/012345?token=abcdef.mnop.qrst-uvwyz","",False,80)
The procedure here would need to be followed to obtain the token and the device number...
http://apidocs.tankutility.com/#introduction
Mine will create the devices at the Room and device Letter..
It will also show you how much is in the tank and how many days you can expect to last using the same amount as the previous day... I will probably change that to use a moving average.
I posted a picture of the devices in the room it creates...
I'll have to try to load this other script....HS3 Pro Edition 3.0.0.435 (Windows Server 8.1 on ESXi box)
Plug-Ins Enabled:
Z-Wave:,RaspberryIO:,AirplaySpeak:,Ecobee:,
weatherXML:,JowiHue:,APCUPSD:,PHLocation:,Chromecast:,EasyTr igger:
Comment
-
Turns out that I was using the wrong device number, I was using the ID. Once I got a token, I was able to get my device number:
https://data.tankutility.com/api/dev...OUR_TOKEN_HERE
Jon00 has a device grouping utility so that all the fields can be grouped in one logical container
Comment
-
Originally posted by wpiman View PostInteresting. I will post the one I wrote. I assumed the device and token won't change-- so mine makes the one JSON call to tank utility, but you have to get your token and device number.
The line below would need to be updated....
'Change 012345 with your device number
'Chance abcdef.ghijkl.mnop-qrst-uvwyz with your token
Dim Query As String = hs.GETURL("https://data.tankutility.com/api/devices/012345?token=abcdef.mnop.qrst-uvwyz","",False,80)
The procedure here would need to be followed to obtain the token and the device number...
http://apidocs.tankutility.com/#introduction
Mine will create the devices at the Room and device Letter..
It will also show you how much is in the tank and how many days you can expect to last using the same amount as the previous day... I will probably change that to use a moving average.
I posted a picture of the devices in the room it creates...
I'll have to try to load this other script....
Nice work !
Z
Comment
Comment