Announcement

Collapse
No announcement yet.

HS Startup timing...

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

    HS Startup timing...

    Michael, I need to use the DeviceString value of a Temp08/mcsTemperature sensor in some HS startup processing. I notice in my log at startup the following:
    10/1/2007 5:11:02 PM ~!~mcsTemperature~!~Last temperature sample recorded at 10/1/2007 5:09:34 PM

    Right after that I get:
    10/1/2007 5:11:07 PM ~!~Startup~!~Scripting is OK

    indicating the startup.txt script has started its processing. If I try to use the DeviceString value at that time, am I going to be looking at the "current" sensor reading or the last value prior to shutting down HS?

    I guess what I'm hoping is that mcsTemperature will read the current value and make it available during its startup initialization, but it looks like it comes from the dB, saved prior to HS shutdown. If that is the case, what would be the best way to wait until mcsTemperature has had a chance to update the device value after startup to ensure it is current?

    Thanks
    Gary

    #2
    mcsTemperature collects data at a fixed interval or accepts data whenever it is fed from the external source. The device string will show the last value that it has received at the time of shutdown and will be the value restored by Homeseer during startup. I would expect this value to exist before any startup scripts or plugins are invoked, but I'm not positive.

    When the first mcsTemperature sensor is updated is based upon the sensor and its interface. Generally it will start at cycle as part of its initialization and this will take as long as it takes to poll each sensor on the interface. For externally sourced such as xAP sensors then mcsTemperature does nothing to get current data, but it would be a good practice if you have a startup event that isses a BSC.Query messages to the external interfaces so the current readings can be imported into Homeseer and the database.

    Your likely easiest way to do what you want is to have a fixed wait where the duration is determined by looking at the debug output and see how long it is before the last sensor in the polling sequence is read. Give some margin for system variability.

    Comment


      #3
      Thanks for the explanation Michael. That helps. In rethinking this situation, its actually hard to know which is better. Do nothing at startup and let the new readings by mcsTemp auto correct or use startup code to ensure all dependent device settings are right at startup even though they will be based on temp readings effective at the prior shutdown. In most respects it works out to be the same thing either way. However in my case I have some fan settings based on whether or not my thermostat reports an AC Cooling call or not, so I guess I have to do something at startup. In any case it helps knowing what to expect.

      Gary

      Comment

      Working...
      X