maxwellhadley / node-red-contrib-rfxcom

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

Need help (Beginner) #21

Closed UweNB closed 6 years ago

UweNB commented 6 years ago

Hello Max, Hello All

I can not go on with Nodered. Node-red-contrib-rfxcom is installed and running. How can I now reproduce the codes of the radio remote control? On Windows, I can read them out, see here:

19.08.2017 13:53:16

19.08.2017 13:53:16 Packettype = UNDECODED RF Message UNDECODED ARC: 1F8AA204F8

How can I send this code? You are a professional - can you please generate a simple flow for me? I can take this as an example and get involved.

Many Thanks!

maxwellhadley commented 6 years ago

From the message you gave, It looks like you have a an ARC sub-type device. These are received by the RFXtrx433E if the ARC received protocol is enabled, as lighting1 messages. To get the remote codes, place an rfx-lights-in node in your flow, configured to 'listen for commands sent to any address', and connect its output to a debug node, set to show 'complete msg object'. Deploy your flow, wait for the connection status on the rfx-lights-in node to turn green, and press a button on your remote control. You should see the received message appear in the debug tab, it should look something like this:

19/08/2017, 19:12:23node: 8fec6fdc.a643
ARC/A/7 : msg : Object
{ status: object, topic: "ARC/A/7", payload: "On", _msgid: "71896b5b.c03084" }

The message topic is the 'address' your remote control is sending to. It is composed of ARC - the device sub-type code - followed by the house code 'A' and unit number '7' as set by the switches on the unit being controlled. The command being sent is in the message payload, in this case 'On'.

If you send a message with the same combination of topic & payload to an rfx-lights-out node, set to 'get address from message topic', it will reproduce the effect of pressing the button on the remote control. Change the payload to 'Off' to switch off. (If you replace the unit number in the topic with 0, it will send a 'group' command to all units with the same house code.)

There is one tiny catch - the ARC protocol sub-type is also used by some wireless door chimes. If you are trying to listen for one of these you will need to use rfx-doorbell-in & rfx-doorbell-out nodes in the appropriate places.

I hope this helps!

UweNB commented 6 years ago

Thx Max for your help!

Unfortunately, I can not test it. In the firmware of the RFXtrx433E seems to be an bug. To receive my remote I need "undec on". Unfortunately, this setting is lost when you switch from the PC to the Rasp. There is probably no program which can make the settings under Raspian.

I'm in despair.

Have a nice day! Florian

maxwellhadley commented 6 years ago

If you still have 'undec on' set, that will stop it working! If 'undec on' is enabled, the RFXtrx sends out the 'undecoded' message instead of the 'lighting1' message that rfx-lights-in is looking for. Like it says in the user guide, 'undec on' should never be enabled in normal use. If a protocol is not enabled for reception, setting 'undec on' does not mean that it will be received!

This is not very well explained in the User Guide!

You need to make sure you have the 'ARC' protocol enabled and 'undec on' disabled - you control this from the "main' tab of RfxMgr. Click the Set Mode button to send the current settings to the RFXtrx, then when you are happy you have the right settings, click the Save Settings button. Clicking this will write the settings to non-volatile memory in the RFXtrx, so that when you move it to your Rasberry Pi, it is still set up correctly.

To check it is set up correctly, disconnect it from your PC, then plug it back in and with the RFXtrx connected to RfxMgr, press your remote control button: it should generate a message something like this:

------------------------------------------------
------------------------------------------------
Packettype    = Lighting1
subtype       = ARC
Sequence nbr  = 3
housecode     = A
unitcode      = 5
Command       = On
Signal level  = 7  -64dBm

You may get different values to these, but it should be a Lighting1 packet of subtype ARC. In Node-RED, you would send this exact same radio message by sending a Node-RED message with topic = ARC/A/5, and payload = On to an rfx-lights-out node.

Currently there is no program to change these settings that runs on Linux. In theory, you can run RfxMgr under Mono, but I have not tried this. The node-rfxcom package that is used by node-red-contrib-rfxcom does have an API to change the settings, but at the moment you have to write your own Javascript program to do so. I am currently writing such a program, which will be included in a future version of the node-rfxcom package.

What is the manufacturer and model number of the device you are trying to control?

UweNB commented 6 years ago

Unfortunately, the remote control is probably not supported. Is an ELRO AB440S.

