Giter VIP home page Giter VIP logo

node-red-contrib-philipshue-events's Introduction

node-red-contrib-philipshue-events

This package implements the Philips Hue API V2 EventSource as a node-red node.

See https://developers.meethue.com/develop/hue-api-v2/core-concepts/#events for more information about the Hue API V2 and the /eventstream endpoint

Disclaimer

Please note that the Philips Hue API V2 is still in early access. Please make sure your bridge firmware is at least version 1948086000. If you have any issue, you can try generating a new token. If you still encounted issues, feel free to open an issue in this repository.

Node

There is only one flow node in this package: philipshue-events.

This node needs to have philipshue-events-config configured for your bridge. You can set the address and hue-application-key manually or use the auto-discovery/link-button.

The node will connect to the EventSource endpoint and output every events as a message.

The node will output event as JSON. Here is an example of msg.payload:

{
  "creationtime": "2021-10-18T17:04:55Z",
  "data": [
    {
      "id": "e706416a-8c92-46ef-8589-3453f3235b13",
      "on": { "on": true },
      "owner": {
        "rid": "3f4ac4e9-d67a-4dbd-8a16-5ea7e373f281",
        "rtype": "device"
      },
      "type": "light"
    }
  ],
  "id": "9de116fc-5fd2-4b74-8414-0f30cb2cbe04",
  "type": "update"
}

You can then use built-in node-RED switch node to route the event based on msg.payload.type or msg.payload.data[0].type.

For more examples, see the examples folder. You can also access them in Node-RED > Import > Examples > @yadomi/node-red-contrib-philipshue-events`.

For complexes use case, see @andesse's HUE-CLIP-API.Node-RED-Flows

Development

Clone the repository

git clone [email protected]:yadomi/node-red-contrib-philipshue-events.git
cd node-red-contrib-philipshue-events

Install the dependencies:

yarn install

In a terminal, build and watch the nodes:

yarn build:watch

In a second terminal, run the debug node-red instance, accesssible via http://127.0.0.1:1880

yarn node-red

node-red-contrib-philipshue-events's People

Contributors

yadomi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-red-contrib-philipshue-events's Issues

Removing wire not working as expected

After deleting my wire connecting a debug node to a phillipshue-event node, the debug node will continue to receive messages from the hue node. Other nodes I've tried are working as expected, it's just the phillipshue-event node that seems to be affected. I have to delete the receiving node for it to stop receiving messages.

Feature Request: Add name to the events config

Currently the events config are shown with "Hue" and the IP address. Would be great if it could also have a name to distinguish them as I don't remember this IP address belongs to which Hue Hub. :)

Issue with Firmware 1953188021 (beta firmware)

@yadomi Hi Felix,
I see a Problem coming with upcoming Firmware releases for the bridge.

In my apartment I have a non-beta with 1953188020 that works fine and the above mentioned beta firmware on the other bridge I get zero events anymore. If I am using the SSE flow from my repository with the same secret-key I receive the stream.

just writing this to be aware of. No idea how to reproduce, that you might are able to fix.

Greetings Andreas

Deploying multiple times breaks the payload

Deploying the flow multiple times breaks the payload object, instead of returning an actual JSON object it returns [object Object].
The only way I managed to get it to work again is to reload node-red.

randomly stops receiving events

I am having issues where randomly your node stops receiving events from the hub and NodeRed must be restarted.
Is there a way for you to implement an input that would restart/reset the connection to the hub?

Thanks!

Node Red Version

Hi friend,
is it possible to run this Contrib on NodeRed 1.2.9?
There is an NodeRed Addon that isnt maintained and it still runs on 1.2.9
Quite a lot of people use it in Germany. I tried to install today,it failed for the reason that your contrib needs 2.x something

Can you lower the Version that is needed for this contrib, or has your contrib a dependence from higher NodeRed Versions?

Greetings
Andreas

Short question: why node-red >=2.2.2 ?

First, thanks for your great work.

Your package.json contains the following limitation
"node-red": {
"version": ">=2.2.2",

Is there any 2.2.2 specific feature that you use in your nodes or why do you need that? Could it be >2.0.0, too?

No http link to repo in package.json

Hi, package.json does not have a link back to this repo making it difficult for users to locate it (for leaving feedback/issues)

Typically, a package would contain...

    "homepage": "https://github.com/yadomi/node-red-contrib-philipshue-events/readme.md",
    "repository": {
        "type": "git",
        "url": "git+"https://github.com/yadomi/node-red-contrib-philipshue-events"
    },
    "bugs": {
        "url": "https://github.com/yadomi/node-red-contrib-philipshue-events/issues/"
    },

Additionally (and I am unsure if there is something odd in your readme.md, related to missing homepage, a flows lib issue or a combination of the above) but there is no documentation shown in the flow library (see here: https://flows.nodered.org/node/@yadomi/node-red-contrib-philipshue-events)

Thanks.

[BUG] Update failed

Describe the bug
NodeRed reported to me that I could update @yadomi/node-red-contrib-philipshue-events. After updating I restarted NodeRed. After that the node was unfortunately not installed any more.
Reinstalling leads to the following error message:
image

Environment (please complete the following information):
I'm using NodeRed running on a CCU3 in the latest version.

How can I solve that?
Thanks in advance.

API Stable

Hi there, I am having a hard time getting the events from my bridge, is it the same for you? I am just using Postman for debug for now

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.