GithubHelp home page GithubHelp logo

asheroto / ezlodevicenamecontrol Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 15 KB

Control an Ezlo device by the device's name, without having to know the device ID.

PowerShell 100.00%
api change control device device-name deviceid ezlo ezlo-hub-kit poweshell value

ezlodevicenamecontrol's Introduction

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

ezlodevicenamecontrol's People

Contributors

asheroto avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.