I have another one here. Type "Intertechno YT-100". This is detected in Nodered. Unfortunately, I do not receive the code - despite your description. By the way, my rain gauge, wind and temperature of my weather station is also determined :)

I have attached my flow below.

Sure you find the error of sending immediately;)

I thank you expressly for your help Max! I am already older (69 years) - but thanks to your help makes learning enjoyable despite the setbacks! Thanks a lot for this!

flow: [{ "Id": "352203dc.62093c", "type": "rfx-lights-in", "z", "a92b528c.0b5f", "name": "", "port", "f707d8dc.1a2508" "topic source": "all", "topic": "", "x": 141, "y": 122, "wires" [[ "d7d24532.875e38"]]}, { "id": "d7d24532 .875e38 "," type ":" debug "," z "," a92b528c.0b5f "," name ":" "," active ": true," console ":" false "," complete ":" true " "x": 436, "y": 243, "wires": []}, { "id": "e83b70a0.48f08", "type": "RFX PT2262-in", "z": "a92b528c .0b5f "," name ":" "," port "," f707d8dc.1a2508 "," device list ":" 6b57a052.a9b05 "," topic source ":" all "," topic ":" "," x ": 127, "y": 207, "wires" [[ "d7d24532.875e38"]]}, { "id": "d2de383e.644a28", "type": "rfx-lights-out", "z": "a92b528c.0b5f", "name": "", "port", "f707d8dc.1a2508", "topic source": "msg", "retransmit": "none", "retransmitInterval": 20, "topic": " "," x ": 615," y ": 375," wires ": []}, {" id ":" e2f170fd.8329c "," type "," inject "," z ":" a92b528c.0b5f " , "name": "", "topic": "", "payload": "", "PayloadType": "date", "repeat": "", "crontab": "", "once": false, "x": 126, "y": 372 "wires" [[ "33fae98.94be216"]]}, { "id": "33fae98.94be216", "type", "function", "z": "a92b528c.0b 5f "," name ":" untitled theme 1 "," func ":" return {\ n topic: 'ARC / M / 1', \ n payload: 'On' \ n _msgid: \ "6160437e.b3f7ec \" \ n} "," outputs "1," noerr ": 3," x ": 376," y ": 374" wires "[[" d2de383e.644a28 "]]}, {" id ":" f707d8dc.1a2508 "," type ":" rfxtrx-port "," port "," / dev / ttyUSB0 "}, {" id ":" 6b57a052.a9b05 "," type ":" PT2262-device-list " "z", "", "name": "", "devices": [{ "device": [ "PT2262"], "payload": "", "rawData", "0x1", "pulse width": 350 }]}]

maxwellhadley commented 6 years ago

I don't have one myself, but some Googling shows the ELRO devices seem to be rather odd. You may be able to receive the signals from the remote controller using an rfx-PT2262-in node, but that isn't going to help you much. Judging by what is in the user guide on page 29 (section 7.3) you will need to send a message to your rfx-lights-out node with a topic like 'ELRO/housecode/unitcode' and payload 'On' or 'off', where housecode is a letter A to P and unitcode is a number 1 to 32. The letter and number you need depend on the DIP switch settings of the unit you are trying to control. There is a table in the user guide on page 29 giving the letter & number corresponding to the switches.

The message here may also be helpful, although it is talking about a different software program, not Node-RED, the principles are the same.

The Intertechno I'm not sure about. I did find a reference that it was compatible with the Conrad RSL series, but they have their own protocol that must be enabled for reception in RfxMgr, and you say these are received by Node-RED - what is the output from the debug node when this happens.

I looked at your flow, but something seems to have altered the text and it will not load, as it is no longer in a valid format. One thing I do notice, you are using a function node to set the message payload and topic - you don't need to do this, you can set both directly in the inject node. Set the payload type to 'string' and type in On or Off as appropriate, and type the topic in the box immediately below.

UweNB commented 6 years ago

I got the set of the company "Brennenstuhl" RCS 2044N concerned. This is directly supported by Spec. I have switch the Socket 1 on and off. You can find the code of the Windows program RFXmngr below. Also for a radio thermometer and a magnetic switch (door / window)

The link is an image host with a screenshot. Maybe it will help you. I do not get it to send the recorded code again. The first two values ​​come from the door / window contact. Then 2 times thermometer, 4 times "send" to socket 1 and 2 x "socket off" code. The flow should now also be importable. No idea where the error was when exporting ...

