No announcement yet.

Feature/Function of Ocelot plug-in

This topic is closed.
  • Filter
  • Time
  • Show
Clear All
new posts

    Feature/Function of Ocelot plug-in

    I have been using Homeseer to a while and I also have an ADI Ocelot running it's own code. I have only been using Homeseer to monitor the Ocelot variables, but I want to do more on the web. One thing I can't figure out is why the variables are on/off and not an edit box. I use many variables as flags for multiple actions and ON/OFF simply doesn't work. Some variables are static and never change so they should be status only. I cannot find any way to change the functionality to display only or to edit the variable directly from the web interface or within Homeseer directly without doing in in a script. Any assistance would be appreciated.

    First you need to determine if the Ocelot is properly outputting variable data to a device in HomeSeer. Next, you need to check the configuration of the device to see if it is properly setup, and not the equivalent of an appliance module - on/off.
    The easiest way to see if you have a value is to write a small piece of code. This can be done in Notepad.

    <pre class="ip-ubbcode-code-pre">
    ____________________________________________________________ _______________
    Sub Main
    Dim aDev
    aDev = hs.DeviceValue "/3" ' put the house code of your variable here.
    hs.WriteLog "aDev= ", aDev
    end sub
    ____________________________________________________________ _______________

    1. You can copy the code above into a text file.
    2. Save it as OcelotTest.txt in your Scripts directory.
    3. Create an event named Ocelot with a group name of Test
    4. Set the event to run manually.
    5. On the scripts tab, use the listbox to select the script you created above.
    6. Close the new event, then right-click on it and select execute now.
    7. Switch to the log window in HomeSeer, and you should see an entry with the time, the word "aDev" and a value next to it.

    If you see a value you are well on your way.
    Tell us the results of your test. Then we can proceed.




      Once I added ()'s around the housecode the script worked and here are the results:

      1/19/2003 5:55:16 AM~!~Event Trigger~!~External Trigger (Ocelot)
      1/19/2003 5:55:16 AM~!~aDev= ~!~4

      This was the actual value shown in the web and Homeseer status screen and I know for a fact this is the correct value. I modified the script to look at other values and it reported correctly in all cases. What next?


        I know the Ocelot is installed properly within Homeseer, I am using it for I/O only, X-10 is handled with a CM11A. I am running an internal CMax PGM. The ocelot plug-in only allows for ON=1 OFF=0 for ocelot variables. I do not use many variables this way, I need to find out how to eliminate the ON & OFF buttons on variables I have defined as status only, and have an edit box (much like the thermostat setpoint) for variables having other possible values other than 1 or 0. How is this accomplished? Is it even possible?

        Another option would be the ability to assign a value to ON & OFF buttons, like suppose I want ON to be 57 and OFF to be 2. After a year with the ocelot I am finally getting the hang of coding, with the help of people like Guy, so if it needs scripting I will be somewhat hindered. It's hard to learn a new language. I have done some one-line code for events, and modified other peoples scripts, but that's about it.

        Any help would be appreciated!


          I might not be the best person to tell you how to do the web interface, but now that you have an event, you can reconfigure the event to trigger automatically. You can set the event to trigger on a specific value, or even better, to trigger whenever a value change occurs. In the script, you can write code to do something whenever a value hits a certain number.

          <pre class="ip-ubbcode-code-pre">
          if aDev = 14 then dothis

          if aDev &gt; 10 then
          end if

          Or you can setup a case statement:

          <pre class="ip-ubbcode-code-pre">
          Select Case aDev
          Case 1
          do this
          Case 2
          Case 56
          Case 60 to 70
          Case Else
          end Select

          You might want to have several virtual devices where you can keep web based information, like in the hs.DeviceString parameter which would show up on your pages.
          You can create some active elements that you can click on to cause other things to happen. But you will need to create some sort of script, and it can be in the web page or as a script in the Scripts page. But you will need to do scripting either way.

          I don't focus too much of my time on Web interface these days, so if you need more guidance, perhaps one of the other HS web gurus will offer some advice.

          P.S: Sorry about the (). I was writing this at work and forgot to check the syntax. But at least you were able to confirm that your data is available in the device.




            I'm new here as well...

            1st... What's the largest number that may be stored in an Ocelot variable? I think the inputs are all 8 bits (0-255). Is this the same range for variables?

            Is it possible to do bit comparisons by masking with an AND operator...

            IF (aDev & 8'b0010_0000) // is bit #5 set?
            THEN // do something


            - Scott


              Ocelot variables are unsigned 16 bit values, so they run from 0 to 65535

              If you don't know what you're doing... do it neatly.



                What about the other part of my question? Can I test specific bits?

                - Scott

                I don't know what I'm doing... so I do it neatly!

                [This message was edited by Scott Hurst on Thursday, 23 January 2003 at 12:33 PM.]

                [This message was edited by Scott Hurst on Thursday, 23 January 2003 at 12:34 PM.]


                  I know I can monitor variables and cause different actions based on value. I don't really do this, as most of the logic already resides within the CMax code. I know I can use scripts to push values into Ocelot variables, I do this a little, and especially when testing. I have set up most events to work like this: Something happens set a variable, check variable do something else based on value, I have tried to avoid the Something Happened now do Something Else mode. Using variables this way is good for testing and good for status displays. Now the problem is I use many variables as arrays (only 1 row deep) and so a single variable could have many values. If I use the event methodology I would have an event for every possible value I would want to set that particular Ocelot variable to, pretty confusing don't you think?

                  So my question is, repeated from above, can an ocelot variable be displayed as an edit box (much like thermostat setpoint) so any value can be input (between 0 and 65535 as noted above) or can we turn off the input altogether to use it as a status only (this includes the ON/OFF buttons) or change the values inserted with the ON/OFF buttons (certainly not optimal but passable)?

                  [This message was edited by Bud on Saturday, 25 January 2003 at 03:52 PM.]


                    In HS build 1.6.43 there is a new checkbox in the device properties that will allow you to hide the ON/OFF buttons. This was requested a while ago.

                    Note that the variable number is stored in the value property of a device. This means you can set the variable to different values using the device actions tab in an event. On the device actions tab you can drag down a device and set the action to "set value", then enter the value you want to set in the variable.

                    I know this is not exactly what you want, as it sounds like you are looking for any easy way to change variables from the web interface. The only way to set different values from the web is to use the hs.DeviceValuesAdd function. This will assign a name to a value like "5=door open". On the web you then get a drop list of all the values. Selecting one, sets the value. A sample script to set this up looks like:

                    hs.devicevaluesadd "z64", "1" & chr(1) & "15°C" & chr(2) & "15" &chr(1) & "16°C" & chr(2) & "16" & chr(1) & "17°C" & chr(2) & "17" & chr(1) & "18°C" & chr(2) & "18" &chr(1) & "19°C" & chr(2) & "19" & chr(1) & "20°C" & chr(2) & "20" &chr(1) & "21°C" & chr(2) & "21" & chr(1) & "22°C" & chr(2) & "22" &chr(1) & "23°C" & chr(2) & "23", true

                    That script line assigns a range of temperatures to values. I supposes you could create a script statement to assign a name to all the possible values that could be set in a variable, but the interface might be slow since this would be a large list.


                    HomeSeer Technologies LLC
                    💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products


                      I experimented with this line in an event and it works: This gives me most of what I need. I now have the ability to make some STATUS ONLY but since most of the variables have a fixed number of choices this list works. Here is a sample of what I did:
                      <pre class="ip-ubbcode-code-pre">
                      &hs.devicevaluesadd "[14", "In" & chr(2) & "1" & chr(1) & "Out" & chr(2) & "2" & chr(1), true
                      Thanks Rich