Announcement

Collapse
No announcement yet.

Revised XML Based Weather Script

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    Can you provide me with the Long Date format your PC is using. This can be found in the Regional Settings Control Panel Applet. I will have a look at it and see if I can fix it.

    Rupp
    Not sure about the update interval, it appears to be around and hour, give or take.

    Comment


      #17
      Rick, they are the default Windows settings for United Kingdom. Here's a grab...


      Thanks!

      ~David

      Comment


        #18
        The degree symbol needs to be replaced. See the problem it's causing here.


        Paul

        Comment


          #19
          The new version is posted.

          Comment


            #20
            I am missing something I know, but how can I use the readings in other scripts? Are they being stored as variables, or do I have to do that first? I tryed to find something in the script but I can't locate it.

            Thanks

            Comment


              #21
              The data is stored in each devices devicestring property. Just do a

              s=hs.DeviceString("W1")

              on each device you want the data on.

              Comment


                #22
                and it doesn't work the way I would like.

                s=hs.DeviceString("w2")
                if s < 25 then
                hs.ExecX10 "w23","on",0,0
                else hs.ExecX10 "w23","off"

                I didn't really think it would because I thought I would have to have something like:

                hs.SetDeviceValue("q21"),hs.DeviceString("w2")
                and then substitute 'w21' for 's' in above that didn't work either. I would apprecaite any help with this.

                BTW, the above "works" because w23 is being turned on, but the temp "w2" is only 30 when I tried this.

                Thanks

                Comment


                  #23
                  Try this :
                  <pre class="ip-ubbcode-code-pre">
                  s=hs.DeviceString("w2")
                  if cint(s) &lt; 25 then
                  hs.ExecX10 "w23","on",0,0
                  else hs.ExecX10 "w23","off"
                  </pre>

                  Note: I added cint(s)

                  -Rupp
                  ...it was a holy night.
                  💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

                  Comment


                    #24
                    Just loaded this morning. This is the weather script I'll be using now. Thanx for posting. Worked out of the box. Minor suggestion: You can remove the Caution warning now that states that settings.ini will be written to.

                    Comment


                      #25
                      I tried your change and it didn't make a difference, the point still turned on even though it shouldn't have. I am using this data to turn on or off two different point depending on whether or not the temp is above or below a certain value. Here is the whole part I have added to the script so you can get the whole picture.

                      s=hs.DeviceString("w2")
                      if cint(s) &lt; 25 then
                      hs.ExecX10 "w23","on",0,0
                      else hs.ExecX10 "w23","off"


                      end if

                      s=hs.DeviceString("w2")
                      If cint(s) &gt; 85 then
                      hs.ExecX10 "w24","on",0,0
                      else hs.ExecX10 "w24","off"


                      end if

                      When I ran the script with this added HS turned both "w23" and "w24" "on" even though the temp was 35. Any idea why?

                      Thanks again.

                      Comment


                        #26
                        You'll need to strip it out. A better option would be for Rick's script to store the temperature in the DeviceValue as well as DeviceString. Then events could be triggered based on the temperature. But... I'm not sure if the DeviceValue can hold negative values.

                        adding:

                        hs.SetDeviceValue DEVCODE_CURTEMP, Tempc

                        between:

                        hs.SetDeviceString DEVCODE_CURTEMP, "&lt;img align=""absmiddle"" src=""" & WeatherIconDirectory & "temperature.gif""&gt;&nbsp;" & GetTempDeviceString(usemetric, Temperature, Tempc, "html") & "&lt;/td&gt;"

                        and:

                        hs.SetDeviceLastChange DEVCODE_CURTEMP, now

                        in Rick's script should allow you to use:

                        s=hs.DeviceValue("w2")
                        if s &lt; 25 then
                        hs.ExecX10 "w23","on",0,0
                        else hs.ExecX10 "w23","off"

                        in your script.


                        Paul

                        Comment


                          #27
                          This might be a whole lot easier...

                          I left all Rick's W1 thru w11 devices alone and simply added this to my script, since I only want a temp value in my string for logic analysis:

                          hs.SetDeviceString"v3",Temperature

                          then, just use v3 instead of w3 for your logic. This accomodates negative temps too. Besides, Ultraview didn't use to like any html code in the device strings (maybe it's allowed now) so I use v3 there instead too.

                          ---------------------------------
                          Rick Fox
                          You wouldn't happen to have a weather.asp created already that goes with your script, would you?

                          [This message was edited by Ameridan on Friday, 13 December 2002 at 07:44 PM.]

                          Comment


                            #28
                            That did the trick.

                            Comment


                              #29
                              As soon as save_state script saves to XML file, then that file as well as Ultraview2 XML file become corrupted with the image source html data that this script uses to display the hyperactive thermometer, condition icon, forecast.gif, etc.

                              Apparently Rick only uses the status page to display the weather devices. In case anyone else runs into this, my changes to the script to keep peace and harmony on my Homeseer server are in the next post.

                              [This message was edited by Ameridan on Saturday, 14 December 2002 at 01:05 AM.]

                              Comment


                                #30
                                In reference to the previous post, I'm not tearing up Rick's script, it's great! This is only in case it might help others in the same boat I'm in.
                                Attached Files

                                Comment

                                Working...
                                X