Jump to content

Swyx Client CLI / Powershell


fkappen
 Share


Go to solution Solved by jodost,

Recommended Posts

Hallo Zusammen,

 

wir setzen seit zwei Wochen auf Swyx - leider sind von Haus aus keine Busylights kompatibel - dafür gibt es wohl ein kostenpflichtiges Addin...

Ich bin in Powershell einigermaßen Fitt und kann hierrüber auch die Farbe der Busylights setzen - leider ist es mir noch nicht möglich den Status des Swyx Clients per Powershell auszulesen. Gibt es da eine Möglichkeit? 

 

Vielen Dank vorab!

Link to comment
Share on other sites


  • Most Valued User

Was hast du genau vor - eine am PC angeschlossene Leuchte je nach Status ansteuern?

 

Du könntest im Client ein Skin konfigurieren mit einer WebExtension, die rut je nach Leitungsstatus eine "URL" auf, wobei man an der Stelle auch Kommandozeilen-Aufrufe auslösen kann. 

 

Damit kannst du einfach beim Klingeln, Wählen, Abheben und Auflegen ein Script aufrufen was die Lampe steuert.

 

 

Link to comment
Share on other sites


  • Most Valued User
  • Solution

Ich muss halb zurückrudern und halb dir eine andere Lösung anbieten :)

 

Ich habe gerade noch mal nachgelesen, was ich bei einem Kunden in Erinnerung hatte. Da ruft das SwyxIT keine Kommandozeilen-Aufrufe auf, sondern einen speziellen keasy://-URL-Handler, den die Software registriert hat. 

 

Das müsste aber auch mit Powershell möglich sein - https://stackoverflow.com/questions/40596463/custom-protocol-handler-via-powershell-script

 

Dann registrierst du dir das protocol busylight für dein Powershell Script und rufst dann in der WebExtension auf: busyligz://on oder busylight://off

 

Alternativ bin ich beim googlen nach keasy auf folgendes gestoßen, was ohne Skins auskommt - vielleicht kannst du damit was basteln (aus dem VBScript heraus Systemaufrufe - und damit auch PS - sollten ja kein Problem sein): 

 

 

 

Link to comment
Share on other sites


Die zweite Lösung ist "mega"! :) Vielen Dank! Ich habe mir das in PowerShell nachgebaut. 

 

Modul in PowerShell laden:

$Swyx = New-Object -ComObject "CLMgr.ClientLineMgr"

 

Line Status auslesen:

$Swyx.DispGetLine(0).DispState.ToString()

 

Dann über eine Schleife das Busylight entsprechend setzen.

 

Was noch schön wäre der Abgleich des DND Status wenn ein Teams Call aktiv ist. Hierbei verbleibt der LineStatus auf 0 (inaktiv) aber der RichPresenceStatus wechselt auf DND... gibt es da eine Methode?

 

 

Link to comment
Share on other sites


  • Most Valued User

das kann dir @Tom Welligeam ehesten beantworten 🙂

 

Kannst Du Dein Script vielleicht hier veröffentlichen? Ich hab noch jede Menge Philips Hue Leuchtmittel rumfliegen und so einen hier: https://homematic-ip.com/de/produkt/schaltaktor-fuer-markenschalter-mit-signalleuchte auch noch

 

Da könnte ich mir ja ins bzw. für's Arbeitszimmer auch ein Busylight bauen 🙂

Link to comment
Share on other sites


<#
 
    "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -noexit -executionpolicy bypass -WindowStyle hidden -File C:\Scripte\SwyxBusylight.ps1
 
#>
#Pfade
$busylightpath = "C:\Program Files (x86)\Busylight for Jabra"
if (!(Test-Path $busylightpath)) {
    Write-Warning "Busylight for Jabra nicht gefunden!"
    Pause
}
Add-Type -Path "$busylightpath\BusylightSDK.dll"
$Color = New-Object -TypeName Busylight.BusylightColor
$SDK = New-Object -TypeName Busylight.SDK
#ComObjects
$Busylight = New-Object -TypeName Busylight.sdk
try {
    $Swyx = New-Object -ComObject "CLMgr.ClientLineMgr"
} catch {
    Write-Warning "Swyx Client nich gefunden!"
    Pause
}
#Schleife
do {
    #Line Status
    $linestate = $Swyx.DispGetLine(0).DispState.ToString()
    if ($linestate -in @(0)) {
        # Green (Ready)
        $Color.RedRGBValue = 0
        $Color.GreenRGBValue = 255
        $Color.BlueRGBValue = 0
        $Busylight.Light($Color)
    }
    if ($linestate -in @(1, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)) {
        # Red (Phone Call / DND)
        $Color = New-Object -TypeName Busylight.BusylightColor
        $Color.RedRGBValue = 255
        $Color.GreenRGBValue = 0
        $Color.BlueRGBValue = 0
        $Busylight.Light($Color)
    }
    if ($linestate -eq "0" -and ($Swyx.DispClientConfig.DoNotDisturb.ToString()) -eq "1") {
        <# Blue (Teams)
            $Color = New-Object -TypeName Busylight.BusylightColor
            $Color.RedRGBValue = 0
            $Color.GreenRGBValue = 0
            $Color.BlueRGBValue = 255
            $Busylight.Light($Color)
        #>
        # Red (Phone Call / DND)
        $Color = New-Object -TypeName Busylight.BusylightColor
        $Color.RedRGBValue = 255
        $Color.GreenRGBValue = 0
        $Color.BlueRGBValue = 0
        $Busylight.Light($Color)
    }
    if ($linestate -eq "0" -and ($Swyx.DispClientConfig.Away.ToString()) -eq "1") {
        # Yellow (Away)
        $Color = New-Object -TypeName Busylight.BusylightColor
        $Color.RedRGBValue = 255
        $Color.GreenRGBValue = 255
        $Color.BlueRGBValue = 0
        $Busylight.Light($Color)
    }
    if ($linestate -in @(3)) {
        # Blinking Yellow (Ringing)
        $Color.RedRGBValue = 255
        $Color.GreenRGBValue = 255
        $Color.BlueRGBValue = 0
        $SDK.Blink($color, 10, 10)
    }
    Start-Sleep 1
    #Write-Host (Get-Date -Format hh:mm:ss)
} until ($false)
Link to comment
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share


×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and have taken note of our Privacy Policy.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.