sushilks / node-red-contrib-lutron

Node for Lutron devices on node-red
Apache License 2.0
3 stars 8 forks source link

What's the difference between these nodes and nodered-lutron-caseta? #5

Open ashokaiyar opened 3 years ago

ashokaiyar commented 3 years ago

https://www.npmjs.com/package/nodered-lutron-caseta

Appears to be a direct copy of these nodes that is attributed to someone else (castanhinha1). I might be wrong, but I am just bringing it to your attention.

structure7 commented 3 years ago

@ashokaiyar I saw this too. Side note/question (I don't know who else to ask) are you able to use this to control Lutron Caseta devices? I don't see contact info for castanhinha1 and there are no docs. I'm able to see monitoring output in the Lutron Integration Protocol format, but not sure how to send commands... tried json formatted string, a plain string like you'd format in telnet... no luck. I can control via telnet on pc however.

Edit: cancel that! Picked through the js enough to see that I need to use mapping. Was hoping to just keep ALL/0 in place and send the id programmatically.

sushilks commented 3 years ago

thanks for point it out @ashokaiyar I was not aware of it. It's opensource work so folks can copy not sure what can be done.

@structure7 I am using this module to control Lutron Caseta in my house, in fact, I have multiple Caseta hubs on it. If you found a better way to program or accept input please feel free to do a pull request.

ashokaiyar commented 3 years ago

@sushilks - I agree; however, it would have been polite for him to have forked it, so any potential changes could be added back to the master branch. As it is, it seems like direct theft - he has removed all attribution to you and also changed the license.

@structure7, I also use this with a Lutron Caseta Pro hub - works great with Node-RED.

accribbs commented 3 years ago

@structure7 @sushilks I have the same issue; that is, none of the formats I've tried for a command work to control the devices. I receive responses from the status node when triggering devices from the Lutron app and have added those devices with a name (same name as in Lutron app) and received device_id to the device mapping table. I can control those devices with a telnet connection directly to the Lutron hub with no problems. I created a new Lutron control node with a Lutron config of one of the named devices thinking that's what @structure7 meant with the mapping comment --"...Picked through the js enough to see that I need to use mapping..." I see in the control js code where I'm getting the error: if (!isNaN(msg.payload)) { configNode.sendLutronCommand(this.devId, msg.payload); } else { console.log('Error could not converted input value to number val=' + msg.paylaod); <--- getting this error** }

I'm enough unfamiliar with .js and still a newby with node-red such that I don't know what is false in (!isNaN(msg.payload)). The message.payload is of type string and looks like "#output,2,1,100".

I'm stuck! Any comments, help would be appreciated.

** - Error from node-red-log is actually: "Error could not converted input value to number val=undefined" I notice + msg.paylaod is misspelled so undefined.

accribbs commented 3 years ago

@structure7 @sushilks I have the same issue; <<< snip >>>

On further inspection of the code I realized my error: It is only necessary to include the value in the msg payload. For example: "100" rather than the full Lutron command string of "#output,2,1,100" to turn on device 2 to 100%. The device id is provided by a specific Lutron config in the device mapping table and only action codes of 1 can be performed.

structure7 commented 3 years ago

@accribbs, I too was trying the Lutron Integration Protocol as msg.payload at first. Once I mapped the devices it was trial and error, but works and has been solid. Just a heads up you may need to do a node-red-restart if you power cycle the gateway.