Thx 4 you advice, Max

Door/Window-Magnet-Switch

Packettype = Lighting4 subtype = PT2262 Sequence nbr = 2 Code = 8C1BF6 decimal:9182198 S1- S24 = 1000 1100 0001 1011 1111 0110 Pulse = 329 usec Signal level = 8 -56dBm

Thermometer:

Packettype = TEMP_HUM subtype = TH7 - Cresta, TFA TS34C channel 1 Sequence nbr = 0 ID = 2F0E decimal:12046 Temperature = 21,3 °C Humidity = 58 Status = Comfortable Signal level = 5 -80dBm Battery = OK Signal level = 5 -80dBm Battery = OK

Socket ON


Packettype = Lighting4 subtype = PT2262 Sequence nbr = 48 Code = 400551 decimal:4195665 S1- S24 = 0100 0000 0000 0101 0101 0001 Pulse = 327 usec Signal level = 8 -56dBm


Packettype = Lighting4 subtype = PT2262 Sequence nbr = 49 Code = 40155F decimal:4199775 S1- S24 = 0100 0000 0001 0101 0101 1111 Pulse = 324 usec Signal level = 8 -56dBm

Socket OFF


Packettype = Lighting4 subtype = PT2262 Sequence nbr = 50 Code = 400554 decimal:4195668 S1- S24 = 0100 0000 0000 0101 0101 0100 Pulse = 320 usec Signal level = 8 -56dBm


Packettype = Lighting4 subtype = PT2262 Sequence nbr = 51 Code = 40155F decimal:4199775 S1- S24 = 0100 0000 0001 0101 0101 1111 Pulse = 322 usec Signal level = 8 -56dBm

Flow [{"id":"24d3c51e.ba4e7a","type":"rfx-sensor","z":"a92b528c.0b5f","name":"","port":"976b5d73.52c6d","topicSource":"single","topic":"","x":200,"y":346,"wires":[["ab1a814d.d384e"]]},{"id":"912b504c.7e557","type":"rfx-lights-in","z":"a92b528c.0b5f","name":"","port":"976b5d73.52c6d","topicSource":"all","topic":"","x":193,"y":198,"wires":[["ab1a814d.d384e"]]},{"id":"ab1a814d.d384e","type":"debug","z":"a92b528c.0b5f","name":"","active":true,"console":"true","complete":"true","x":484,"y":316,"wires":[]},{"id":"64e18450.ab88fc","type":"rfx-doorbell-in","z":"a92b528c.0b5f","name":"","port":"f707d8dc.1a2508","topicSource":"all","topic":"","x":204,"y":396,"wires":[["ab1a814d.d384e"]]},{"id":"7825da83.bafb74","type":"rfx-PT2262-in","z":"a92b528c.0b5f","name":"","port":"976b5d73.52c6d","deviceList":"48260737.47f268","topicSource":"all","topic":"","x":201,"y":459,"wires":[["ab1a814d.d384e"]]},{"id":"8b92d334.56bed","type":"rfx-lights-out","z":"a92b528c.0b5f","name":"","port":"f707d8dc.1a2508","topicSource":"msg","retransmit":"none","retransmitInterval":20,"topic":"","x":814,"y":563,"wires":[]},{"id":"18b0aa2b.62d8e6","type":"inject","z":"a92b528c.0b5f","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":241,"y":554,"wires":[["af7a2e37.b9d9d"]]},{"id":"af7a2e37.b9d9d","type":"function","z":"a92b528c.0b5f","name":"Untitled Theme 1","func":"return {\n topic: 'ARC/M/1',\n payload: '6160437e.b3f7ec'\n \n \n}","outputs":1,"noerr":0,"x":538,"y":559,"wires":[["8b92d334.56bed"]]},{"id":"e09a050f.7727b8","type":"rfx-meter","z":"a92b528c.0b5f","name":"","port":"f707d8dc.1a2508","topicSource":"all","topic":"","x":197,"y":249,"wires":[["ab1a814d.d384e"]]},{"id":"ecb89a2.c197d68","type":"rfx-detector-in","z":"a92b528c.0b5f","topicSource":"all","topic":"","x":189,"y":299,"wires":[["ab1a814d.d384e"]]},{"id":"976b5d73.52c6d","type":"rfxtrx-port","port":"/dev/ttyUSB0"},{"id":"f707d8dc.1a2508","type":"rfxtrx-port","port":"/dev/ttyUSB0"},{"id":"48260737.47f268","type":"PT2262-device-list","z":"","name":"asc","devices":[{"device":["PT2262"],"payload":"TH1/0x8E01","rawData":"0x0","pulseWidth":350}]}]

