Skip to content

asheroto/EzloDeviceNameControl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ko-fi

Control Ezlo Device by Device Name

Ezlo is a home automation platform that uses Z-Wave and Zigbee.

This script provides a way to control your Ezlo device by using the device name, eliminating the need to remember or find the device ID. In addition, it offers the ability to display all connected devices along with their corresponding IDs and item/function names. This feature facilitates more intuitive and efficient control over your Ezlo device, particularly when integrating with PowerShell or other scripting languages.

Turn Office AC on:

.\Ezlo.ps1 -DeviceName "Office AC" -ItemName "Switch" -Value 1

Turn Office AC off:

.\Ezlo.ps1 -DeviceName "Office AC" -ItemName "Switch" -Value 0

And the office AC turns off.

Output: Controlling the device

In this example, the "Office AC" device is a window unit that is plugged into a Z-Wave outlet.

How it Works

  • The device names and IDs are gathered from hub.devices.list
  • The device IDs and item/function names and IDs are gathered from hub.items.list
  • An array is created containing the device name as the key, and the ID and item/function name as object values
  • When -ShowDevices is specified as a parameter, the data is converted to JSON for readability

Note: The device ID (deviceId) is different than ID (_id). The device ID is the device itself, whereas the ID is an item/function of the device.

Prerequisites

  • PowerShell
  • Ezlo device
  • Your device needs to have offllineAnonymousAccess and offlineInsecureAccess set to true as defined in Part 2 on this page.
    • If you want to keep these set to false, you'll just need to modify the script. I might add this as an option later.

Setup

Change the Ezlo IP address at the top of the script.

Usage

Run the script from PowerShell like so:

.\Ezlo.ps1 -DeviceName "Device Name Goes Here" -ItemName "Item Name Goes Here" -Value Value_Integer_Goes_Here

To see all the devices and device names:

Run this special command which will output the devices, the item/function names, and its associated ID in JSON format.

.\Ezlo.ps1 -ShowDevices

Example

Turn on the device:

.\Ezlo.ps1 -DeviceName "Room Light" -ItemName "Switch" -Value 1

Turn off the device:

.\Ezlo.ps1 -DeviceName "Room Light" -ItemName "Switch" -Value 0

Screenshots

Controlling the device:

Controlling the device

ShowDevices:

ShowDevices