www.homeseer.com    
 

Go Back   HomeSeer Message Board > Audio / Video and Infra-red (IR) Plug-ins > Audio / Video and Infra-red (IR) Discussion > AirplaySpeak

AirplaySpeak This plug-in is a Speak Proxy which allows Homeseer to route annoucements to AirPlay capable devices such as an AirPort Express

Reply
 
Thread Tools Display Modes
  #1  
Old August 13th, 2016, 10:05 AM
stevenseh@gmail.com stevenseh@gmail.com is offline
Seer
 
Join Date: Jun 2016
Location: NC
Posts: 46
Intercept AirplaySpeak error

In some cases my speaker goes awry and AirplaySpeak throws an error message in the log. Is it based on an error code of the speak command? How could I intercept that error and based on that for example send a text message to alert me to reboot my speaker (that usually solves the issue).
Reply With Quote
  #2  
Old August 15th, 2016, 06:41 PM
stevenseh@gmail.com stevenseh@gmail.com is offline
Seer
 
Join Date: Jun 2016
Location: NC
Posts: 46
I use the below script to look for a 'failed connection' message in the log. Feel free to copy and adapt. I'm using a Global variable to keep track of the last time i searched the log, and trigger the script like every 10 minutes from an event. If it finds a failed connection log entry, it calls another event.

Are there other errors that are issues in the log that i could look for?
Btw, it would be easier if log entry were marked as error instead of info...

Sub Main(parm as object)

Dim Logs() As HomeSeerAPI.LogEntry
Dim lngIndex as Long
Dim LocDate as Date
Dim LocTargetLogType as string = "AirplaySpeak"
Dim LocTargetText as string = "INFO Connection to iW3 (192.168.0.105:1024) failed"
Dim LocLogText50 as string
Dim LastRan As Date = #8/14/2016 5:02:00 PM#
Dim NewLastRan As Date
Dim FoundDrop As Boolean = False

NewLastRan = Now
LastRan = hs.GetVar("lastlogscan")
Logs = hs.GetLog_Date(LastRan, NewLastRan)
hs.SaveVar("lastlogscan",NewLastRan)

If Logs IsNot Nothing Then

For lngIndex = LBound(Logs) to UBound(Logs)
If String.Equals(LocTargetLogtype, Logs(lngIndex).LogType) Then
LocLogText50 = Logs(lngIndex).LogText.SubString(0,50)
If String.Equals(LocTargetText, LocLogText50)

LocDate = Logs(lngIndex).LogTime
hs.WriteLog("Info", "Found AirplaySpeak drop at " & LocDate.ToString("G"))
FoundDrop = True
hs.TriggerEvent("AirplaySpeak Speaker Dropped")
Else
' hs.WriteLog("Info", LocTargetText & "-" & LocLogText50)
End If
Else
' hs.WriteLog("Info", LocString & "-" & Logs(lngIndex).LogType)
End If

Next lngIndex

End If

If FoundDrop = False
hs.WriteLog("Info", "No AirplaySpeak drops found")
End If
End Sub
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
What does Intercept Speaker Devices do? matt246 PI-SonosController (3P) 1 March 20th, 2016 10:34 AM
Reset AirplaySpeak? czfyjf AirplaySpeak 2 March 24th, 2014 08:00 PM
AirplaySpeak and Loquendo voices spud AirplaySpeak 0 December 5th, 2013 08:38 PM
Any way to intercept local action xxrzdxx HomeSeer Z-Wave Plug-in 1 January 19th, 2011 08:40 PM
Intercept voice command.... zippy HS2 / HSPRO 1 September 29th, 2006 05:50 PM


All times are GMT -4. The time now is 10:37 AM.


Copyright HomeSeer Technologies, LLC