Announcement

Collapse
No announcement yet.

UltraM1G3 Script for alarm triggered by zone

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

    UltraM1G3 Script for alarm triggered by zone

    Is there a list of script commands and syntax for the HS3 version of this pluggin. I'm not the best at scripting by any means. But I can't seem to find a way of making a script for HS3 that send info on which zone triggered the alarm. I found a HS2 version in a previous post:
    Code:
     Sub Main(ByVal parm As Object)
    
        Dim mailSendTo As String = "you@domain.com"
        Dim mailSendFrom As String = "home@domain.com"
        Dim mailSubject As String = "ALARM SYSTEM TRIGGERED"
    
        Dim strZones As String = ""
        Dim mailMessage As String = ""
    
        ' Get zones in an alarm status
        strZones = hs.plugin("UltraM1G").GetZonesInAlarm()
        If strZones.Length > 0 Then
          mailMessage = "The following zones are in alarm: " & strZones
        End If
    
        If mailMessage.Length > 0 Then
          ' Send email
          hs.SendEmail(mailSendTo, mailSendFrom, mailSubject, mailMessage)
        Else
      End Sub
         hs.WriteLog("Debug", "No zones are in alarm.")
        End If
    What would be the HS3 equivalent of this?

    Marty
    iCore5 Win 10 Pro x64 SSD

    HS3 Pro Edition 3.0.0.435 Windows

    BLOccupied:,Device History:,Yamaha:,UltraMon3:,mcsXap:,Restart:,UltraNetatmo3:, UltraM1G3:,Ultra1Wire3:,BLBackup:,Harmony Hub:,DoorBird:,UltraECM3:,Nanoleaf 3P:,UltraRachio3:,Z-Wave:,SDJ-Health:,BLGarbage:,Blue-Iris:,Chromecast:,Pushover 3P:,EasyTrigger:

    #2
    Is there an APP I for HS3?
    tenholde

    Comment


      #3
      This would be a great feature to have. I had a few critical scripts in HS2 that seemed to made life easier and I'm struggling to get the plugin in HS3 to provide the same results...

      Comment


        #4
        Originally posted by Jerry Coleman View Post
        This would be a great feature to have. I had a few critical scripts in HS2 that seemed to made life easier and I'm struggling to get the plugin in HS3 to provide the same results...
        For the most part, the same API is available, but you access it differently using the new HS3 way. I just have not had time to update the docs to show the new HS3 way. Which API commands did you use in HS2 that you need working in HS3?

        Regards,
        Ultrajones
        Plug-ins: UltraMon, UltraM1G, UltraCID, Ultra1Wire, UltraLog, UltraWeatherBug, UltraPioneerAVR, UltraGCIR

        Comment


          #5
          Here is a script I use to send a Pushover message when the alarm is triggered. You should be able to work out the script.

          Sub Main(ByVal Parm As Object)

          Try
          Dim CO(6) As Object
          Dim zones as String = String.Empty

          zones = "Zones: " + hs.PluginFunction("UltraM1G3", "", "GetZonesInAlarm", nothing)
          CO(0) = "All Clients" 'must be matched with a device name already in the plugin or 'All Clients' CASE SENSITIVE
          CO(1) = zones 'message body
          CO(2) = "Alarm activated at 48SBC" 'message text
          CO(3) = "high" 'low/normal/high/emergency
          CO(4) = "siren" 'message sound from list already in HomeSeer - must match
          CO(5) = Nothing
          CO(6) = Nothing

          hs.PluginFunction("Pushover 3P", "", "Pushscript", CO)

          Catch ex As Exception
          hs.WriteLog("", "Exception in script: " & ex.Message)
          End Try
          End Sub
          Marty
          iCore5 Win 10 Pro x64 SSD

          HS3 Pro Edition 3.0.0.435 Windows

          BLOccupied:,Device History:,Yamaha:,UltraMon3:,mcsXap:,Restart:,UltraNetatmo3:, UltraM1G3:,Ultra1Wire3:,BLBackup:,Harmony Hub:,DoorBird:,UltraECM3:,Nanoleaf 3P:,UltraRachio3:,Z-Wave:,SDJ-Health:,BLGarbage:,Blue-Iris:,Chromecast:,Pushover 3P:,EasyTrigger:

          Comment

          Working...
          X