UweNB commented 6 years ago

Sorry, the link is missing. https://picload.org/view/rwcplwri/formax.png.html

maxwellhadley commented 6 years ago

Hi - sorry for the long delay in replying, I've been very busy.

I'm still not quite sure what you are doing here. As I understand it, you have a remote controller type Brennenstuhl RCS 2044N which is being received by RfxMgr as a Lighting4 device. You show two 'on' messages and two 'off' messages (presumably these did actually switch the remote controlled socket on and off). However, although the two 'off' messages are the same (except for a minor difference in pulse width, which is not significant), the two 'on' messages have different data:

On (1):  0x400551
On (2):  0x400554
Off (1): 0x40155F
Off (2): 0x40155F

This might be because the control does actually send different codes, or because the radio format is slightly non-standard and the the RFXtrx433E has difficulty decoding it, or for some other reason. Ignoring this problem, I have made a little flow that shows you how to send these messages from node-RED:

[{"id":"15fba54f.00eb6b","type":"tab","label":"Flow 2"},{"id":"196241e4.5f90de","type":"rfx-PT2262-out","z":"15fba54f.00eb6b","name":"","port":"38cca044.fc7bd","deviceList":"466753c9.1c74dc","topicSource":"msg","retransmit":"none","retransmitInterval":20,"topic":"","x":383,"y":101,"wires":[]},{"id":"845afe98.50c4d","type":"inject","z":"15fba54f.00eb6b","name":"","topic":"TEST/SOCKET/1","payload":"On","payloadType":"str","repeat":"","crontab":"","once":false,"x":130,"y":60,"wires":[["196241e4.5f90de"]]},{"id":"bb177b6b.940eb8","type":"inject","z":"15fba54f.00eb6b","name":"","topic":"TEST/SOCKET/1","payload":"Off","payloadType":"str","repeat":"","crontab":"","once":false,"x":130,"y":140,"wires":[["196241e4.5f90de"]]},{"id":"68e4679f.097008","type":"rfx-sensor","z":"15fba54f.00eb6b","name":"","port":"38cca044.fc7bd","topicSource":"all","topic":"","x":100,"y":220,"wires":[["3e50aedc.08fb42"]]},{"id":"3e50aedc.08fb42","type":"debug","z":"15fba54f.00eb6b","name":"","active":true,"console":"false","complete":"true","x":370,"y":220,"wires":[]},{"id":"38cca044.fc7bd","type":"rfxtrx-port","port":"/dev/ttyUSB0"},{"id":"466753c9.1c74dc","type":"PT2262-device-list","z":"","name":"Test Devices","devices":[{"device":["TEST","SOCKET","1"],"payload":"Off","rawData":"0x40155f","pulseWidth":325},{"device":["TEST","SOCKET","1"],"payload":"On","rawData":"0x400551","pulseWidth":325}]}]

If I click each of the Inject buttons in turn, I get the following sequence of messages received on RfxMgr (I have two RFXtrx's here for testing, so I'm using one controlled by Node-RED to send the messages and another on a different computer to receive them):

------------------------------------------------
------------------------------------------------
Packettype    = Lighting4
subtype       = PT2262
Sequence nbr  = 0
Code          = 400551 decimal:4195665
S1- S24  = 0100 0000 0000 0101 0101 0001 
Pulse         = 327 usec
Signal level  = 7  -64dBm
------------------------------------------------
------------------------------------------------
Packettype    = Lighting4
subtype       = PT2262
Sequence nbr  = 1
Code          = 40155F decimal:4199775
S1- S24  = 0100 0000 0001 0101 0101 1111 
Pulse         = 324 usec
Signal level  = 7  -64dBm
------------------------------------------------
------------------------------------------------
Packettype    = Lighting4
subtype       = PT2262
Sequence nbr  = 2
Code          = 400551 decimal:4195665
S1- S24  = 0100 0000 0000 0101 0101 0001 
Pulse         = 325 usec
Signal level  = 7  -64dBm
------------------------------------------------
------------------------------------------------
Packettype    = Lighting4
subtype       = PT2262
Sequence nbr  = 3
Code          = 40155F decimal:4199775
S1- S24  = 0100 0000 0001 0101 0101 1111 
Pulse         = 327 usec
Signal level  = 7  -64dBm

