Code Monkey home page Code Monkey logo

Comments (15)

oehm2007 avatar oehm2007 commented on June 8, 2024 1

Works perfect now in my flow as well. Even the short released and holded function. Just amazin work again.
By the way I`m really interested in a decent use of my dashbuttons. Just because you mentioned your use of them.
I tried some done packages of github, but actually the results were not satisfying at all.
Cheers

from node-red-contrib-huemagic.

lespatots avatar lespatots commented on June 8, 2024 1

from node-red-contrib-huemagic.

oehm2007 avatar oehm2007 commented on June 8, 2024

I added a dimmer switch in my flow, but its not working. There is just a constant connection error, and I couldnt get anything out of the node.

from node-red-contrib-huemagic.

Foddy avatar Foddy commented on June 8, 2024

Hm.. thanks for your feedback. I followed the API guidelines but unfortunately I don’t own those devices so I am unable to debug this errors. Instead I am using a combination between Amazon Dash Buttons, Alexa and the motion sensors, but I guess this is another topic...

Can you guys help me out to debug this? Do you get any “native” errors in your Logs when you start / restart Node RED with some of the Hue Tap or Hue Switch nodes preconfigured?

from node-red-contrib-huemagic.

lespatots avatar lespatots commented on June 8, 2024

from node-red-contrib-huemagic.

lespatots avatar lespatots commented on June 8, 2024

from node-red-contrib-huemagic.

Foddy avatar Foddy commented on June 8, 2024

Thanks for that @lespatots!

Unfortunately there is not enough information that could help me out with debugging the Switch node.
Could you please update nodered/node_modules/node-red-contrib-huemagic/red/hue-switch.js by adding this code snippet at line 118 right after the catch argument and restart Node RED? This should hopefully give some more information after you use the node (for example with trying to tap on a button on your Hue Switch). Thank you in advance!

scope.error(error);

It should then look like this:

[…]
.catch(error => {
	scope.error(error);
	scope.status({fill: "red", shape: "ring", text: "connection error"});
});

Regarding your second question – you're right, it's something you would call habit or "code style". I use this operator to get the last button code from the registry or to strictly define the variable with the boolean false. Otherwise I get an "undefined" variable on JS which I don't like to check on "if" clauses.

from node-red-contrib-huemagic.

lespatots avatar lespatots commented on June 8, 2024

from node-red-contrib-huemagic.

oehm2007 avatar oehm2007 commented on June 8, 2024

3 Dec 17:03:15 - [error] [hue-switch:Schalter Schlafzimmer] TypeError: Cannot read property 'toString' of undefined
3 Dec 17:03:18 - [error] [hue-switch:Schalter Schlafzimmer] TypeError: Cannot read property 'toString' of undefined
3 Dec 17:03:21 - [error] [hue-switch:Schalter Schlafzimmer] TypeError: Cannot read property 'toString' of undefined
3 Dec 17:03:24 - [error] [hue-switch:Schalter Schlafzimmer] TypeError: Cannot read property 'toString' of undefined

from node-red-contrib-huemagic.

Foddy avatar Foddy commented on June 8, 2024

Oh okay I guess I found it.... -_-

It's not "sensor.state.buttonevent", it is "sensor.state.buttonEvent".
Sorry for that. Just released a fix (1.2.2). Can you confirm that it's working now?

(I should probably buy one for the future)

from node-red-contrib-huemagic.

lespatots avatar lespatots commented on June 8, 2024

from node-red-contrib-huemagic.

Foddy avatar Foddy commented on June 8, 2024

Awesome! Thank you for helping me out with this error.

@oehm2007 I really recommend "hacking" Amazon's Dash buttons for some special use cases but not as an Hue Switch / Tap replacement – since it takes some time to find them on your network and run your flows (about 3-7 seconds for me). If you don't care about this latency you could do things like this for example with this awesome node:

example

This flow deactivates the Hue motion sensor for an hour and dims down the lights on my living room, so I can Netflix and chill without being interrupted by bright lights just because I moved a centimeter ;)!

from node-red-contrib-huemagic.

lespatots avatar lespatots commented on June 8, 2024

from node-red-contrib-huemagic.

oehm2007 avatar oehm2007 commented on June 8, 2024

@oehm2007 I really recommend "hacking" Amazon's Dash buttons for some special use cases but not as an Hue Switch / Tap replacement – since it takes some time to find them on your network and run your flows (about 3-7 seconds for me). If you don't care about this latency you could do things like this for example with this awesome node:

Yes you`re definetly right. I already tried some stuff with the dashbutton, but after a little while they were just ignoring my comands. Even finding the buttons in the network isnt that easy :-) But I will try to give it a second chance, because of your example.

Unfortunatelly I have a last little issue, with the dimmer switches. I just noticed, that there is a small higher latency in the reaction of the lamps, controllinmg them by the dimmer switch through node-red. The switches connected straight to the hue-bridge without node-red reacts maybe 1.5s faster. I just made a comparison. (In node red is just an easy function between the button and the lamp )

Do you know, maybe how to speed that up a little bit? Its complaining on a high comfort level, but maybe youve got an idea.

from node-red-contrib-huemagic.

Foddy avatar Foddy commented on June 8, 2024

@oehm2007 I know what you mean. Unfortunately the Philips Hue API doesn't offer any real time communication with the bridge and devices. That means that HueMagic has to periodically check on the bridge if there are "updates" available.

But you could indeed try to modify your "Poll interval" setting in your Hue Bridge node to a lower number. Maybe 1000 (1 second) or 2000 (2 seconds), which means that HueMagic will check every second (or every two seconds) if you tapped a button on your Hue Switch/Tap and fire up your flow much faster.

config

I don't recommend to go lower than that. This could lead to problems on your Hue Bridge, NodeRED Host or even on your local network.

from node-red-contrib-huemagic.

Related Issues (20)

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.