npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

node-red-contrib-harmony-websocket

v2.2.6

Published

Harmony Hub Websocket Integration for Node-RED

Downloads

184

Readme

Harmony Hub Websocket Integration for Node-RED

npm npm package

Workaround for firmware update 4.15.206

Control your devices connected to a Logitech™ Harmony Hub from Node-RED.

Getting started

If you haven't done so yet, install Node-RED

sudo npm install -g node-red

There are two ways to install the extension: Via npm on the terminal or from within Node-RED in the browser.

Install via terminal and npm

In the terminal open the user data directory ˜/.node-red and install the package

cd ˜/.node-red
npm install node-red-contrib-harmony-websocket

Then run or restart Node-RED

node red

Open your Node-RED instance, typically under http://localhost:1880, and you should see the new nodes available in the palette in the group harmony.

Install via Node-RED

You can install the extension simply in Node-RED in your browser, by default under http://localhost:1880. Click on the Menu button (sandwich icon) in the upper right corner. In the menu click Manage palette. In the side-panel that opens on the left click on the tab Install. In the search field enter harmony, in the result list a node-red-contrib-harmony-websocket card will appear. Click on the install button on this card, and you are done. You should now find the new nodes available in the palette in the group harmony.

Usage / Available nodes

Three nodes are available in Node-RED: HWS command, HWS activity, and HWS observe, located in the group harmony.

HWS command

A node to send a Command to a Harmony Hub through Node-RED.

A Harmony Hub needs to be selected from the list or created by clicking on the edit button. The Harmony Hub IP address can be autodetected by clicking on the search button in the configuration node.

An Activity or Device that is set up on the Harmony Hub needs to be selected. The dropdown loads available activities and devices automatically, if needed the list can be refreshed by clicking on the refresh button next to the dropdown. Selecting an activity or device changes the available commands below, therefore you'll need to reselect a command below.

A Command needs to be selected. The dropdown loads available commands for the selected activity or device automatically, if needed the list can be refreshed by clicking on the refresh button next to the dropdown.

The Repeat field allows for the command to be repeated. The default is 1, meaning the command is send once. For example entering 10 will send the command exactly 10 times. This can be helpful when using commands for volume or channels.

The command configured in the node will be triggered by any input injected into the node, the output slot will return msg.payload = true if the command was sent successfully.

HWS activity

A node to activate an Activity on a Harmony Hub through Node-RED

A Harmony Hub needs to be selected from the list or created by clicking on the edit button. The Harmony Hub IP address can be autodetected by clicking on the search button in the configuration node.

An Activity that is set up on the Harmony Hub needs to be selected. The dropdown loads available activities automatically, if needed the list can be refreshed by clicking on the refresh button next to the dropdown.

To switch off, select PowerOff from the Activity dropdown list, or enter "-1" into the field.

The command configured in the node will be triggered by any input injected into the node, the output slot will return msg.payload = true if the command was sent successfully.

HWS observe

A node to observe an Activity being triggered on a Harmony Hub through Node-RED

A Harmony Hub needs to be selected from the list or created by clicking on the edit button. The Harmony Hub IP address can be autodetected by clicking on the search button in the configuration node.

When an Activity is switched on the Harmony Hub, the node sends an object with a payload to the output: payload: { activity: activityId, status: activityStatus } The activityId is the ID of the current activity, the activityStatus represents the following states: 0 = Hub is off, 1 = Activity is starting, 2 = Activity is started, 3 = Hub is turning off, 4 = Activity is started but value is cached.

Built With

  • NodeJS - JavaScript runtime built on Chrome's V8 JavaScript engine.
  • Node-RED - for wiring together hardware devices, APIs and online services.

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request.

Authors

  • Stefan Krüger - Initial work - Aietes
  • Daniel Freese - Coding help - AirBorne04
  • lopelex - Websocket implementation - lopelex

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

This Node-RED module is based on the great work of Manuel Alabor swissmanu and Daniel Freese AirBorne04, using his harmonyhub client and discover libraries.