Announcement

Collapse
No announcement yet.

On request: AP800 script.

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

    On request: AP800 script.

    This is the AP800 script as requested. Please rename the .txt to .js !
    Comments in the script explains the use.

    Alex
    Attached Files

    #2
    Thanks Alex,
    Will come in very handy.
    Regds

    Boyd

    Comment


      #3
      O.k. here some script basics:

      First edit the script at the line containing:

      createMissingDevice( DEVICE_MAXMICS, "z50", "Virtual", createLocation(0) );

      The z50 value will be the the first house and unit code used, so make it that it suits your needs.

      You can create a ap800.ini file (in the config directory) containing:

      [Settings]
      Serial_port= (1,2,3 etc.)
      Baud_rate= (9600 etc.)
      Log_level= (0 is none, 1 means logging on)

      Just add your values. If you don't make an INI file, the default values will be used (9600,n,1)

      Then create an event with the following action:


      <TABLE border=0 cellSpacing=0 cellPadding=0 width="100%"><TBODY><TR><TD class=tablecellscript width=160 noWrap align=right> Run script: </TD><TD class=tablecellscript align=left>ap800lib.js("setupAll", null )
      </TD></TR></TBODY></TABLE>

      Add an homeseer startup event (make event and run it in the startup.txt scipt)

      <TABLE border=0 cellSpacing=0 cellPadding=0 width="100%"><TBODY><TR><TD class=tablecellscript width=160 noWrap align=right> Run script: </TD><TD class=tablecellscript align=left>ap800lib.js(connect)</TD></TR></TBODY></TABLE>


      Add an homeseer shutdown event

      <TABLE border=0 cellSpacing=0 cellPadding=0 width="100%"><TBODY><TR><TD class=tablecellscript width=160 noWrap align=right>Run script: </TD><TD class=tablecellscript align=left>ap800lib.js(disconnect)</TD></TR></TBODY></TABLE>

      Now run the first script (setup), then the connect script. You're now connected to your AP.
      You now can create events like:

      ap800lib.js("hsScriptCaller",setGain|0|2|O|-1|0)

      You can find all the various commands in the AP800 manual. Just make sure you structure your calls exactly like stated above (so just change "setGain" and various values, but always with the hsSciptCaller prefix and with the "|" between the variables).
      Every time you start homeseer, the AP800 will be connected. The AP will be disconnected when HS shuts down.


      Alex

      Comment

      Working...
      X