Variables with special letters

Posted on
Thu Feb 18, 2021 3:22 pm
tazswe offline
Posts: 211
Joined: Mar 13, 2017
Location: Sweden

Variables with special letters

Image

I’m playing around with a weather forecast in Node Red. I have transformed the time to what part of the day it is, evening, night, morning and so on.
I use the Mqttconnector plugin and it normally works without any problems.
It haven’t been any problem as long as I don’t use any of our special letters like an a or o with two dots. As soon as I use one of these special letters the variable refuse to update and will keep the previous value.

I use the variables to make announcements.

I have enclosed a picture, have a look at time1-5.
Mqtt Explorer is updating correctly.


Skickat från min iPad med Tapatalk

Posted on
Thu Feb 18, 2021 3:42 pm
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Variables with special letters

How exactly are you getting the MQTT messages from Node-Red into the Indigo variables?

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Thu Feb 18, 2021 3:55 pm
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Variables with special letters

If you're using the Device/Variable Control panel of the Connector config dialog, what's the exact content of the "Command Topic" for variables?

Also, turn on debug logging and attempt to set those variables again. I need the log lines that have "Variable command match" in them.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Thu Feb 18, 2021 5:21 pm
tazswe offline
Posts: 211
Joined: Mar 13, 2017
Location: Sweden

Re: Variables with special letters

Image

Tried to debug messages and didn’t get any error but the two with special letters didn’t trigger or gave any response. So at this point we are missing time2 and time4.


Skickat från min iPad med Tapatalk

Posted on
Thu Feb 18, 2021 5:25 pm
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Variables with special letters

What are those triggers doing? Screen shot is ok.

In the future, please don't post screen shots of the logs. Copy and paste the text.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Thu Feb 18, 2021 5:27 pm
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Variables with special letters

tazswe wrote:
So at this point we are missing time2 and time4.


I don't see in the log you posted that you ever received time2 or time4.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Thu Feb 18, 2021 5:30 pm
tazswe offline
Posts: 211
Joined: Mar 13, 2017
Location: Sweden

Re: Variables with special letters

I have made one trigger for each variable like this

Image

The trigger for time1 locks like this

Image


Image

I have also a components match trigger

Image


And finally topic subscriptions on my MQTT server.


Skickat från min iPad med Tapatalk

Posted on
Thu Feb 18, 2021 5:34 pm
tazswe offline
Posts: 211
Joined: Mar 13, 2017
Location: Sweden

Re: Variables with special letters

Debugging message looks like this:

MQTT Connector Debug RPI Mosquitto: Message received: Node Red/weatherforecast/time1, payload: Vid midnatt
MQTT Connector Debug RPI Mosquitto: Message received: Node Red/weatherforecast/time3, payload: Vid lunchtid
MQTT Connector Debug RPI Mosquitto: Message received: Node Red/weatherforecast/time5, payload: Vid midnatt

Also tried critical messages and warning messages but don’t get anything.


Skickat från min iPad med Tapatalk

Posted on
Thu Feb 18, 2021 5:36 pm
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Variables with special letters

tazswe wrote:
Debugging message looks like this:

MQTT Connector Debug RPI Mosquitto: Message received: Node Red/weatherforecast/time1, payload: Vid midnatt
MQTT Connector Debug RPI Mosquitto: Message received: Node Red/weatherforecast/time3, payload: Vid lunchtid
MQTT Connector Debug RPI Mosquitto: Message received: Node Red/weatherforecast/time5, payload: Vid midnatt

Also tried critical messages and warning messages but don’t get anything.


Skickat från min iPad med Tapatalk


Well, that's saying that your Node-red system isn't publishing time2 or time4. The Connector plugin never gets them. Are you sure those are showing up in MQTT Explorer?

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Thu Feb 18, 2021 5:37 pm
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Variables with special letters

Is that topic component trigger actually doing anything? There's no point it having it if the topic string triggers are doing the work.

I'm going to need to try to recreate this. I need the exact topics and payloads that are working and not working. As text here that I can copy and paste into my system.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Thu Feb 18, 2021 5:41 pm
tazswe offline
Posts: 211
Joined: Mar 13, 2017
Location: Sweden

Re: Variables with special letters

I am sure that they are showing up in Explorer.

Had the same problem with the weather variables when I had them in Swedish and when I changed them to English the problem disappeared.

I have identical settings for the local buss timetable, but the destinations don’t have any special letters so that is working.


Skickat från min iPad med Tapatalk

Posted on
Thu Feb 18, 2021 5:44 pm
tazswe offline
Posts: 211
Joined: Mar 13, 2017
Location: Sweden

Re: Variables with special letters

Do you think that I shall remove the component trigger?


Skickat från min iPad med Tapatalk

Posted on
Thu Feb 18, 2021 5:47 pm
tazswe offline
Posts: 211
Joined: Mar 13, 2017
Location: Sweden

Re: Variables with special letters

Is there a free mqtt server that I can send the payloads to?


Skickat från min iPad med Tapatalk

Posted on
Thu Feb 18, 2021 6:01 pm
tazswe offline
Posts: 211
Joined: Mar 13, 2017
Location: Sweden

Re: Variables with special letters

This is from my function in Node Red.
My comments and explanations what letter I causing the problem.


Tid = msg.payload;
if (Tid == "15:00")
{
return {payload:"Under Eftermiddagen"}; OK
}
Tid2 = msg.payload;
if (Tid2 == "18:00")
{
return {payload:"Vid Tidig kväll"}; Not working contains letter ä
}
Tid3 = msg.payload;
if (Tid3 == "21:00")
{
return {payload:"Under Kvällen"}; Not working contains letter ä

}
Tid4 = msg.payload;
if (Tid4 == "00:00")
{
return {payload:"Vid midnatt"}; OK
}
Tid5 = msg.payload;
if (Tid5 == "03:00")
{
return {payload:"Under natten"}; OK
}
Tid6 = msg.payload;
if (Tid6 == "06:00")
{
return {payload:"På morgonen"}; Not working contains letter å
}
Tid7 = msg.payload;
if (Tid7 == "09:00")
{
return {payload:"Under förmiddagen"}; Not working contains letter ö
}
Tid8 = msg.payload;
if (Tid8 == "12:00")
{
return {payload:"Vid lunchtid"}; OK
}




Skickat från min iPad med Tapatalk

Posted on
Thu Feb 18, 2021 7:01 pm
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Variables with special letters

tazswe wrote:
Do you think that I shall remove the component trigger?


If there's no actions attached, then it's not doing anything except taking up time.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Who is online

Users browsing this forum: No registered users and 1 guest