Announcement

Collapse
No announcement yet.

Need Outside Temp to set Humidity

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

    Need Outside Temp to set Humidity

    I've gone over SEVERAL posts on the board...
    Found scripts that others have been nice enough to post as examples, but have been broken in HS2 (ex. set and let no longer supported). I'm not a programmer; however, I do try to make sense of what others have done. So, your help is appreciated

    I've managed to get the following working without errors in the log as a .txt file.

    sub main()
    dim rcs
    set rcs=hs.plugin("RCS Serial Thermostats")
    dim temp1
    temp1=rcs.GetTemp(1,0)
    end sub

    The goal here is to pull the outside temp from my RCS Thermostat. This information is already displayed on the status page via my RCS Thermostat; however, when setting up an event I don't see any option to allow trigger or condition using the outside reading... maybe an oversight in the plugin.

    Having read the other posts I assumed the outside temp was at (1,0).

    Once I have the temp where I can include it in events I can then include information from my Z-wave indoor humidity sensor to trigger an outlet that controls our HVAC humidifier and also trigger the HVAC fan via the RCS Thermostat.

    I've already attempted to include the above script in a recurring 30 min event; however, I don't see any results that I can trigger off of. I've run the event, screen refreshes, and the log includes:
    12/16/2009 11:52:28 PM Event Event Trigger "OutsideTemp"
    12/16/2009 11:52:28 PM Event Running script in background: OutsideTemp.txt

    I'm not sure if I'm doing this correct or not. I've read several posts were the responder assumes we all understand what they are thinking or maybe there is alot of offline stuff going on that is not posted. :: shrug ::
    However, there seems to be several good ideas posted but no documentation to the solution or to help prevent all the multiple posts for the same type of question(s). Such as, how to setup a virtual device and have it populated with information from this script? (In laymen's terms... need to crawl, before I walk)

    The logic I'm looking to include via script or by using the events is similar to below chart.

    If anybody can help it is appreciated... I am trying.

    Thanks,
    Chad

    =============

    humidity <= 15 (0...15000) AND
    Outdoor <= -20 (-2500...-2000) OR
    humidity <= 20 (0...2000) AND
    Outdoor <= -10 (-1900...-1000) OR
    humidity <= 25 (0...2500) AND
    Outdoor -9 < 9 (-900...900) OR
    humidity <= 30 (0...3000) AND
    Outdoor 10 < 19 (1000...1900) OR
    humidity <= 35 (0...3500) AND
    Outdoor 20 < 29 (2000...2900) OR
    humidity <= 40 (0...4000) AND
    Outdoor 30 < 50 (3000...5000)

    Turn Humidifier switch ON
    Turn HVAC Outside Air Damper/Vent OFF
    Turn HVAC Fan ON

    =================
    OutdoorTemp InDoor Humidity
    -20 15
    -10 20
    0 25
    10 30
    20 35
    30 40

    For this task I'm using:
    HS2 (2.4.0.3)
    HSPI_RCSSERIAL.dll 2.4.0.2
    RCS ZCV4 connected via RCS 232 to 485 serial hub and two zone controllers
    HM-TS001

    #2
    Your script works here, but it doesn't do anything with the temperature, it simply reads it into temp1. Add the line 'hs.WriteLog "readtemp",temp1' before the 'end sub' so it will write an entry to the log file to see if temp1 contains the temperature. You'll need to add a few more lines of code to actually populate a device to hold the temperature if your wanting to trigger something.
    HS: 2.5.0.60
    Environment: Virtual XP as guest in VMWare Server running under Win 7
    Plug-ins: MLHSPlugin|RCS Serial Thermostat|UltraLog|UltraMon|
    Misc: 303 Devices, 313 Events, 68+ Scripts

    HSeer: 3.0.0.54
    Environment: Virtual XP as guest in VMWare Server running under Win 7
    Plug-ins: BLGData|BLRF|BLRadar|BLRandom|BLSpeech
    UltraM1G3|UltraECM3|UltraMon3|UPBSpud|Z-Wave
    Misc: 148 Devices, 116 Events, 9+ Scripts (so far, still converting)

    Comment


      #3
      Here is a very basic script to set a device that you can read:

      sub main()
      dim rcs
      set rcs=hs.plugin("RCS Serial Thermostats")
      dim temp1
      temp1=rcs.GetTemp(1,0)
      hs.WriteLog "Read Temp",temp1
      hs.setDeviceValue "y99",temp1
      hs.setDeviceString "y99",temp1
      hs.WriteLog "Device String", hs.DeviceString("y99")
      hs.WriteLog "Device value", hs.DeviceValue("y99")
      end sub
      HS: 2.5.0.60
      Environment: Virtual XP as guest in VMWare Server running under Win 7
      Plug-ins: MLHSPlugin|RCS Serial Thermostat|UltraLog|UltraMon|
      Misc: 303 Devices, 313 Events, 68+ Scripts

      HSeer: 3.0.0.54
      Environment: Virtual XP as guest in VMWare Server running under Win 7
      Plug-ins: BLGData|BLRF|BLRadar|BLRandom|BLSpeech
      UltraM1G3|UltraECM3|UltraMon3|UPBSpud|Z-Wave
      Misc: 148 Devices, 116 Events, 9+ Scripts (so far, still converting)

      Comment


        #4
        Jstaab,

        Thanks for the feedback it's working

        =====================

        For those who are new...
        I'm just starting to play with scripts; therefore, I've attempted to get things working using a hybrid of both script and events.
        Others may have scripted the entire thing; however, I couldn't find any examples and this method is working fine for now.

        Assumptions:
        1.) You have already attached humidifier to a powersource controlled by HS
        2.) You have already setup a humidity sensor
        3.) You have already attached your HVAC system to HS

        This is what was required.

        1.) In a text file located in C:\Program Files\HomeSeer HS2\Scripts\ and named OutsideTemp.txt we put the following code.

        sub main()
        dim rcs
        set rcs=hs.plugin("RCS Serial Thermostats")
        dim temp1
        temp1=rcs.GetTemp(1,0)
        hs.WriteLog "Read Temp",temp1
        hs.setDeviceValue "y99",temp1
        hs.setDeviceString "y99",temp1
        hs.WriteLog "Device String", hs.DeviceString("y99")
        hs.WriteLog "Device value", hs.DeviceValue("y99")
        end sub

        The two (2) possible items that you'll need to verify and/or change are the name of the plugin (RCS Serial Thermostats) and the device address (y99).
        These names need to match your plugin and virtual device names.

        2.) As the RCS Serial Thermostats plug was already configured by simply enabling and setting the COM port...
        I didn't have to do anything else here.

        3.) Creating a virtual device...
        On the "Status" page, clicked "Add Device" and gave it a device name of "Outside Temp", device type "Status Only"
        and matched up the Lettercode/Unitcode with Jstaab's example code that used y99 (this can be changed; however, also make the change in the script.).

        4.) Created two (2) Conditional Events...
        One for "OFF" and one for "ON".
        I choose to use a Conditional trigger because they appear to be evaluated more frequently then waiting for a value/status change trigger.

        On the "Events" page, clicked "Add Event"
        On the Name tab, named it "Humidifier Off", unchecked "Disable Automatic..."
        On the Trigger tab, set trigger to "Condition" left all days selected and set the following conditions:
        Currently set conditions:
        Group 1
        Device: Outside Outside Temp value is in the range -50...-20 AND
        Device: 1st Floor Foyer Humidity value is in the range 1500...10000
        OR Group 2
        Device: Outside Outside Temp value is in the range -19...-10 AND
        Device: 1st Floor Foyer Humidity value is in the range 2000...10000
        OR Group 3
        Device: Outside Outside Temp value is in the range -9...9 AND
        Device: 1st Floor Foyer Humidity value is in the range 2500...10000
        OR Group 4
        Device: Outside Outside Temp value is in the range 10...19 AND
        Device: 1st Floor Foyer Humidity value is in the range 3000...10000
        OR Group 5
        Device: Outside Outside Temp value is in the range 20...29 AND
        Device: 1st Floor Foyer Humidity value is in the range 3500...10000
        OR Group 6
        Device: Outside Outside Temp value is in the range 30...60 AND
        Device: 1st Floor Foyer Humidity value is in the range 4000...10000
        OR Group 7
        Device: Outside Outside Temp value is in the range 61...150

        On the Action tab created two items
        Device Command: Basement HVAC/Mechanical Humidifier Off
        RCS Serial Thermostats: 1st Floor: Set Fan Mode: Auto

        5.) Repeated step four with changes made for an ON Event.
        The on event used the following conditions on the trigger tab
        Currently set conditions:
        Group 1
        Device: Outside Outside Temp value is in the range -50...-20 AND
        Device: 1st Floor Foyer Humidity value is in the range 0...1499
        OR Group 2
        Device: Outside Outside Temp value is in the range -19...-10 AND
        Device: 1st Floor Foyer Humidity value is in the range 0...1999
        OR Group 3
        Device: Outside Outside Temp value is in the range -9...9 AND
        Device: 1st Floor Foyer Humidity value is in the range 0...2499
        OR Group 4
        Device: Outside Outside Temp value is in the range 10...19 AND
        Device: 1st Floor Foyer Humidity value is in the range 0...2999
        OR Group 5
        Device: Outside Outside Temp value is in the range 20...29 AND
        Device: 1st Floor Foyer Humidity value is in the range 0...3499
        OR Group 6
        Device: Outside Outside Temp value is in the range 30...60 AND
        Device: 1st Floor Foyer Humidity value is in the range 0...3999

        On the Action tab created two more items
        Device Command: Basement HVAC/Mechanical Humidifier On
        RCS Serial Thermostats: 1st Floor: Set Fan Mode: On

        The values for humidity and temp came from my desert springs humidifier.

        Thanks again Jstaab for your help

        Hope this helps others,
        Chad

        Comment

        Working...
        X