As you can see, I have chosen to use the 0x400551 pattern for 'on', and the pulse width is about what you showed - it is not very critical.

The choice of message 'topic' and 'payload' used to send these messages is controlled by the 'Devices' selection in the rfx-PT2262-out node. If you double-click this node, then click the edit button next to the name of the list of devices (which is 'Test devices'), you will see the device list editor. Each entry in this list associates a topic/payload combination with a data pattern and pulse width (these are the same numbers you see in RfxMgr). When the rfx-PT2262-out node receives a message, it uses the message 'topic' & 'payload' to look up a matching entry in the list, and if it finds a match, it sends a radio message with the specified data pattern & pulse width: devicelist

The actual strings you use for 'topic' and 'payload' are completely arbitrary, but it is best to keep to the /-separated format for the topic, as most other nodes expect this. The same thing works in reverse - the rfx-PT2262-in node uses the device list to convert the data into a topic & payload for its output message (the pulse width is ignored).

Hopefully this will give you some help getting your sockets to work with Node-RED, but if you still have ant questions please ask!

UweNB commented 6 years ago

Hello, Max.

I have to apologize! I thank you from the bottom of my heart for your patience with me!

I tried your flow and after adjusting the hex values it works fine now! Thank you very much! Now I have to be diligent - I have at least 10 sockets in use, which I have to program now;)

You gave me the opportunity to ask further questions. I would like to do that.

How can I switch the sockets via the UI? Unfortunately I don't know what to enter under "Button". I'd also like to visualize the readings from the outside sensors.

1.9.2017,18:14:05node: 1b25e892. c27f27 TH3/0x6A01: msg: Object object topic:"TH3/0x6A01" status: object rssi: 6 battery: 0 payload: object temperature: object humidity: object value: 58 unit:"%" _msgid:"8690cb01.1f2fb8"

1.9.2017,18:14:58node: 1b25e892. c27f27 TH3/0x6A01: msg: Object object topic:"TH3/0x6A01" status: object rssi: 6 battery: 0 payload: object temperature: object value: 23.1 unit:"degC" humidity: object value: 58 unit:"%" _msgid:"1e30e2e9. d75c6d

Surely you can help me with your great knowledge! If everything works fine, I would like to make the whole thing visible and controllable on a 10" touchscreen at Raspberry Pi. This is my goal... It is nice to have found a patient and helpful person in you!

An important request: my questions are not really important - so take your time - as it suits you! Greetings!

maxwellhadley commented 6 years ago

OK here is a modified version of the flow, this time adding a dashboard gauge reading the temperature, an 'On' button' an 'Off' button, and as an alternative, an On/Off switch:

