Last active
July 19, 2017 16:24
-
-
Save digitalbricklayer/c9db544b69e7d4159546bcacff7c5c90 to your computer and use it in GitHub Desktop.
How to find switch sensor data from the Room Alert using PowerShell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Switch 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' | |
# Find the sensor named 'Switch Sen 1' | |
$result.switch_sen|where{$_.label -eq 'Switch Sens 1'} | |
# Prints out the following to the console: | |
# label enabled alarm status | |
# ----- ------- ----- ------ | |
# Switch Sen 1 1 1 0 | |
# Find all enabled switch sensors | |
$result.switch_sen |where{$_.enabled -eq 1} | |
# Prints out the same as above in this case... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment