maxwellhadley / node-red-contrib-rfxcom

node-RED nodes to access an RFXtrx433 transceiver
BSD 2-Clause "Simplified" License
22 stars 13 forks source link

Beginner needs help #63

Closed UweNB closed 5 years ago

UweNB commented 5 years ago

Hello, Max,

I have a question about rfx-PT2262-Out.

I would like to generate a specific response to a specific key. The key has the hex code 0x415530. How can I now configure it so that only the hex code is processed further? At the moment all keys are responded to. Here is the flow:

[{"id": "e8be0747.6493d", "type": "rfx-PT2262-in", "z": "abd77222.a1052", "name":""", "port": "e7117e44.79977", "deviceList": "95e4b51c.e02458", "topicSource": "all", "topic":""", "x":261, "y":856, "wires":[["2a9d33dd.69152"c", "56dcf956.911288"]]},{"id": "2a9d33dd.69152"c", "type": "debug", "z": "abd77222.a1052", "name":""", "active":true, "tosidebar":true, "console":false, "tostatus":false, "complete": "false", "x":492, "y"":789, "wires":[]},{"id": "ac0652a1.220638", "type": "MiLight", "z": "abd77222.a1052", "name": "MiLight", "bridgetype": "legacy", "bulbtype": "rgbw", "zone": "4", "ip": "192.168.1.55", "broadcast":true, "x":746, "y"":853, "wires":[]},{"id": "56dcf956.911288", "type": "function", "z": "abd77222.a1052", "name": "On", "func": "msg.payload=\"on\"\nreturn msg;\n", "outputs":1, "noerr":0, "x":567, "y":853, "wires":[["ac0652a1.220638"]]},{"id": "dc78b566.60114", "type": "comment", "z": "abd77222.a1052", "name": "Only Milight-ON, if address 0x415530", "info": "Only Milight-ON, if address 0x415530", "x":524, "y":896, "wires":[]},{"id": "e7117e44.79977", "type": "rfxtrx-port", "z"":""", "port":"/dev/ttyUSB0", "rfyVenetianMode": "EU"},{"id": "95e4b51c.e02458", "type": "PT2262-device-list", "z":""", "name": "redbutton", "devices":[{"device":["redbutton"], "payload": "On", "rawData": "0x415530", "pulseWidth":350}]}]

What do I have to do, that only a certain key (=hex code) causes a reaction?

Thank you very much!

Translated with www.DeepL.com/Translator

maxwellhadley commented 5 years ago

I cannot paste your flow into Node-RED. You need to use the 'insert code' feature, the '< >' icon just above the edit box on the issue page, to preserve all the formatting needed for this.

However, I think I understand what is going on, and it looks like I have made an error in handling PT2262 device lists on the input side, which means they will never match if the raw data contains any hexadecimal character from a to f. I will fix this and publish an update soon

maxwellhadley commented 5 years ago

Version 2.6.2 which I have just published to npm should fix this issue. Please update your Node-RED system and check!

UweNB commented 5 years ago

hello max

unfortunately the update fails. no matter if via "manage" or npm installation.

npm WARN node-red-project@0.0.1 No repository field. npm WARN node-red-project@0.0.1 No license field.

npm ERR! path /home/pi/.node-red/node_modules/node-red-contrib-rfxcom/node_modules/.bin/find-rfxcom npm ERR! code EEXIST npm ERR! Refusing to delete /home/pi/.node-red/node_modules/node-red-contrib-rfxcom/node_modules/.bin/find-rfxcom: is outside /home/pi/.node-red/node_modules/node-red-contrib-rfxcom/node_modules/rfxcom and not a link npm ERR! File exists: /home/pi/.node-red/node_modules/node-red-contrib-rfxcom/node_modules/.bin/find-rfxcom npm ERR! Move it away, and try again.

npm ERR! A complete log of this run can be found in: npm ERR! /home/pi/.npm/_logs/2018-12-02T10_17_03_063Z-debug.log

Here´s the flow, i hope you can import it now:

[{"id":"e8be0747.6493d","type":"rfx-PT2262-in","z":"abd77222.a1052","name":"redbutton","port":"e7117e44.79977","deviceList":"95e4b51c.e02458","topicSource":"all","topic":"","x":261,"y":856,"wires":[["56dcf956.911288"]]},{"id":"2a9d33dd.69152c","type":"debug","z":"abd77222.a1052","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":757.0000228881836,"y":782.000072479248,"wires":[]},{"id":"ac0652a1.220638","type":"MiLight","z":"abd77222.a1052","name":"MiLight","bridgetype":"legacy","bulbtype":"rgbw","zone":"4","ip":"192.168.1.55","broadcast":true,"x":746,"y":853,"wires":[]},{"id":"56dcf956.911288","type":"function","z":"abd77222.a1052","name":"redbutton","func":"msg.payload=\"on\"\nreturn msg;\n","outputs":1,"noerr":0,"x":445,"y":856,"wires":[["2a9d33dd.69152c","ac0652a1.220638"]]},{"id":"dc78b566.60114","type":"comment","z":"abd77222.a1052","name":"Only Milight-ON, if Adress 0x415530","info":"Only Milight-ON, if Adress 0x415530","x":592.9999694824219,"y":907.0000677108765,"wires":[]},{"id":"e7117e44.79977","type":"rfxtrx-port","z":"","port":"/dev/ttyUSB0","rfyVenetianMode":"EU"},{"id":"95e4b51c.e02458","type":"PT2262-device-list","z":"","name":"redbutton","devices":[{"device":["redbutton"],"payload":"On","rawData":"0x415530","pulseWidth":440}]}]

maxwellhadley commented 5 years ago

I have published 2.6.3 as a temporary measure - this just removes the utility scripts and hopefully it should install without error

UweNB commented 5 years ago

Same Resultat, sorry

npm WARN node-red-project@0.0.1 No repository field. npm WARN node-red-project@0.0.1 No license field.

npm ERR! path /home/pi/.node-red/node_modules/node-red-contrib-rfxcom/node_modules/.bin/find-rfxcom npm ERR! code EEXIST npm ERR! Refusing to delete /home/pi/.node-red/node_modules/node-red-contrib-rfxcom/node_modules/.bin/find-rfxcom: is outside /home/pi/.node-red/node_modules/node-red-contrib-rfxcom/node_modules/rfxcom and not a link npm ERR! File exists: /home/pi/.node-red/node_modules/node-red-contrib-rfxcom/node_modules/.bin/find-rfxcom npm ERR! Move it away, and try again.

npm ERR! A complete log of this run can be found in: npm ERR! /home/pi/.npm/_logs/

Zippey commented 5 years ago

Hello, I don't know if this is the same problem, but when I try to install your module in the manage palette menu, I get an error. See below:

8-12-2018 14:12:17 msg : string[54] "Installation of module node-red-contrib-rfxcom failed:" 8-12-2018 14:12:18 msg : string[42] "------------------------------------------" 8-12-2018 14:12:19 msg : string[1661] "↵> @serialport/bindings@2.0.3 install /config/node-red/node_modules/@serialport/bindings↵> prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild↵↵prebuild-install WARN install No prebuilt binaries found (target=8.14.0 runtime=node arch=arm platform=linux)↵gyp ERR! build error ↵gyp ERR! stack Error: not found: make↵gyp ERR! stack at getNotFoundError (/usr/lib/node_modules/npm/node_modules/which/which.js:13:12)↵gyp ERR! stack at F (/usr/lib/node_modules/npm/node_modules/which/which.js:68:19)↵gyp ERR! stack at E (/usr/lib/node_modules/npm/node_modules/which/which.js:80:29)↵gyp ERR! stack at /usr/lib/node_modules/npm/node_modules/which/which.js:89:16↵gyp ERR! stack at /usr/lib/node_modules/npm/node_modules/isexe/index.js:42:5↵gyp ERR! stack at /usr/lib/node_modules/npm/node_modules/isexe/mode.js:8:5↵gyp ERR! stack at FSReqWrap.oncomplete (fs.js:152:21)↵gyp ERR! System Linux 4.14.78-v7↵gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/..." 8-12-2018 14:12:20 msg : string[42] "------------------------------------------"

maxwellhadley commented 5 years ago

That looks to me like the system does not have development tools installed, or not on the path:

gyp ERR! stack Error: not found: make

The error is coming from which.js, which is trying to find the make utility. I don't think this is anything to do with the node itself

Zippey commented 5 years ago

That looks to me like the system does not have development tools installed, or not on the path:

gyp ERR! stack Error: not found: make

The error is coming from which.js, which is trying to find the make utility. I don't think this is anything to do with the node itself

Thanks for your reply. I'm running Node Red on Home Assistant. Since Home Assistant runs in a contained enviroment, I don't know how I can install the development tools for this module (I just started to use HA and Node Red). But thanks anyway.

UweNB commented 5 years ago

I have now updated it to version 2.6.3 Now the button is specified as "Alarm" in the payload and not as before the hexcode. RFXcom:

09.12.2018 01:46:40:916 Packet type = Security1 subtype = X10 security Sequence nbr = 1 id1-3 = 415530 decimal:4281648 status = Alarm battery level = OK Signal level = 8 -56dBm

Node Red now:

9.12.2018, 13:58:03node: 947a9a99.e3825 X10_DOOR/0x415530 : msg : Object object topic: "X10_DOOR/0x415530" status: object payload: "Alarm"

How can I do it that the hexcode 0x415530 is in the payload again?

maxwellhadley commented 5 years ago

That looks like you have the X10 receive protocol enabled in the RFXtrx433E, and the actual signal from your device can be decoded as either (X10) Security1 or Lighting 4. It looks like if you have X10 enabled, it 'wins' over Lighting4 (this is controlled by the RFXCOM firmware, not the nodes). Presumably you have used an rfx-detector-in node to respond to the Security1 packet from the RFXtrx433E.

I think you may need to disable the X10 protocol in the RFXtrx433E, using rfxmngr.exe, to restore rfx-PT2262-in (Lighting4) operation. Alternatively, if you need X10 reception, you can use an rfx-detector-in node set to respond only to address X10_DOOR/0x415530, followed by a change node configured to change a payload of "alarm" to a payload of "On"

UweNB commented 5 years ago

hello maxwell

that's correct! I had experimented a bit with the settings in rfxmgr and didn't seem to disable X10. Now everything works again as intended! Thank you very much!

maxwellhadley commented 5 years ago

Have you got the rfx-PT2262-in node to respond only to the correct data now? If so, I'll close this issue.

UweNB commented 5 years ago

Hello, Maxwell,

can't test it right now since I'm sick. But please close it, I am already struggling through ... somehow I already get it to run.

Thank you!

maxwellhadley commented 5 years ago

OK, I will close it now. Get well soon!