Announcement

Collapse
No announcement yet.

What triggers ultraview2_common.txt?

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

  • What triggers ultraview2_common.txt?

    I know that in HS1, we had to have an event that triggered any time any device changed to any status. I currently have no devices configured and every device change is triggering the execution of the script. If I was to define devices to UltraStatus, would it only trigger the script when the defined devices are triggered? I'm trying to figure the fastest way to use multiple device types per housecode. Currently, I have edited the ultraview2_common.txt to create the correct icon, but I was wondering if it would be faster to set up events to "mirror" devices and then define them in UltraStatus. Currently, about 1/2 of my devices can be ignored by UltraView but, on the other hand, about 90% of the devices I use would have to be mirrored (I put a "dimbar" next to most lights).

    Thanks,
    Rog
    Attached Files

  • #2
    Originally posted by crypto1701
    I know that in HS1, we had to have an event that triggered any time any device changed to any status. I currently have no devices configured and every device change is triggering the execution of the script. If I was to define devices to UltraStatus, would it only trigger the script when the defined devices are triggered?
    utraview2_common.txt is a client side script that only runs in a browser. The script contains common functions used by UltraView and UltraView Status.

    There is a timer that runs on the browser that first determines if any devices changed status. Via Synchronous VBScript and XML (SVAX) (similar to AJAX), the client browser requests /status?pg=xml_status to determine if any devices changed status since the timer last triggered. If devices have changed status, the client browser requests /status?pg=xml_devices, then iterates over the list of HomeSeer devices and calls functions within ultraview2.txt and ultraview2_common.txt

    I'm trying to figure the fastest way to use multiple device types per housecode. Currently, I have edited the ultraview2_common.txt to create the correct icon, but I was wondering if it would be faster to set up events to "mirror" devices and then define them in UltraStatus. Currently, about 1/2 of my devices can be ignored by UltraView but, on the other hand, about 90% of the devices I use would have to be mirrored (I put a "dimbar" next to most lights).
    I think your approach is fine. You can add logic in that script that takes action based on the device type (in addition to the device string). Processing should finish within a few milliseconds (depending on the number of devices you have defined). Just remember to back up this script before installing HSPI UltraStatus updates via the HomeSeer updater.

    Regards,
    Ultrajones
    Plug-ins: UltraMon, UltraM1G, UltraCID, Ultra1Wire, UltraLog, UltraWeatherBug, UltraPioneerAVR, UltraGCIR

    Comment


    • #3
      Yeah, I know about the status check.. I was the one that sent you that code. I'm more interested in what trigger the server to change the status.. is it any device changing to any code (similar to the old event we had to create)? It would be nice to only trigger on codes that were actually used on the floorplan. If I entered devices into UltraStatus, would it only be triggered by those devices?

      With the way I'm doing it, every trigger is causing a web server error:

      Web Server Error 404, cannot serve file: C:\Program Files\HomeSeer 2\html/images/HomeSeer/

      I assume this is because I do not have anything setup in UltraStatus.. I'm just wondering how much (if any.. I turned off web server error logging) these errors are slowing me down.

      There are quite a few devices that I added to the script.. 25 so far. I just can't figure a better way to do what I need. One example is that I have 6 devices on the same house code using 2 icons, lamps and dimbars. I would think that having HS trigger 11 devices when 1 was triggered would be extremely slow.

      Would it be worth going hybred and entering the single-device-per-housecode devices into UltraStatus and the multiples in the script? Right now, they're all in the script just to keep it all together.

      It would be nice to have the ability to do what I'm doing in UltraStatus and have UltraStatus only trigger when a defined device changes states.

      Comments? Suggestions?

      As always, thanks,
      Rog

      Comment


      • #4
        Originally posted by crypto1701
        Yeah, I know about the status check.. I was the one that sent you that code.
        Huh?

        I'm more interested in what trigger the server to change the status.. is it any device changing to any code (similar to the old event we had to create)? It would be nice to only trigger on codes that were actually used on the floorplan.
        Any X10 device that changes status causes the "last updated" date to be updated. I hesitate adding the requested option because the XML generated by Ultra Status HSPI is not just used by the floor plan.

        [QUOTE]If I entered devices into UltraStatus, would it only be triggered by those devices?
        No.

        With the way I'm doing it, every trigger is causing a web server error:

        Web Server Error 404, cannot serve file: C:\Program Files\HomeSeer 2\html/images/HomeSeer/

        I assume this is because I do not have anything setup in UltraStatus.. I'm just wondering how much (if any.. I turned off web server error logging) these errors are slowing me down.[/color]
        I am not sure what changes you added to ultraview2.txt, but returning an empy icon string would cause that error.

        There are quite a few devices that I added to the script.. 25 so far. I just can't figure a better way to do what I need. One example is that I have 6 devices on the same house code using 2 icons, lamps and dimbars. I would think that having HS trigger 11 devices when 1 was triggered would be extremely slow.

        Would it be worth going hybred and entering the single-device-per-housecode devices into UltraStatus and the multiples in the script? Right now, they're all in the script just to keep it all together.

        It would be nice to have the ability to do what I'm doing in UltraStatus and have UltraStatus only trigger when a defined device changes states.

        Comments? Suggestions?
        Do you have any screenshots of what you are attempting to do?

        Regards,
        Ultrajones
        Plug-ins: UltraMon, UltraM1G, UltraCID, Ultra1Wire, UltraLog, UltraWeatherBug, UltraPioneerAVR, UltraGCIR

        Comment


        • #5
          Originally posted by Ultrajones
          Do you have any screenshots of what you are attempting to do?
          I attached a screenshot. See the green bars next to the lights? They work like vu sound meters.. the brighter the light, the higher the bar lights up. So everywhere there's a dimbar, it is on the same housecode as the icon next to it. In the bedroom closet, the light and the motion sensor that you see on the wall are on the same housecode.

          I am not sure what changes you added to ultraview2.txt, but returning an empy icon string would cause that error.
          My changes are in ultravie2_common.txt and are inserted right after the "RCS TX15B Thermostat" End If and take this type of form:

          case "Lamp Module"
          arrStatus(ICON) = "lampdim" & FormatNumber(iDevDim/10, 0) & ".gif"
          arrStatus(DEVSTR)= FormatNumber(iDevDim, 0) & "%"

          or even

          case "Kitchen Light"
          'Ensure images are identical to how HomeSeer Web Control works
          select Case CInt(iDevStatus)
          case 2 'Device status is ON
          if arrStatus(DEVSTR)= "" then
          arrStatus(DEVSTR)= "On"
          arrStatus(ICON) = "KitchenOn.gif"
          else
          arrStatus(ICON) = BuildIcon(arrStatus(DEVSTR))
          end if
          case 3 'Device status is OFF
          if arrStatus(DEVSTR)= "" then
          arrStatus(DEVSTR)= "Off"
          arrStatus(ICON) = "KitchenOff.gif"
          else
          arrStatus(ICON) = BuildIcon(arrStatus(DEVSTR))
          end if
          case else
          arrStatus(DEVSTR)= "Unknown"
          arrStatus(ICON) = "unknown.gif"
          end select

          Since I add at least a .gif in there, I was wondering if the blanks were coming out because I have absolutely nothing configured through the UltraStatus screens.

          Any X10 device that changes status causes the "last updated" date to be updated. I hesitate adding the requested option because the XML generated by Ultra Status HSPI is not just used by the floor plan.
          Perhaps triggering only on devices that are configured in UltraStatus? I have at least 4 times as many devices as you can see here, so I spend alot of time triggering on hidden devices (timers, status flags and such). And (I think) because of my bloating of the ultraview2_common.txt script to handle the multiple devices per housecode, the updates ("getting data") are now taking around three seconds (HS2 on a dual-processor 733 over a gigabit network).

          Thanks,
          Rog
          Attached Files
          Last edited by crypto1701; May 11th, 2006, 11:11 PM.

          Comment


          • #6
            That is what you wanted

            Isn't it?

            Are you doing a trigger every time an X10 command comes in or any time a device changes status?

            Thanks again,
            Rog

            Comment


            • #7
              HomeSeer notifies the HSPI UltraStatus plug-in via the HSEvent callback. The event callback that is currently used is the EV_TYPE_STATUS_CHANGE. This triggers any time a device within HomeSeer changes status.

              Are you looking to have the LastUpdated property only get updated when the HSPI UltraStatus Plug-in updates a device string? If so, I think I can add an option for that.

              Here is what we have to work with:

              EV_TYPE_X10: X10 received event
              EV_TYPE_STATUS_CHANGE: A device changed status
              EV_TYPE_STRING_CHANGE : Device's string value has changed

              HomeSeer also only sends the unit/house code of the device that changed status. As far as I know, there is no command within HomeSeer to get all the devices assigned to a House / Unit code. That means I would have to iterate over every HomeSeer device to find them. For performance reasons, I try to keep processing to a minimum.

              If you have ideas, I am willing to try them out...

              Regards,
              Ultrajones
              Plug-ins: UltraMon, UltraM1G, UltraCID, Ultra1Wire, UltraLog, UltraWeatherBug, UltraPioneerAVR, UltraGCIR

              Comment

              Working...
              X