Announcement

Collapse
No announcement yet.

UV Index

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

  • UV Index

    Michael,

    I am using the calculate value piece in MCSTemperatures to calculate UV from the HB Light sensor value. Initially I was running an event to calculate the value.

    Is there a way to round off the value in MCSTemperature?
    Attached Files
    Last edited by Pete; June 21st, 2011, 01:56 PM.
    - Pete

    Auto mator
    Homeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU - Mono 6.4X
    Homeseer Zee2 (Lite) - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e - CherryTrail x5-Z8350 BeeLink 4Gb BT3 Pro - Mono 6.4X

    X10, UPB, Zigbee, ZWave and Wifi MQTT automation.

  • #2
    It should allow any scripting function and I think Round(n,d) is format where n is the number and d is the number of digits

    Comment


    • #3
      So I could put:

      Code:
      +Round(A1/23,d)
      in the CALC box in MCSTemperature?
      Attached Files
      - Pete

      Auto mator
      Homeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU - Mono 6.4X
      Homeseer Zee2 (Lite) - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e - CherryTrail x5-Z8350 BeeLink 4Gb BT3 Pro - Mono 6.4X

      X10, UPB, Zigbee, ZWave and Wifi MQTT automation.

      Comment


      • #4
        I tried:

        Code:
        Expression +Round(R34/1.5,1)/+0(37/1.5,1) on line 320 Type mismatch: '[number: 0]'
        and

        Code:
        Expression Round(R34/1.5,1)/0(40/1.5,1) on line 320 Type mismatch: '[number: 0]'
        and

        Code:
        Expression Round((R34/1.5),1)/0((32/1.5)0) on line 320 Expected ')'
        They didn't work. Is my syntax incorrect?

        If I do

        Code:
        +R34/1.5
        works; but I get 4-5 or so decimal places.
        - Pete

        Auto mator
        Homeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU - Mono 6.4X
        Homeseer Zee2 (Lite) - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e - CherryTrail x5-Z8350 BeeLink 4Gb BT3 Pro - Mono 6.4X

        X10, UPB, Zigbee, ZWave and Wifi MQTT automation.

        Comment


        • #5
          Try something like the following. I'm not positive about the syntax of hs.Plugin vs. hs.GetPlugins vs. hs.GetPluginsEx but one of them should work. The GetDeviceNumber is a mcsTemperature function to get the value from DeviceString after stripping HTML tags and if the result is null then it gets the number from the DeviceValue

          0+Round(hs.Plugin("mcsTemperature").GetDeviceNumber("R34")/1.5),1)

          You want to start the expression with a number and then it lets you use free-form scripting. There are some shortcuts such as what you started with, but these dont give you the formatting you want with the Round function.

          Comment


          • #6
            Still getting a syntax error; tried all three.

            Code:
            6/21/2011 10:59:08 PM  mcsTemperature  Expression 0+Round(hs.Plugin(mcsTemperature).GetDeviceNumber(R34)/1.5),1)/ on line 70 Syntax error 
            6/21/2011 11:02:18 PM  mcsTemperature  Expression 0+Round(hs.GetPlugins(mcsTemperature).GetDeviceNumber(R34)/1.5),1)/ on line 70 Syntax error 
            6/21/2011 11:05:08 PM  mcsTemperature  Expression 0+Round(hs.GetPlugins(mcsTemperature).GetDeviceNumber(R34)/1.5),1)/ on line 70 Syntax error
            - Pete

            Auto mator
            Homeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU - Mono 6.4X
            Homeseer Zee2 (Lite) - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e - CherryTrail x5-Z8350 BeeLink 4Gb BT3 Pro - Mono 6.4X

            X10, UPB, Zigbee, ZWave and Wifi MQTT automation.

            Comment


            • #7
              You need quotes around mcsTemperature. You can try a similiar thing from a manual event to get the syntax HS expects when referencing a plugin from a script. I have found this to change over time with different versions of HS.

              Comment


              • #8
                Hello Michael,

                It seemed that the logging was removing the quotes. I tried all three ways again with the same error.

                I am also testing the same running a script every 10 minutes or so; with more basic syntax.

                It works without showing the icon which isn't an issue and really that's all I need.

                So far looking and just comparing the values to both the EPA and Weather dot com and they are just about on the mark.

                I have two of the combo humidity/temp/light sensors outside. The light values for one of the two seem to be providing good numbers.
                Last edited by Pete; June 23rd, 2011, 06:17 AM.
                - Pete

                Auto mator
                Homeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU - Mono 6.4X
                Homeseer Zee2 (Lite) - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e - CherryTrail x5-Z8350 BeeLink 4Gb BT3 Pro - Mono 6.4X

                X10, UPB, Zigbee, ZWave and Wifi MQTT automation.

                Comment


                • #9
                  I gave it a try and see the issue. The script evaluation does not contain the context of HS so hs.Plugin is unknown. The internal evaluation that uses the shorthand device code annotation does not have a parser for other functions such as Round. I may or may not have a solution. I will look at it a little.

                  Comment


                  • #10
                    Sorry to bud in on this thread, but is there a script out there just for UV Index? From what I see this is part of a complete weather/tempearture script.

                    Thanks
                    Bernie

                    Comment


                    • #11
                      I believe Pete is getting his UV from mcsSprinklers and using the EPA option as the UV sensor source.

                      Comment


                      • #12
                        Michael,

                        I went to using the syntax you provided in a script and changed the way it was getting the number; so its really two variables. I take the number that I create in the formula from MCSTemperature (sans the rounding) with the numbers going to the 5-6 decimal point and the script just rounds it off to a positive integer. Works.

                        I'm kind of testing the UV from Homeseer by using the Hobbyboards light sensor with a formula; it seems to be providing a good number. The number is closer to the Weather dot com number versus the EPA number. Not utilizing those yet for anything; just watching them along with my "solar sensor in a jar" device. I put them both on the HSTouch screen weather page so I could watch them.

                        Thank you Michael. If I get the round function working in the MCSTemperature construct then I don't really need the script to be running. It'll just be one variable constructed in the "construct" of the MCSTemperature variable page setting.

                        Today UV variable (0 to 16) is still from mcsSprinklers and the EPA variable as Mike mentions above. It is though a one next day "predicted" value versus the weather dot com adjusted all day variable. I think though the actual light value from the HB sensor is more "live" since it is in my back yard. I've been looking at the numbers generated from the HB light sensor and they are always the same changing with the clouds, bright sun or sunset. With the rounded value and formula I'm getting a value from 0 (zero) to 16. Sunny its around 8-9 mostly.

                        I'm also reconstructing my solar jar. I'm using a small with a plastic cap jar. I am getting good numbers from it. I did notice though that I got some water inside of what I though was an air tight seal. What I did though is glue the apparatus on the top of a 2.5" PVC pipe and put some gravel in it to weigh it down some; glueing a plastic lid on it. I think though the gravel was somewhat too humid and my jar wasn't air tight enough. So I'm building another one, making this one more air tight.

                        The attached picture is a clip from a HSTouch page. The left value is from the EPA and the right value is the contructed one from the HB light sensor.
                        Attached Files
                        Last edited by Pete; June 26th, 2011, 02:46 PM.
                        - Pete

                        Auto mator
                        Homeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU - Mono 6.4X
                        Homeseer Zee2 (Lite) - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e - CherryTrail x5-Z8350 BeeLink 4Gb BT3 Pro - Mono 6.4X

                        X10, UPB, Zigbee, ZWave and Wifi MQTT automation.

                        Comment


                        • #13
                          I do agree with your analysis of the UV source. The more real-time the better. mcsSprinklers uses it hourly and it also caps the UV at 10 so values above it will not result in any higher ET values. I just do not have any data to correlate UV over 10 with ET.

                          Comment


                          • #14
                            Today the highest it went was 11 but typically its at 10 or below which corresponds to the weather dot com site. I just set the "new" solar jar outside.

                            This time I used a cork to seal the temperature sensor to the top of a short piece of PVC pipe inside of the jar which is glued to the inside part of the lid of the jar. The outside part of the lid of the jar is glued to a larger maybe 2" piece of PVC with the wire coming out of the side of the apparatus. I will take a picture of it.

                            I then sealed the thin wire in two places out of the bottom piece of PVC which is glued with PVC pipe glue to the lid of the jar. I then put weights inside of the larger PVC and seal a lid to it again with PVC pipe. While still a bit fragile it should be OK outside.
                            Attached Files
                            Last edited by Pete; June 26th, 2011, 05:44 PM.
                            - Pete

                            Auto mator
                            Homeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU - Mono 6.4X
                            Homeseer Zee2 (Lite) - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e - CherryTrail x5-Z8350 BeeLink 4Gb BT3 Pro - Mono 6.4X

                            X10, UPB, Zigbee, ZWave and Wifi MQTT automation.

                            Comment


                            • #15
                              Looks like a very good construction approach. In my case I have it mounted on the same mast and above the AAG wind instrument. That minimized the amount of new 1-wire cabling needed.

                              Comment

                              Working...
                              X