Originally posted by slbuck
View Post
Announcement
Collapse
No announcement yet.
How To: weatherXML and PHLocation
Collapse
X
-
I added some more log entries and put .81 in the beta release.
Please run it and post the log entries dealing with PHLocation.--
Jeff Farmer
HS 3, HSPhone
My HS3 Plugins: CFHSExtras, Random, Restart, Tracker, WeatherXML, PanaBluRay
Other Plugins In Use: APCUPSD, BLOnkyo, Device History, EasyTrigger, HSTouch Server, PHLocation2, Pushover, RFXCom, UltraGCIR3, UltraMon3, UltraPioneerAVR3, X10, Z-Wave
Hardware: GoControl Irrigation Controler, Schlage Lever Lock, Schlage Deadbolt, Way2Call Hi-Phone, RFXCom RFXrec433 Receiver, WGL 800, TI-103, Z-Net, Pioneer 1120, Pioneer 1021, Pioneer LX302, Panasonic BDT-110, Panasonic BDT-210 x2
Comment
-
Here's the log from when I initiated the current conditions update. There is no value in the string field for the two ph devices for lat and lon. The device value shows the full lat/lon to 8 decimal places.
Reference ID 1475
Technology Address PHLCLA[1475]BK
Status 29.7xxxxxxx = Dim
Value 29.7xxxxxxx = "29.7xxxxxxx"
String
Reference ID 1476
Technology Address PHLCLO[1476]BK
Status -95.8xxxxxxx = Unknown
Value -95.8xxxxxxx = "-95.8xxxxxxx"
String
Feb-18 00:10:14 weatherXML Download Status: Success
Feb-18 00:10:13 weatherXML Downloading the WU Condition file at http://api.wunderground.com/api/API/...N/q/30,-96.xml.
Feb-18 00:10:13 weatherXML Replacement URL: http://api.wunderground.com/api/API/...N/q/30,-96.xml
Feb-18 00:10:13 weatherXML Downloading file now.
Feb-18 00:10:13 weatherXML Weather Underground Download per minute for WU Condition = 0
Feb-18 00:10:13 weatherXML Download WU Condition: 5
Feb-18 00:10:13 weatherXML Data from Lat/Long
Feb-18 00:10:13 weatherXML Download and Import
Feb-18 00:10:13 weatherXML Reset Hi Low
Feb-18 00:10:13 weatherXML The phlocation Longitude is -96
Feb-18 00:10:13 weatherXML Using PH Longitude device value instead: -96
Feb-18 00:10:13 weatherXML The PH Longitude device string is
Feb-18 00:10:13 weatherXML The phlocation Latitude is 30
Feb-18 00:10:13 weatherXML Using PH Latitude device value instead: 30
Feb-18 00:10:13 weatherXML The PH Latitude device string is
Feb-18 00:10:13 weatherXML The parsed value is 1475
Feb-18 00:10:13 weatherXML The current culture is en-US
Feb-18 00:10:13 weatherXML The phlocation Longitude refID is 1476
Feb-18 00:10:13 weatherXML The phlocation Latitude device refID is 1475
Feb-18 00:10:13 weatherXML wXMLCurrent: Running current location 2
Comment
-
After some research I found that the hs command DeviceValue returns an integer. I thought that had been changed when devices were changed to allow a number with decimal places.
There is a new command DeviceValueEx but it returns an integer as well. I can't find any hs command to get a devices value with decimal places.
It looks like the only way to get the decimal places is from the device string.
I use Backitude and egiGeoZone. PHLocation is setting the device string on my Lat and Lon backitude devices. You might check to see if there is a setting for PHLocation to have it set the device string as well as the value.--
Jeff Farmer
HS 3, HSPhone
My HS3 Plugins: CFHSExtras, Random, Restart, Tracker, WeatherXML, PanaBluRay
Other Plugins In Use: APCUPSD, BLOnkyo, Device History, EasyTrigger, HSTouch Server, PHLocation2, Pushover, RFXCom, UltraGCIR3, UltraMon3, UltraPioneerAVR3, X10, Z-Wave
Hardware: GoControl Irrigation Controler, Schlage Lever Lock, Schlage Deadbolt, Way2Call Hi-Phone, RFXCom RFXrec433 Receiver, WGL 800, TI-103, Z-Net, Pioneer 1120, Pioneer 1021, Pioneer LX302, Panasonic BDT-110, Panasonic BDT-210 x2
Comment
-
Originally posted by CFGuy View PostAfter some research I found that the hs command DeviceValue returns an integer. I thought that had been changed when devices were changed to allow a number with decimal places.
There is a new command DeviceValueEx but it returns an integer as well. I can't find any hs command to get a devices value with decimal places.
It looks like the only way to get the decimal places is from the device string.
I use Backitude and egiGeoZone. PHLocation is setting the device string on my Lat and Lon backitude devices. You might check to see if there is a setting for PHLocation to have it set the device string as well as the value.
I wrote a quick script that gets the device value of the phlocation items and here's what I found:
If the hs.DeviceValue or hs.DeviceValueEx is used and the variable is Dim as an integer, then the returned value is always an integer. When I Dim the variable as a double and use hs.DeviceValue I get an integer, however, if I use hs.DeviceValueEx, then get the full decimal.
Code:Public Sub Main(ByVal DvRef As String) Try Dim DvValInt As Integer = 0 Dim DvValDec As Double = 0 DvValInt = hs.DeviceValue(DvRef) 'Get the Integer Value hs.WriteLog("Test", "Using DvValInt to get Device " & DvRef & " Value as Integer" & DvValInt) DvValInt = hs.DeviceValueEx(DvRef) 'Get the Decimal Value hs.WriteLog("Test", "Using DvValInt to get Device " & DvRef & " Value as Decimal " & DvValInt) DvValDec = hs.DeviceValue(DvRef) 'Get the Integer Value hs.WriteLog("Test", "Using DvValDec to get Device " & DvRef & " Value as Integer" & DvValDec) DvValDec = hs.DeviceValueEx(DvRef) 'Get the Decimal Value hs.WriteLog("Test", "Using DvValDec to get Device " & DvRef & " Value as Decimal " & DvValDec) Catch ex As Exception hs.WriteLog("Error", "Exception in script Test: " & ex.Message) End Try End Sub
Feb-18 14:37:19 Test Using DvValDec to get Device 1475 Value as Integer30
Feb-18 14:37:19 Test Using DvValInt to get Device 1475 Value as Decimal 30
Feb-18 14:37:19 Test Using DvValInt to get Device 1475 Value as Integer30
Feb-18 14:37:19 Event Running script in background: D:/Program Files (x86)/HomeSeer HS3/scripts/Test.vb
Feb-18 14:32:15 Test Using DvValDec to get Device 1476 Value as Decimal -95.8xxxxxxx
Feb-18 14:32:15 Test Using DvValDec to get Device 1476 Value as Integer-96
Feb-18 14:32:15 Test Using DvValInt to get Device 1476 Value as Decimal -96
Feb-18 14:32:15 Test Using DvValInt to get Device 1476 Value as Integer-96
Feb-18 14:32:14 Event Running script in background: D:/Program Files (x86)/HomeSeer HS3/scripts/Test.vb
Comment
-
Very good. I didn't actually test it. I went by the HS script docs.
I'll change weatherXML to use it and post a new version today.--
Jeff Farmer
HS 3, HSPhone
My HS3 Plugins: CFHSExtras, Random, Restart, Tracker, WeatherXML, PanaBluRay
Other Plugins In Use: APCUPSD, BLOnkyo, Device History, EasyTrigger, HSTouch Server, PHLocation2, Pushover, RFXCom, UltraGCIR3, UltraMon3, UltraPioneerAVR3, X10, Z-Wave
Hardware: GoControl Irrigation Controler, Schlage Lever Lock, Schlage Deadbolt, Way2Call Hi-Phone, RFXCom RFXrec433 Receiver, WGL 800, TI-103, Z-Net, Pioneer 1120, Pioneer 1021, Pioneer LX302, Panasonic BDT-110, Panasonic BDT-210 x2
Comment
-
Originally posted by CFGuy View PostVery good. I didn't actually test it. I went by the HS script docs.
I'll change weatherXML to use it and post a new version today.
Sent from my LG-H932 using Tapatalk
Comment
-
Awesome. Thanks for letting me know.--
Jeff Farmer
HS 3, HSPhone
My HS3 Plugins: CFHSExtras, Random, Restart, Tracker, WeatherXML, PanaBluRay
Other Plugins In Use: APCUPSD, BLOnkyo, Device History, EasyTrigger, HSTouch Server, PHLocation2, Pushover, RFXCom, UltraGCIR3, UltraMon3, UltraPioneerAVR3, X10, Z-Wave
Hardware: GoControl Irrigation Controler, Schlage Lever Lock, Schlage Deadbolt, Way2Call Hi-Phone, RFXCom RFXrec433 Receiver, WGL 800, TI-103, Z-Net, Pioneer 1120, Pioneer 1021, Pioneer LX302, Panasonic BDT-110, Panasonic BDT-210 x2
Comment
-
Hi Jeff,
A new release of the PHLocation was just published and runs as a new plugin, not an update to the previous one. Will WeatherXML be updated to allow integration with it? Details on the new one are here: https://forums.homeseer.com/forum/te...-v2-discussion
Thanks
AlHS 4.2.8.0: 2134 Devices 1252 Events
Z-Wave 3.0.10.0: 133 Nodes on one Z-Net
Comment
-
Not sure when I will have time to switch over to the new version.
Does the new version still use devices for Latitude, Longitude and Location City?
If so, it will be easy to add code to check for the new version and use the new values without breaking things for those they may not upgrade right away.
--
Jeff Farmer
HS 3, HSPhone
My HS3 Plugins: CFHSExtras, Random, Restart, Tracker, WeatherXML, PanaBluRay
Other Plugins In Use: APCUPSD, BLOnkyo, Device History, EasyTrigger, HSTouch Server, PHLocation2, Pushover, RFXCom, UltraGCIR3, UltraMon3, UltraPioneerAVR3, X10, Z-Wave
Hardware: GoControl Irrigation Controler, Schlage Lever Lock, Schlage Deadbolt, Way2Call Hi-Phone, RFXCom RFXrec433 Receiver, WGL 800, TI-103, Z-Net, Pioneer 1120, Pioneer 1021, Pioneer LX302, Panasonic BDT-110, Panasonic BDT-210 x2
Comment
-
Originally posted by CFGuy View PostNot sure when I will have time to switch over to the new version.
Does the new version still use devices for Latitude, Longitude and Location City?
If so, it will be easy to add code to check for the new version and use the new values without breaking things for those they may not upgrade right away.
HS4 Pro, 4.2.19.16 Windows 10 pro, Supermicro LP Xeon
Comment
-
EDIT: I forgot to include the advanced tab for Current Town
Here is the latitude advanced tab of the device. Maybe you could filter based upon the interface and device string? The PHlocation 1 plugin just shows an interface of "PHLocation" and device string of PHLC Latitude
Here is the longitude advanced tab of the device string. The PHlocation 1 plugin just shows an interface of " PHLocation " and device string of PHLC Longitude
Here is the current town advanced tab of the device string. The PHlocation 1 plugin just shows an interface of "PHLocation" and device string of PHLC Town
Comment
-
I just needed the interface name. That lets me make a dropdown of all of the devices and the user selects the correct ones for Lat, Lon and City.--
Jeff Farmer
HS 3, HSPhone
My HS3 Plugins: CFHSExtras, Random, Restart, Tracker, WeatherXML, PanaBluRay
Other Plugins In Use: APCUPSD, BLOnkyo, Device History, EasyTrigger, HSTouch Server, PHLocation2, Pushover, RFXCom, UltraGCIR3, UltraMon3, UltraPioneerAVR3, X10, Z-Wave
Hardware: GoControl Irrigation Controler, Schlage Lever Lock, Schlage Deadbolt, Way2Call Hi-Phone, RFXCom RFXrec433 Receiver, WGL 800, TI-103, Z-Net, Pioneer 1120, Pioneer 1021, Pioneer LX302, Panasonic BDT-110, Panasonic BDT-210 x2
Comment
-
Originally posted by CFGuy View PostI just needed the interface name. That lets me make a dropdown of all of the devices and the user selects the correct ones for Lat, Lon and City.HS 4.2.8.0: 2134 Devices 1252 Events
Z-Wave 3.0.10.0: 133 Nodes on one Z-Net
Comment
Comment