[{"id":"196241e4.5f90de","type":"rfx-PT2262-out","z":"15fba54f.00eb6b","name":"","port":"f7e48e28.54285","deviceList":"466753c9.1c74dc","topicSource":"msg","retransmit":"none","retransmitInterval":20,"topic":"","x":510,"y":160,"wires":[]},{"id":"845afe98.50c4d","type":"inject","z":"15fba54f.00eb6b","name":"","topic":"TEST/SOCKET/1","payload":"On","payloadType":"str","repeat":"","crontab":"","once":false,"x":130,"y":100,"wires":[["196241e4.5f90de"]]},{"id":"bb177b6b.940eb8","type":"inject","z":"15fba54f.00eb6b","name":"","topic":"TEST/SOCKET/1","payload":"Off","payloadType":"str","repeat":"","crontab":"","once":false,"x":130,"y":220,"wires":[["196241e4.5f90de"]]},{"id":"68e4679f.097008","type":"rfx-sensor","z":"15fba54f.00eb6b","name":"","port":"f7e48e28.54285","topicSource":"all","topic":"","x":100,"y":360,"wires":[["3e50aedc.08fb42","ecd72f60.21c1c"]]},{"id":"3e50aedc.08fb42","type":"debug","z":"15fba54f.00eb6b","name":"","active":true,"console":"false","complete":"true","x":530,"y":360,"wires":[]},{"id":"ecd72f60.21c1c","type":"change","z":"15fba54f.00eb6b","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.temperature.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":340,"y":460,"wires":[["3e50aedc.08fb42","fe426496.1db6a8"]]},{"id":"68e1aa7a.a30004","type":"inject","z":"15fba54f.00eb6b","name":"Set 16.3˚C","topic":"TH3/0x6A01","payload":"{\"temperature\": {\"value\": 16.3}}","payloadType":"json","repeat":"","crontab":"","once":false,"x":100,"y":420,"wires":[["ecd72f60.21c1c"]]},{"id":"fe426496.1db6a8","type":"ui_gauge","z":"15fba54f.00eb6b","name":"","group":"50e1eb1a.869bf4","order":0,"width":0,"height":0,"gtype":"gage","title":"Gauge","label":"˚C","format":"{{value}}","min":0,"max":"50","colors":["#0f28d3","#0be603","#ca3838"],"seg1":"17","seg2":"25","x":530,"y":480,"wires":[]},{"id":"111aee4c.866c42","type":"ui_button","z":"15fba54f.00eb6b","name":"On button","group":"50e1eb1a.869bf4","order":0,"width":0,"height":0,"passthru":false,"label":"On","color":"","bgcolor":"","icon":"","payload":"On","payloadType":"str","topic":"TEST/SOCKET/1","x":160,"y":40,"wires":[["196241e4.5f90de"]]},{"id":"e3a09424.eaf478","type":"ui_button","z":"15fba54f.00eb6b","name":"Off button","group":"50e1eb1a.869bf4","order":0,"width":0,"height":0,"passthru":false,"label":"Off","color":"","bgcolor":"","icon":"","payload":"Off","payloadType":"str","topic":"TEST/SOCKET/1","x":160,"y":280,"wires":[["196241e4.5f90de"]]},{"id":"87745937.c5b958","type":"ui_switch","z":"15fba54f.00eb6b","name":"On/Off switch","label":"switch","group":"50e1eb1a.869bf4","order":0,"width":0,"height":0,"passthru":true,"decouple":"false","topic":"TEST/SOCKET/1","style":"","onvalue":"On","onvalueType":"str","onicon":"","oncolor":"","offvalue":"Off","offvalueType":"str","officon":"","offcolor":"","x":140,"y":160,"wires":[["196241e4.5f90de"]]},{"id":"8165a630.3b4a18","type":"inject","z":"15fba54f.00eb6b","name":"Set 19.6˚C","topic":"TH3/0x6A01","payload":"{\"temperature\": {\"value\": 19.6}}","payloadType":"json","repeat":"","crontab":"","once":false,"x":100,"y":480,"wires":[["ecd72f60.21c1c"]]},{"id":"c990af70.8a789","type":"inject","z":"15fba54f.00eb6b","name":"Set 25.8˚C","topic":"TH3/0x6A01","payload":"{\"temperature\": {\"value\": 25.8}}","payloadType":"json","repeat":"","crontab":"","once":false,"x":100,"y":540,"wires":[["ecd72f60.21c1c"]]},{"id":"f7e48e28.54285","type":"rfxtrx-port","z":"","port":"/dev/cu.usbserial-A1R1A6A"},{"id":"466753c9.1c74dc","type":"PT2262-device-list","z":"","name":"Test Devices","devices":[{"device":["TEST","SOCKET","1"],"payload":"Off","rawData":"0x40155f","pulseWidth":325},{"device":["TEST","SOCKET","1"],"payload":"On","rawData":"0x400551","pulseWidth":325}]},{"id":"50e1eb1a.869bf4","type":"ui_group","z":"","name":"Default","tab":"e6ee1039.e9cb5","disp":true,"width":"6"},{"id":"e6ee1039.e9cb5","type":"ui_tab","z":"","name":"Home","icon":"dashboard"}]

So what's going on here? Start with the gauge. The gauge node expects to find a numeric value in the payload of the message it receives (it ignores all other message properties). But as you have seen we have a compound object in the payload of the message from the rfx-sensor-in node, which includes the humidity as well as the temperature, and the units of measurement as well as the values of each. We need to change the payload of this message so that it is just the 'value' part of the temperature. We do this using a change node. This is configured to set the 'payload' property of the message going out, to the 'payload.temperature.value' property of the message coming in. The gauge displays this as the temperature. I have added two more inject nodes to allow you to simulate different readings from the sensor, which show as different gauge readings (I have set the 'topic' on the inject nodes to match your temperature sensor, but as I said the topic is ignored by the gauge.)

