https://github.com/asheroto/ezlodevicenamecontrol
Control an Ezlo device by the device's name, without having to know the device ID.
https://github.com/asheroto/ezlodevicenamecontrol
api change control device device-name deviceid ezlo ezlo-hub-kit item-name poweshell value vera zigbee zigbee-gateway zwave-controller zwave-gateway
Last synced: 7 months ago
JSON representation
Control an Ezlo device by the device's name, without having to know the device ID.
- Host: GitHub
- URL: https://github.com/asheroto/ezlodevicenamecontrol
- Owner: asheroto
- Created: 2023-06-07T18:39:14.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-06-07T19:27:39.000Z (over 2 years ago)
- Last Synced: 2025-01-31T06:48:07.919Z (8 months ago)
- Topics: api, change, control, device, device-name, deviceid, ezlo, ezlo-hub-kit, item-name, poweshell, value, vera, zigbee, zigbee-gateway, zwave-controller, zwave-gateway
- Language: PowerShell
- Homepage:
- Size: 14.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
[](https://ko-fi.com/asheroto)
# Control Ezlo Device by Device Name
[Ezlo](https://www.ezlo.com/) 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:**
```powershell
.\Ezlo.ps1 -DeviceName "Office AC" -ItemName "Switch" -Value 1
```
**Turn Office AC off:**
```powershell
.\Ezlo.ps1 -DeviceName "Office AC" -ItemName "Switch" -Value 0
```
And the office AC turns off.**Output:**
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](https://www.ezlo.com/)
- Your device needs to have **offllineAnonymousAccess** and **offlineInsecureAccess** set to **true** as defined in Part 2 [on this page](https://support.getvera.com/hc/en-us/articles/360016339799-Ezlo-platform-How-to-use-HTTP-API-commands-aka-Luup-Requests).
- 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:**
```powershell
.\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.
```powershell
.\Ezlo.ps1 -ShowDevices
```
## Example
**Turn on the device:**
```powershell
.\Ezlo.ps1 -DeviceName "Room Light" -ItemName "Switch" -Value 1
```
**Turn off the device:**
```powershell
.\Ezlo.ps1 -DeviceName "Room Light" -ItemName "Switch" -Value 0
```## Screenshots
**Controlling the device:**
**ShowDevices:**
