# Rflink, Node Red and Gladys

**URL:** <https://community.gladysassistant.com/t/rflink-node-red-et-gladys/6844>\
**Category:** Tutoriels\
**Tags:** node-red\
**Created:** [January 22, 2022, 10:51pm UTC](https://community.gladysassistant.com/t/rflink-node-red-et-gladys/6844 "2022-01-22T22:51:45Z")\
**Posts on this page:** 20\
**Page:** 5

<div class="post-metadata">

**Author:** ![cce66](https://gladys-assistant-community.b-cdn.net/letter_avatar_proxy/v4/letter/c/8797f3/32.png) [@cce66](https://community.gladysassistant.com/u/cce66)\
**Post date:** [September 20, 2024, 12:07pm UTC](https://community.gladysassistant.com/t/rflink-node-red-et-gladys/6844/81 "2024-09-20T12:07:48Z")

</div>

Hello @Psoy

From memory, Gladys’s Node-RED version is fixed; yours was updated to 4.0 because, outside of Gladys, it would be a plus to have the choice in Gladys of which version to install — from the currently fixed one up to latest — and also the fact that disabling deletes the Node-RED data.

---

<div class="post-metadata">

**Author:** ![Psoy](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/psoy/32/9005_2.png) [@Psoy](https://community.gladysassistant.com/u/Psoy)\
**Post date:** [September 20, 2024, 2:38pm UTC](https://community.gladysassistant.com/t/rflink-node-red-et-gladys/6844/82 "2024-09-20T14:38:11Z")

</div>

> [@cce66](#):
>
> Gladys’s node-red version is locked,

Hello @cce66  
I use Node\_red outside Gladys, so when I installed it version 4 was installed; so I proceeded and tried to install my RFlink without downgrading the version and it works. As for the locked Node\_Red version in Gladys, it’s a safety policy from Pierre-Gilles, so that we aren’t bothered if an update happens and breaks Node-red, I think. Gladys’s node-red version has stayed on V3. Version  
1.0.1 of node-red-node-serialport does not work with V3, that’s for sure. However I haven’t tried installing node-red-node-serialport 2.0.3 under Node\_red V3, maybe it works! Any daredevils willing to test? If it doesn’t work you have to stop node-red and reinstall the flows, but it’s true that it’s so much easier with Gladys, no need to rummage through the directories and delete files, it does it by itself 👏

---

<div class="post-metadata">

**Author:** ![bjm](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/bjm/32/1753_2.png) [@bjm](https://community.gladysassistant.com/u/bjm)\
**Post date:** [September 26, 2024, 5:26pm UTC](https://community.gladysassistant.com/t/rflink-node-red-et-gladys/6844/83 "2024-09-26T17:26:06Z")

</div>

Hi @Psoy  
For the reinstallation on my mini PC, I had the same problem as you when using the Node-Red version integrated into Gladys.  
I did a fresh installation outside Gladys.  
I ran sudo chown -R 1000:1000 /var/lib/node-red.  
And everything worked (after reinstalling the MQTT broker, which had not been restored after restoring the backup).

---

<div class="post-metadata">

**Author:** ![Psoy](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/psoy/32/9005_2.png) [@Psoy](https://community.gladysassistant.com/u/Psoy)\
**Post date:** [September 26, 2024, 9:39pm UTC](https://community.gladysassistant.com/t/rflink-node-red-et-gladys/6844/84 "2024-09-26T21:39:59Z")

</div>

Indeed, even MQTT didn’t start, same thing. But I wonder if Gladys’s Node-RED is blocking ports because even my Xiaomi gateway doesn’t work. It’s a shame because, as I said above, it’s so much easier to restart Node-RED when it’s integrated into Gladys when it crashes. I had an «&nbsp;access denied&nbsp;» error for dev/tty/USB1, where my Rflink was connected.

---

<div class="post-metadata">

**Author:** ![elfedagger](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/elfedagger/32/13658_2.png) [@elfedagger](https://community.gladysassistant.com/u/elfedagger)\
**Post date:** [December 15, 2024, 5:25pm UTC](https://community.gladysassistant.com/t/rflink-node-red-et-gladys/6844/85 "2024-12-15T17:25:05Z")

</div>

Good evening, I have the same problem accessing my RFLink on the usb1 port with Node-RED integrated into Gladys. There really is no way to resolve this problem without removing Node-RED from Gladys and reinstalling Node-RED separately.

---

<div class="post-metadata">

**Author:** ![Psoy](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/psoy/32/9005_2.png) [@Psoy](https://community.gladysassistant.com/u/Psoy)\
**Post date:** [December 15, 2024, 5:28pm UTC](https://community.gladysassistant.com/t/rflink-node-red-et-gladys/6844/86 "2024-12-15T17:28:47Z")

</div>

Good evening @elfedagger  
Did you manage to handle this problem?  
Are you on Gladys’ Node-RED? I’m using Node-RED separately

---

<div class="post-metadata">

**Author:** ![elfedagger](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/elfedagger/32/13658_2.png) [@elfedagger](https://community.gladysassistant.com/u/elfedagger)\
**Post date:** [December 15, 2024, 5:32pm UTC](https://community.gladysassistant.com/t/rflink-node-red-et-gladys/6844/87 "2024-12-15T17:32:51Z")

</div>

Yes, I recently switched to the Gladys one and I can no longer connect to my RFLink. Node-RED cannot access the usb1 port where my RFLink is plugged in.

---

<div class="post-metadata">

**Author:** ![elfedagger](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/elfedagger/32/13658_2.png) [@elfedagger](https://community.gladysassistant.com/u/elfedagger)\
**Post date:** [December 15, 2024, 5:35pm UTC](https://community.gladysassistant.com/t/rflink-node-red-et-gladys/6844/88 "2024-12-15T17:35:13Z")

</div>

I’m about to redo an installation alongside Gladys. But I’d like to keep Gladys’ installation simpler to restart.

---

<div class="post-metadata">

**Author:** ![Psoy](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/psoy/32/9005_2.png) [@Psoy](https://community.gladysassistant.com/u/Psoy)\
**Post date:** [December 15, 2024, 5:44pm UTC](https://community.gladysassistant.com/t/rflink-node-red-et-gladys/6844/89 "2024-12-15T17:44:30Z")

</div>

> [@elfedagger](#):
>
> yes I switched to Gladys’ one a short while ago and I can no longer connect to my RFLink

Yes that’s the problem, I couldn’t connect my RFLink and I also couldn’t connect my Xiaomi gateway anymore. Port closed, I couldn’t troubleshoot it. That’s why I switched back to an external Node-RED. But now with the updates, you no longer need to downgrade the serialport version (see the RFLink and Node-RED and Gladys tutorial), however you still need to run the command:

```auto
sudo chown -R 1000:1000 /var/lib/node-red

```

But I have this issue with the port connections that keeps reversing

---

<div class="post-metadata">

**Author:** ![gaetanb76](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/gaetanb76/32/5911_2.png) [@gaetanb76](https://community.gladysassistant.com/u/gaetanb76)\
**Post date:** [January 19, 2025, 6:28pm UTC](https://community.gladysassistant.com/t/rflink-node-red-et-gladys/6844/97 "2025-01-19T18:28:45Z")

</div>

Good evening,  
I adapted the code below for negative temperatures

> [@Psoy](#):
>
> _Code to copy:_
> 
> `let input = msg.payload;`
> 
> `inputID = input.substring(19,23);`
> 
> `if (inputID === "00a7"){ // replace the "00a7" with your sensor's id`
> 
> `var Temp = input.substring(29,33);`
> 
> `Temp = parseInt(Temp,16);`
> 
> `msg.payload = Temp/10;`
> 
> `return msg;`
> 
> `}`

with this code :  
_code to copy :_

```auto
let input = msg.payload[4];
var Sign = input.substring(5, 6); // to know if the temperature is \u003c 0
var Neg = 0; // digit to add at the start if temperature \u003c 0
var Temp = input.substring(5, 9);
var TempNeg = input.substring(6, 9); // we only take the relevant digits
// Handling negative temperatures
if (Sign == 8) {
    var CreationTempNeg = Neg.toString() + TempNeg;
    var NouvelleTempNeg = parseInt(CreationTempNeg, 16);
    msg.payload = -1 * (NouvelleTempNeg / 10);
}
// Handling positive temperatures
if (Sign == 0) {
    Temp = parseInt(Temp, 16);
    msg.payload = Temp / 10;
}
return msg;

```

msg.payload[4] corresponds to entry no. 4 of the array ; the first being no. 0  
This therefore corresponds to TEMP=0010  
Here, the temperature is therefore \u003e 0

```auto
["20","26","Oregon TempHygro","2D6D","TEMP=0010","HUM=61","HSTATUS=0","BAT=LOW","\\r\\n"]

```

---

<div class="post-metadata">

**Author:** ![Psoy](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/psoy/32/9005_2.png) [@Psoy](https://community.gladysassistant.com/u/Psoy)\
**Post date:** [January 19, 2025, 9:04pm UTC](https://community.gladysassistant.com/t/rflink-node-red-et-gladys/6844/98 "2025-01-19T21:04:27Z")

</div>

Good evening @gaetanb76  
Indeed, I didn’t account for negative temperature values — I’ll replace my code with yours in the tutorial.  
Thank you for the correction

---

<div class="post-metadata">

**Author:** ![Psoy](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/psoy/32/9005_2.png) [@Psoy](https://community.gladysassistant.com/u/Psoy)\
**Post date:** [January 20, 2025, 11:23am UTC](https://community.gladysassistant.com/t/rflink-node-red-et-gladys/6844/100 "2025-01-20T11:23:35Z")

</div>

[quote=«&nbsp;gaetanb76, post:97, topic:6844&nbsp;»]  
This therefore corresponds to TEMP=0010  
Here,

---

<div class="post-metadata">

**Author:** ![Psoy](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/psoy/32/9005_2.png) [@Psoy](https://community.gladysassistant.com/u/Psoy)\
**Post date:** [January 21, 2025, 9:02pm UTC](https://community.gladysassistant.com/t/rflink-node-red-et-gladys/6844/103 "2025-01-21T21:02:32Z")

</div>

> [@gaetanb76](#):
>
> `["20","26","Oregon TempHygro","2D6D","TEMP=0010","HUM=61","HSTATUS=0","BAT=LOW","\\r\\n"]`

Good evening @gaetanb76  
Can you send me a format that includes the temperature? Thanks in advance

---

<div class="post-metadata">

**Author:** ![gaetanb76](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/gaetanb76/32/5911_2.png) [@gaetanb76](https://community.gladysassistant.com/u/gaetanb76)\
**Post date:** [January 24, 2025, 7:38am UTC](https://community.gladysassistant.com/t/rflink-node-red-et-gladys/6844/132 "2025-01-24T07:38:16Z")

</div>

Sorry, didn’t see it.  
I’ll put it in the freezer and send it to you.

---

<div class="post-metadata">

**Author:** ![gaetanb76](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/gaetanb76/32/5911_2.png) [@gaetanb76](https://community.gladysassistant.com/u/gaetanb76)\
**Post date:** [January 24, 2025, 7:56am UTC](https://community.gladysassistant.com/t/rflink-node-red-et-gladys/6844/133 "2025-01-24T07:56:08Z")

</div>

![2025-01-24\_Node-RED\_RFLink\_temp\_neg|244x346](upload://5E7WreudcBV2MllfVHQErbEeE

---

<div class="post-metadata">

**Author:** ![Psoy](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/psoy/32/9005_2.png) [@Psoy](https://community.gladysassistant.com/u/Psoy)\
**Post date:** [January 24, 2025, 8:04am UTC](https://community.gladysassistant.com/t/rflink-node-red-et-gladys/6844/134 "2025-01-24T08:04:08Z")

</div>

hello @gaetanb76  
thanks, I’ll take a look at that  
have a good day

---

<div class="post-metadata">

**Author:** ![Psoy](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/psoy/32/9005_2.png) [@Psoy](https://community.gladysassistant.com/u/Psoy)\
**Post date:** [January 24, 2025, 9:40pm UTC](https://community.gladysassistant.com/t/rflink-node-red-et-gladys/6844/148 "2025-01-24T21:40:40Z")

</div>

Good evening @gaetanb76  
j’ai un peu modified your code pour qu’il reste dans l’esprit du tuto, c’est à dire que je n’utilise pas de array pour transformer la frame reçue. I count the characters in the whole frame, which, incidentally, is much more complicated than your method. (By the way I’d like you to explain it to me, how do you transform the frame into an array?)  
If you have time take a look at what I wrote and tell me if it’s okay with you (it’s located just above paragraph 7)  
thanks in advance 😄  
good evening

---

<div class="post-metadata">

**Author:** ![gaetanb76](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/gaetanb76/32/5911_2.png) [@gaetanb76](https://community.gladysassistant.com/u/gaetanb76)\
**Post date:** [January 25, 2025, 5:29pm UTC](https://community.gladysassistant.com/t/rflink-node-red-et-gladys/6844/151 "2025-01-25T17:29:37Z")

</div>

Would it be possible to assign ports according to the hardware type?  
For example:  
Zigbee stick: USB10  
RFlink stick: USB20  
Z-Wave stick: USB30

This by testing the hardware

```auto
sudo udevadm info --query=all --name=ttyUSB0
N: ttyUSB0
S: serial/by-id/usb-RFXCOM_RFXtrx433_A13UZWY-if00-port0
E: DEVNAME=/dev/ttyUSB0
E: ID_VENDOR=RFXCOM
E: ID_VENDOR_ID=0403
E: ID_MODEL=RFXtrx433
E: ID_MODEL_ID=6001

sudo udevadm info --query=all --name=ttyACM0
N: ttyACM0
E: ID_VENDOR=0658
E: ID_MODEL=0200
E: ID_VENDOR_FROM_DATABASE=Sigma Designs, Inc.
E: ID_MODEL_FROM_DATABASE=Aeotec Z-Stick Gen5 (ZW090) - UZB

```

then by creating a gladys.rules file:  
sudo nano /etc/udev/rules.d/gladys.rules

I did this in Domoticz, where I don’t have a Zigbee stick but RFlink and Z-Wave

```auto
SUBSYSTEM=="tty", SUBSYSTEMS=="usb", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", ATTRS{serial}=="A13UZWY", SYMLINK+="ttyUSB10"
SUBSYSTEM=="tty", SUBSYSTEMS=="usb", ATTRS{idVendor}=="0658", ATTRS{idProduct}=="0200", SYMLINK+="ttyUSB20"

```

---

<div class="post-metadata">

**Author:** ![Psoy](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/psoy/32/9005_2.png) [@Psoy](https://community.gladysassistant.com/u/Psoy)\
**Post date:** [January 25, 2025, 7:27pm UTC](https://community.gladysassistant.com/t/rflink-node-red-et-gladys/6844/152 "2025-01-25T19:27:12Z")

</div>

> [@gaetanb76](#):
>
> Would it be possible to fix the ports based on the type of hardware?

That’s what I’d like to do, because every time the circuit breaker trips my ports get swapped 🙏

---

<div class="post-metadata">

**Author:** ![elfedagger](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/elfedagger/32/13658_2.png) [@elfedagger](https://community.gladysassistant.com/u/elfedagger)\
**Post date:** [January 25, 2025, 9:49pm UTC](https://community.gladysassistant.com/t/rflink-node-red-et-gladys/6844/153 "2025-01-25T21:49:39Z")

</div>

I also have this problem every time the power goes out.

[Previous page](https://community.gladysassistant.com/t/rflink-node-red-et-gladys/6844.md?page=4)

[Next page](https://community.gladysassistant.com/t/rflink-node-red-et-gladys/6844.md?page=6)
