(Adding back a reply that was lost due to the failed forum upgrade)
I use this Powershell script to update an openHAB Item with my Teams status. Instead of calling another script at the end I just contact the openHAB REST API to set the Item.
Item
String strTeamsMode "My Teams Mode"
PowerShell script
Get-Content $env:APPDATA\Microsoft\Teams\logs.txt -Wait -Tail 0 | ? { $_ -match "(?<=StatusIndicatorStateService: Added )(\w+)" } | % { if($matches[0] -ne "NewActivity") {& Invoke-WebRequest 'http://192.168.1.92:8080/rest/items/strTeamsMode' -Body $matches[0] -Method 'Post' -ContentType 'text/plain' }}
I have this working with OH2.5, with the work laptop in my local network (hence using the local IP address).