Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
How to find digital sensor data from the Room Alert using PowerShell
# Digital sensor data
# The examples below use a Room Alert 3E with firmware v2.0.0 and Powershell v5
$result = Invoke-RestMethod -URI 'http://10.0.0.1/getData.json'
# To find the sensor named 'Internal Sensor'
$result.sensor|where{$_.label -eq 'Internal Sensor'}
# Prints out the following to the console:
# label : Internal Sensor
# tempf : 76.65
# tempc : 24.81
# highf : 76.87
# highc : 24.93
# lowf : 72.37
# lowc : 22.43
# alarm : 4
# type : 16
# enabled : 1
# Find all enabled sensors
$result.sensor |where{$_.enabled -eq 1}
# Prints out all of the enabled sensor data to the console much like the command above except there may be multiple sensors
# Find all enabled temperature sensors and print out the current temperature, high and low all in Celcius
$result.sensor |where{$_.enabled -eq 1 -and $_.type -eq 16}|select-object -Property label,tempc,highc,lowc
# Prints out the following to the console:
# label tempc highc lowc
# ----- ----- ----- ----
# Internal Sensor 24.81 24.93 22.43
# Ext Sensor 1 25.06 25.18 23.56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment