Announcement

Collapse
No announcement yet.

hs.WriteLog (help please)

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

  • BlairG
    replied
    I was able to Pass Parameters from Designer to a Script, and have the script write the User and Lock information into the HS Log...

    Aug-12 2:47:56 PM KR_Lock User Name: Blair Opened Lock# 0024
    Aug-12 2:47:56 PM KR_Lock ****************************

    The script was easy, thanks to Mr Happy helping someone figure it out 2 years ago.

    Sub Main(ByVal Param() As String)
    hs.writelog("KR_Lock", "****************************")
    hs.writelog("KR_Lock", "User Name: " & Param(0) & " Opened Lock# " & Param(1))
    End Sub

    Leave a comment:


  • BlairG
    replied
    Thanks for the script, I'm not controlling push button door locks though, they are magnetic latches and I'm using a IP2CC relay to put power on the latches.

    The info I'm trying to log is all scattered across 5 or 6 log entries, and I'd like to get it on a single line. But like Mr happy said the CAPI control command doesn't know who is giving the unlock command, CAPI just knows which lock it's controlling.

    The touch app client name doesn't get passed to the event where the hs.writelog is happening. I'm sure there is a work around, but this app is going onto a couple dozen smart phones. That would make it a massive project to pull off.

    THANks, Mr.Happy and Wayne for helping me talk it out.

    Cheers

    Leave a comment:


  • waynehead99
    replied
    There is a script floating around here (I think it's Mr Happy's) that logs all the door lock and unlock events into a single VD. Would that work?
    Attached Files

    Leave a comment:


  • BlairG
    replied
    It's a custom touch app, no device chooser. The person comes up to the building, connects to the Wifi. Launches HS Touch, that would show the connection to HS in the log. They launch the app, enter a password and touch the door they want unlocked. The Touch App runs a HS Event to unlock that door for 5 seconds, relocks it and does a hs.writelog. Here is where I'd grab the doors Name, and hopefully the users name from HS Touch. When they exit the app the log would show their disconnect.
    I was hoping to get it all in one log entry. If possible.

    Leave a comment:


  • mrhappy
    replied
    Are you using the default project or a custom project? The only way I know how to do this (not saying there is not another way) is to have 25 different projects and add an action to each unlock button to pass the username into the HS log which is an issue in itself managing that many projects. You also have the issue that with the default project I'm not sure if you could do that because the device chooser is dynamic but I don't have any locks to actually check that.

    With HS when a service (be it HSTouch or the Web UI) controls a device via CAPI then it calls the SetIOMulti function in the respective plugin for the lights/locks etc, there are no methods in that function to find out where that CAPI request has actually even come from (even the plugin let alone detail from that plugin).

    Leave a comment:


  • BlairG
    replied
    It's the Touch user. This app is going to be installed on about 25 teachers phones, and it controls the locks on all 9 school entrances. I want to get a log entry when they open a door, I need to grab their Touch user name for the log. The Event will capture the doors name and time stamp.

    Leave a comment:


  • mrhappy
    replied
    When you say current username what do you mean? The current username logged into HS that triggered the event, the current users logged into HomeSeer or something like the windows domain username?

    Leave a comment:


  • BlairG
    started a topic hs.WriteLog (help please)

    hs.WriteLog (help please)

    I have an application where I want an event to make a log entry that will include the current user name.
    Can this be done with a one line script? Or do I have to run a .vb script?

    Any ideas would sure be appreciated.

    Thanks
    Last edited by BlairG; August 12th, 2016, 04:35 PM. Reason: Found Solution
Working...
X