How to Alert LaMetric Watch with PowerShell

I have made me a Christmas Present by myself, and ordered a LaMetric Watch a few days ago. If there is someone, who don’t know what this is, take a look here:

After some time, configuring and playing around, I got the idea to push Messages to the LaMetric Watch with PowerShell.

It took only a few minutes, reading the API Documentation and write some PowerShell Code, and it worked like a charm.

It took some more time, to write a nice looking PowerShell Code Smileand to write this Article to provide you this Information.

The complete PowerShell Script is available at the Microsoft TechNet Gallery, see the Link at the bottom.


Of course, you have to configure your LaMetric Watch and connect it to your Wi-Fi, I will not guide you through this steps Smile

We need the IP and the API Key, the IP should be an easy one, go to your DHCP Server and check the IP, or open the LaMetric APP on your Phone, Settings About, and Wi-Fi, there is your IP

The API Key can be found in the Developer Area at the LaMetric Web Page, in the Device Section:

See this Article for more Help if needed:

Replace the Information at the following Part in the Script

#Api Settings

Settings and Script

The rest of the Script is straight forward, you have some settings, which are listed in the Script itself, if your interest in some more Details, take a look at the API Docs from LaMetric:

#Alert settings
$Priority="info" #"info, warning, critical
$Icon="25675" #25674 = au2mator
$Text="My favorite Blog is :-)"

$SoundCategory="notifications" #notifications, alarms


#Build JSon
   "model": {
        "frames": [
        "sound": {
            "category": "$SoundCategory",
            "id": "$SoundId",

$base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(("dev:$ApiKey"))) 
$header = @{ 
    Authorization=("Basic {0}" -f $base64AuthInfo) 

Invoke-RestMethod -Method POST -Uri ("http://"+$LametricIP+":8080/api/v2/device/notifications") -ContentType "application/json" -Headers $header -UseBasicParsing -Body $json




Michael Seidl aka Techguy

Leave a Comment

Your email address will not be published. Required fields are marked *