Node Red: A widget based dashboard working with Homey trough MQTT

It’s actually basic Javascript :wink:. These “containers” are called “Structs” or “Objects” in Javascript. This is how you use them:
https://www.w3schools.com/js/js_objects.asp
Don’t get intimidated by the program languages. I also just figure things out when I need it. And there’s lots of info online. I just google the problem, and usually there’s someone on stack overflow who had the same problem :laughing:

3 Likes

Unfortunately i’m struggling with the MQTT topic of my Aqara temperature sensor.
I’ve placed the MQTT received with the full topic, including String indication to be shown and connected it to a regulay display gauge. I made sure that the gauge parameters are within normal temperature ranges.

Is there anything i’m missing? the display just does not show any value, even though, when debugging - i can see that it reports 20.5 degrees

I’ve done the same (same sensor) without any problems. I use this topic:
homie/homey-topic/tempsensor/measure-temperature
and connect it directly to a gauge (or I did, I replaced them for text now. I found a big number more clear then a gauge). What happens when you connect this to a text-node?
You are sure it’s showing the temperature in the debug node? Or if you don’t get MQTT messages at all from the sensor, restart the MQTT hub app. Also when you add new devices you need to restart the MQTT hub to include them.

I tried to connect it to a nummer, and also tried the text node as display just to experiment. (im relatively new to this). Unfortunately the Gauge or value does not ‘‘use’’ any information. I’m 100% sure that MQTT is sending information, if i broadcast through the HUb i can see all hardware connected to homey in the Debug. I have also used the tutorials and my first programmed switch to SEND information works like a charm. I think it’s related to the topic, unfortunately i’m not at home so i cant copy my current one. But what i did is forcing an update on the Aqara, and used the string that was being send, without temperature. It looks similar to:

homie/homey-topic/slaapkamertemperatuur/Temperature: ‘‘string4’’

Your topic looks different. if i’d copy yours and edit the sensor name it might work?
homie/homey-topic/Slaapkamertemperatuur/measure-temperature

I have 4 different devices that measure temperature (2 different Aqara, 1 thermostat knob and one thermostat) . And they all use “/measure-temperature” to serve the temperature. I also don’t know if it matters, but I respect the font case the topic is written in (lower and upper case characters).
Have you installed MQTT explorer? This is a great tool to explore the MQTT topics and values:

Also, temperature information might come in intervals or on temperature change. So it might not be visible immediately. Also depends on the broker. When I used the Homey MQTT broker, nothing updated when I deployed a new Node-red UI. But when I moved the broker to my Synology the broker sends all kinds of updates after a new deployment. You can also press the “broadcast” button in the MQTT hub app settings.

But, you should install MQTT explorer first to see what’s going on.

Hi Satoer,

Thank you for your feedback, this is much appreciated.

I have used the topic you have send me and it works without issues now.
As you mentioned, the MQTT broker on homey doesn’t refresh data.
So when i deployed, i didnt see any variables thinking it was not functioning, but finally it is.

I have installed the MQTT Explorer and this is going to help alot. This makes it much easier to find the topics required.

Is it correct that all topics i want to build should be build similar to the temperature one:

homie/homey-topic/’‘name of sensor’’/measure-temperature

Node red opens up a lot of new doors, it’s extremely interesting.

Hi,
Maybe someone knows the solution here. I have node-red installed on my synology through docker. I upgraded my memory to 4GB but the synology only got slower (really sluggish, was to be expected). So I reverted back to the original 1GB. Now my docker won’t start anymore. Everything else is working fine, only the docker is giving problems. The problem is that I have mad a lot of changes to my node-red dash. Is there a way I can backup that afterwards? Or does anyone have the solution for my docker that won’t start?

It takes a long time, then I see the nod-red container appear on the syno dash and then it says “kan de pakket service niet uitvoeren”.

I could not find a clear solution on the internet.

Start by opening the Log Center and Resource Monitor apps to see if anything is being logged or showing up w.r.t. why your system is having problems

I don’t understand why it’s to be expected that your Synology would become slower when adding more memory; if anything, it should be faster because more memory means it can hold more filesystem data buffered in memory.

Hi @robertklep Yes normally that would be the case but there are problems being reported with an upgrade to 4GB (upgrade to 2GB gives no problems). I had one laying around so I tried it.

I will try the log and resource monitor. I will report back my findings.

I see that the volume and disk activity goes up (see image). They went down when the docker failed to start. The rest is stable. I don’t see anything appear in the log…

The issue with Docker not started can have a number of reasons, one being that a VPN is running which could prevent Docker from starting.

There’s also a possible solution mentioned here: https://github.com/docker/for-linux/issues/123#issuecomment-346546953

VPN is not running. I don’t understand what I have to do in the solution you gave to me. I am no expert by any means :sweat_smile:

If you’re not running a VPN the solution is likely not going to be of any use. Perhaps a more specific DSM/Synology forum will be of more help.

Ok robert,
Thanks for your help :+1:

You can backup a docker image if you manage to start docker. Maybe put the 4GB back and try to start docker to backup the image? You can also export everything from node-red as JSON.

I’m using a six year old DS2413+ nas based on a Athom D2700. It came natively with 2GB of memory, and I never feel the need to upgrade it. When I look at the resource monitor it currently only uses 1.12 GB. According to the resource monitor, docker is only using 35MB, and the node red image only 24MB. So, it’s quite memory efficient. Also the Docker CPU saturation is only 0.1%


(the docker stats top right is total usage)
So, I think docker / node red should have very little system performance impact.

Just look up the exact topic and data you need in the MQTT explorer. To write data (like controlling a light) you need to add “/set” behind the topic (And homey needs to support it).

Hi @Satoer, I wil do that then, a good solution ( I hope) and thanks for the extra info.

Can anyone help me why I can’t change the icon in a button depending on a variable?

I have created this to test it:
image

The idea is that the input is a number, the function checks if it’s higher or lower then 2. If it’s lower, it sets the variable for Icon wi-wu-chancesnow and if it’s higer it sets the variable for Icon wi-wu-mostlysunny.

This is the code in de Function:

 var image;
if(msg.payload <= "2"){
 image = "wi-wu-chancesnow";
}
else{
 image = "wi-wu-mostlysunny";
}
msg.icon = image;
return msg;

When I test it the debug shows me:

homie/homey-topic/at-temp-and-hum/measure-temperature : msg : Object
{ _msgid: "18ae6ce8.031863", topic: "homie/homey-topic/at-temp-and-…", payload: 25, icon: "wi-wu-mostlysunny" }

So it looks like the variable is set. But the button on the dashboard doesn’t show the icon, just an question mark… In the button-settings I have this in the Icon-field:

{{msg.icon}}

I really can’t figure out what I’m doint wrong here… :confused:

Maybe use {{msg.icon}}?

Could anyone let me know what i’m missing in my Dimming topic. I would like to dim a E27 IKEA bulb.

MQTT explorer shows : homie/homey-topic/rgbwe27eettafel/dim

I tried : homie/homey-topic/rgbwe27eettafel/dim/set

But that doesnt work.

Same applies for set thermostat temp:
It says: homie/homey-topic/thermostaatvloerverwarmingzwave/target-temperature/20

So i tried: homie/homey-topic/thermostaatvloerverwarmingzwave/target-temperature/set

Could anyone point me in the correct direction?