The two buttons and the switch all work in a similar way. The key points are that the message 'topic' must match what the rfx-PT2262-out device list is expecting, and that the 'payload' must be exactly 'On' or 'Off'. The configuration dialogs for the buttons and switches let you do this, and I have set them up appropriately. The buttons send the same messages as the two matching inject nodes.

One other minor point: in the flow above, the switch does not change position in response to the button presses. To achieve this, we wire the On & Off button outputs to the switch node input instead of directly to the rfx-PT2262-out node, and select 'pass msg through to output' in the switch configuration dialog:

[{"id":"15fba54f.00eb6b","type":"tab","label":"Flow 2"},{"id":"196241e4.5f90de","type":"rfx-PT2262-out","z":"15fba54f.00eb6b","name":"","port":"f7e48e28.54285","deviceList":"466753c9.1c74dc","topicSource":"msg","retransmit":"none","retransmitInterval":20,"topic":"","x":510,"y":160,"wires":[]},{"id":"845afe98.50c4d","type":"inject","z":"15fba54f.00eb6b","name":"","topic":"TEST/SOCKET/1","payload":"On","payloadType":"str","repeat":"","crontab":"","once":false,"x":130,"y":60,"wires":[["196241e4.5f90de"]]},{"id":"bb177b6b.940eb8","type":"inject","z":"15fba54f.00eb6b","name":"","topic":"TEST/SOCKET/1","payload":"Off","payloadType":"str","repeat":"","crontab":"","once":false,"x":130,"y":260,"wires":[["196241e4.5f90de"]]},{"id":"68e4679f.097008","type":"rfx-sensor","z":"15fba54f.00eb6b","name":"","port":"f7e48e28.54285","topicSource":"all","topic":"","x":100,"y":360,"wires":[["3e50aedc.08fb42","ecd72f60.21c1c"]]},{"id":"3e50aedc.08fb42","type":"debug","z":"15fba54f.00eb6b","name":"","active":true,"console":"false","complete":"true","x":530,"y":360,"wires":[]},{"id":"ecd72f60.21c1c","type":"change","z":"15fba54f.00eb6b","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.temperature.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":340,"y":460,"wires":[["3e50aedc.08fb42","fe426496.1db6a8"]]},{"id":"68e1aa7a.a30004","type":"inject","z":"15fba54f.00eb6b","name":"Set 16.3˚C","topic":"TH3/0x6A01","payload":"{\"temperature\": {\"value\": 16.3}}","payloadType":"json","repeat":"","crontab":"","once":false,"x":100,"y":420,"wires":[["ecd72f60.21c1c"]]},{"id":"fe426496.1db6a8","type":"ui_gauge","z":"15fba54f.00eb6b","name":"","group":"50e1eb1a.869bf4","order":0,"width":0,"height":0,"gtype":"gage","title":"Gauge","label":"˚C","format":"{{value}}","min":0,"max":"50","colors":["#0f28d3","#0be603","#ca3838"],"seg1":"17","seg2":"25","x":530,"y":480,"wires":[]},{"id":"111aee4c.866c42","type":"ui_button","z":"15fba54f.00eb6b","name":"On button","group":"50e1eb1a.869bf4","order":0,"width":0,"height":0,"passthru":false,"label":"On","color":"","bgcolor":"","icon":"","payload":"On","payloadType":"str","topic":"TEST/SOCKET/1","x":80,"y":120,"wires":[["87745937.c5b958"]]},{"id":"e3a09424.eaf478","type":"ui_button","z":"15fba54f.00eb6b","name":"Off button","group":"50e1eb1a.869bf4","order":0,"width":0,"height":0,"passthru":false,"label":"Off","color":"","bgcolor":"","icon":"","payload":"Off","payloadType":"str","topic":"TEST/SOCKET/1","x":80,"y":200,"wires":[["87745937.c5b958"]]},{"id":"87745937.c5b958","type":"ui_switch","z":"15fba54f.00eb6b","name":"On/Off switch","label":"switch","group":"50e1eb1a.869bf4","order":0,"width":0,"height":0,"passthru":true,"decouple":"false","topic":"TEST/SOCKET/1","style":"","onvalue":"On","onvalueType":"str","onicon":"","oncolor":"","offvalue":"Off","offvalueType":"str","officon":"","offcolor":"","x":280,"y":160,"wires":[["196241e4.5f90de"]]},{"id":"8165a630.3b4a18","type":"inject","z":"15fba54f.00eb6b","name":"Set 19.6˚C","topic":"TH3/0x6A01","payload":"{\"temperature\": {\"value\": 19.6}}","payloadType":"json","repeat":"","crontab":"","once":false,"x":100,"y":480,"wires":[["ecd72f60.21c1c"]]},{"id":"c990af70.8a789","type":"inject","z":"15fba54f.00eb6b","name":"Set 25.8˚C","topic":"TH3/0x6A01","payload":"{\"temperature\": {\"value\": 25.8}}","payloadType":"json","repeat":"","crontab":"","once":false,"x":100,"y":540,"wires":[["ecd72f60.21c1c"]]},{"id":"f7e48e28.54285","type":"rfxtrx-port","z":"","port":"/dev/cu.usbserial-A1R1A6A"},{"id":"466753c9.1c74dc","type":"PT2262-device-list","z":"","name":"Test Devices","devices":[{"device":["TEST","SOCKET","1"],"payload":"Off","rawData":"0x40155f","pulseWidth":325},{"device":["TEST","SOCKET","1"],"payload":"On","rawData":"0x400551","pulseWidth":325}]},{"id":"50e1eb1a.869bf4","type":"ui_group","z":"","name":"Default","tab":"e6ee1039.e9cb5","disp":true,"width":"6"},{"id":"e6ee1039.e9cb5","type":"ui_tab","z":"","name":"Home","icon":"dashboard"}]

