Waterly WaterlyConnect Developer Hub
SDK PowerShell 5.1+ PS 7+ Windows

PowerShell Module

A single .psm1 module that exposes cmdlet-style helpers for building and posting WaterlyConnect payloads from Windows environments. Compatible with Windows PowerShell 5.1 and PowerShell 7+. Ideal for scheduled tasks, Windows automation scripts, and SCADA systems that already use PowerShell for orchestration.

5.1+Windows PowerShell
7+PowerShell Core
.psm1Single file artifact
Prerequisites
  • Windows PowerShell 5.1 or PowerShell 7+ in the environment running the script.
  • A Waterly-provided submission URL, client token, and device identity (id and type).
  • The WaterlyConnect.psm1 module accessible via Import-Module — either by path or added to a $env:PSModulePath location.
  • Outbound HTTPS access from the Windows host to the WaterlyConnect endpoint.
Quick Start
  1. 1
    Download the module. Place WaterlyConnect.psm1 next to your script or in a directory on $env:PSModulePath.
  2. 2
    Import and configure. Call Import-Module, then use New-WaterlyConnectDeviceInfo and New-WaterlyConnectApiClient to create your client.
  3. 3
    Build tags and submit. Create an array of tag datum objects with New-WaterlyConnectTagDatum and call $client.SubmitData($tags).
Submission Example
Import-Module ./WaterlyConnect.psm1

$device = New-WaterlyConnectDeviceInfo `
  -Id   "pump-station-07" `
  -Type "Windows Adapter"

$client = New-WaterlyConnectApiClient `
  -Url         "https://app.waterlyapp.com/connect/submit" `
  -ClientToken "your-client-token" `
  -ClientDevice $device

$tagInputs = @(
  @{ Name = "RawWaterFlow";    Value = 842.3 }
  @{ Name = "PumpMotorAmps";   Value = 14.1  }
  @{ Name = "ChlorineDosage";  Value = 2.6   }
)

$ts = [int][DateTimeOffset]::UtcNow.ToUnixTimeSeconds()

$tags = foreach ($t in $tagInputs) {
  New-WaterlyConnectTagDatum `
    -Name                $t.Name `
    -Value               $t.Value `
    -LastChangeTimestamp $ts
}

$client.SubmitData($tags)
Cmdlet Reference
New-WaterlyConnectApiClient

Creates the API client. Returns an object with a SubmitData($tags) method that throws on non-2xx responses.

ParameterRequiredDescription
-UrlYesSubmission endpoint URL, ending in /connect/submit.
-ClientTokenYesAPI token provided by the Waterly team.
-ClientDeviceYesDevice object from New-WaterlyConnectDeviceInfo.
-ProxyNoOptional proxy URL for Invoke-RestMethod.
New-WaterlyConnectDeviceInfo

Builds the device identity object. Requires -Id (string) and -Type (string).

New-WaterlyConnectTagDatum

Builds one tag payload. Requires -Name, -Value, and -LastChangeTimestamp (Unix seconds). Numeric values are formatted with invariant culture so decimal separators are always ..

Files
Module download

The complete single-file PowerShell module ready to copy into your project.

Download .psm1
Package README

Detailed usage, looping examples, cmdlet reference, and configuration notes.

Open README
Source folder

Full source path in the waterlyconnect-docs repository.

View on GitHub ↗