I hope this helps! If you more questions not related directly to node-red-contrib-rfxcom, a very good place to look for help is the Node-RED discussion group: https://groups.google.com/forum/#!forum/node-red

UweNB commented 6 years ago

Hello, Maxwell.

Thank you for your understandable explanation!

I have extended Flow and now I also output the humidity and so on. If you have understood the "system", a lot of things now make sense;) My two final questions: I receive several thermometers etc. - how can I distinguish them? My last question has something to do with RFXCom: Can I only receive the remote control codes if the DIL switch is set to address "1"? I use the "Brennenstuhl RCS2044N"- Set. It would be very unfortunate if one could actually only address a maximum of 4 sockets. Or did I miss something here?

Best regards!

maxwellhadley commented 6 years ago

The simplest way to handle multiple thermometers is to add an rfx-sensor-in node for each one. First, make a note of the different topics you see in the thermometer messages (in the debug panel) and work out out which topic 'address' corresponds to each actual sensor. Next, for each thermometer 'address', configure one of the rfx-sensor-in nodes to 'only listen to addresses matching a pattern', and enter one of the topics. Change the name of this node to something meaningful to you, related the actual sensor or what it is measuring: addresses Now you can wire the output of each node to a dashboard gauge or chart, as you wish.

I am not sure exactly how the Brenenstuhl system works. I downloaded the user manual, and it looks like you can set one of 32 different 'remote control' codes by setting a different combination of the switches 1 to 5 on the remote control, provided you set the same combination of switches in the sockets you want that device to control. Then you set just one of switches A, B, C, or D in the socket itself to select which one of the remote buttons will operate that socket. Once you have done that, you need to 'listen' to the remote controller sending commands to the socket & make a note of the corresponding data values, then enter them in the device list in the same way you did previously.

If you have more than 4 sockets, you need to use an additional 'remote control' code for each set of 4 sockets you want to control. This will give you further data values you can enter in the device list - you can have as many entries as you want, you don't have to have the same 'remote control' code for all of them.

I hope this helps!

UweNB commented 6 years ago

Hello Maxwell,

Many thanks for your help! Per sensor = a separate node I try out.

The problem with the remote control code is solved. I have reset the device via "RFXmgr" (Windows), reinstalled the firmware and now I receive a code at every position of the DIL switch. Perfect! (I read somewhere the days that others also had this problem)

So I can only thank you for your support! Surely other RFXcom users have also benefited from our thread and your answers!

Best regards!

maxwellhadley commented 6 years ago

No problem - have fun!