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

Is anybody encountering problems with their Node-Red dashboard since the Homey v5 update?

All my dashboard controls are no longer working. I can click on the different switch nodes and the dashboard will change state but it seems that no MQTT signal is being send since the devices are not responding.

Sending MQTT signals from Homey is working, since i can control the Sonoff tasmota via homey. However when i do so, the dashboard is not showing the correct state.

Maybe somebody can put me in the right direction?

Have you tried restarting MQTT Hub and MQTT Client on Homey? Sorted out the same problem for me. (Homey not responding on Node-Red)

I rebooted the Client and the Broker. But not the HUB. That did the trick!
Thank you

Past week the MQTT Hub went through some updates.

Most users are upgraded by now, so I would like to know if anyone encountered issues?
Or maybe you have suggestions for improvements to make your live a little easier?

Thought I should ask here to, most of the heavy users are probably around here somewhere :slight_smile:

1 Like


Wow Harrie, you’ve been buzzy.

To be honest, I don’t notice any difference. But that’s probably a good thing :smile:
Now I think of it, in the past couple of weeks I did had an unresponsive dashboard. I restarted the client and hub and then it worked fine. Don’t know if it’s related to these updates. I didn’t put much thought in it.

Just scrolled trough the Changelog. I don’t think there’s something I had a problem with. To be honest, most thing are above my MQTT knowledge :sweat_smile: Are there things that changed the interaction with Node-red?

Anyhow, big thanks for keeping this project updated/supported! Just bought you a couple of Corona Beers! :beers:

1 Like

The biggest change is probably the upgrade to SDK 3. The app API has been improved by Athom. Combined with v2.4.2 of the MQTT Client (test version) it should be an improvement in connectivity between Hub & Client. The rest is mostly some bug fixes & extended functionality of the MQTT Device.

The MQTT Device is a powerful device operating on mqtt messages. It links Homey capabilities to MQTT topics. E.g. add a button to send an on/off message to some mqtt topic or display an external sensor value within Homey on a virtual device. All fully configurable.

2 Likes

@HarriedeGroot My dashboard is a bit unresponsive since the update. The lights controls on my dashboard do not show the on/off status when i control them via the homey app. However the light controls on my dashboard are working. It looks like the dash can send the MQTT signals but cannot receive them.

This node was working fine before:

   [{"id":"a08b2174.7fb8a","type":"mqtt in","z":"48518d4f.6375e4","name":"Back Door","topic":"homie/homey-topic/backdoor/onoff","qos":"2","datatype":"auto","broker":"d094d3b7.a558a8","x":420,"y":1238,"wires":[["6c50e10d.feaf7"]]},{"id":"6c50e10d.feaf7","type":"function","z":"48518d4f.6375e4","name":"Convert String to Boolean","func":"if(msg.payload === \"true\"){\n   msg.payload = true;  \n}else{\n   msg.payload = false;\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":690,"y":1238,"wires":[["4a6e3509.b3aaac"]]},{"id":"4a6e3509.b3aaac","type":"ui_switch","z":"48518d4f.6375e4","name":"Back door light","label":"","tooltip":"","group":"2cc829a5.610f36","order":32,"width":1,"height":1,"passthru":false,"decouple":"false","topic":"homie/homey-topic/backdoor/onoff/set","style":"","onvalue":"true","onvalueType":"bool","onicon":"http://192.168.178.106:1880/images/bulb-on.png","oncolor":"yellow","offvalue":"false","offvalueType":"bool","officon":"http://192.168.178.106:1880/images/bulb-off.png","offcolor":"black","x":940,"y":1238,"wires":[["77a0e409.4af4bc"]]},{"id":"77a0e409.4af4bc","type":"mqtt out","z":"48518d4f.6375e4","name":"MQTT Transmitter","topic":"","qos":"","retain":"","broker":"d094d3b7.a558a8","x":1270,"y":1258,"wires":[]},{"id":"d094d3b7.a558a8","type":"mqtt-broker","name":"Homey MQTT","broker":"192.168.178.83","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"2cc829a5.610f36","type":"ui_group","name":"all","tab":"6766858b.dee74c","order":3,"disp":false,"width":20,"collapse":false},{"id":"6766858b.dee74c","type":"ui_tab","name":"Dash","icon":"home","order":1,"disabled":false,"hidden":false}]

@Khoi_Ho_Si did you restart the MQTT client & hub apps?

@HarriedeGroot Yes i did, several times.
Does the order matters? I also restarted the MQTT broker, not sure if that was needed.

Maybe worth mentioning: the Fibaro dimmers are working properly the issue only occurs with the Sonoff (with tasmota)

I have a problem that my sensors are not updated, when I look with the mqtt explorer at the broker, updates seems to be received but the same value is received. I restarted the client and hub many times already, all devices are selected from the hub app.
20210409-08:37:09 received ‘61’ on ‘homie/homey/airco-zolder/se-last-seen-seconds’
20210409-08:37:09 Trigger generic card for homie/homey/airco-zolder/se-last-seen-seconds
20210409-08:37:09 send message to listeners via realtime api
20210409-08:37:09 homie/homey/airco-zolder/se-last-seen-seconds: 61
20210409-08:37:15 SendMessageToTopic called
20210409-08:37:15 SendMessageToTopic: {“qos”:0,“retain”:“1”,“mqttTopic”:“homie/homey/pompvloerverwarming/measure-voltage”,“mqttMessage”:230.09}
20210409-08:37:15 publish_options: {“qos”:0,“retain”:true}
20210409-08:37:15 send 230.09 on topic homie/homey/pompvloerverwarming/measure-voltage
20210409-08:37:15 OnMessage called
20210409-08:37:15 received ‘230.09’ on ‘homie/homey/pompvloerverwarming/measure-voltage’
20210409-08:37:15 Trigger generic card for homie/homey/pompvloerverwarming/measure-voltage

edit:
I think I solved part of the issue my self;


screenshot of mqtt explorer, I was using topics from the deviceid section

anybody an idea how to use a mqtt value as a title in a gauge? I have the mqtt value - but how to bring this into a gauge as a title :slight_smile:

[{“id”:“8494b422.f82368”,“type”:“ui_text”,“z”:“954d837b.7141d8”,“group”:“4582325b.247cdc”,“order”:2,“width”:0,“height”:0,“name”:"",“label”:“Dagopbrengst”,“format”:" {{msg.payload}} kW",“layout”:“row-center”,“x”:560,“y”:180,“wires”:},{“id”:“4582325b.247cdc”,“type”:“ui_group”,“name”:“Solar Power”,“tab”:“a2490d0e.a872b”,“order”:1,“disp”:true,“width”:“6”,“collapse”:true},{“id”:“a2490d0e.a872b”,“type”:“ui_tab”,“name”:“Homey Dashboard”,“icon”:“dashboard”,“order”:1,“disabled”:false,“hidden”:false}]

hi @Eric_de_Been

thx for your response but I am not able to import your flow…

The Json formatting was converted with “smart quotes” ( " changed to “ )
This should work (not tested):
[{"id":"8494b422.f82368","type":"ui_text","z":"954d837b.7141d8","group":"4582325b.247cdc","order":2,"width":0,"height":0,"name":"","label":"Dagopbrengst","format":" {{msg.payload}} kW","layout":"row-center","x":560,"y":180,"wires":[]},{"id":"4582325b.247cdc","type":"ui_group","name":"Solar Power","tab":"a2490d0e.a872b","order":1,"disp":true,"width":"6","collapse":true},{"id":"a2490d0e.a872b","type":"ui_tab","name":"Homey Dashboard","icon":"dashboard","order":1,"disabled":false,"hidden":false}]

1 Like

Hi,
I had the problem that sometimes my Homey would lose the MQTT connection, which is why the dashboard would stop working. This would not be immediately visible, so I created a status indicator.

Just sharing the example here:
image

The signal symbol is orange if all is OK, it blinks orange/grey if no mqtt message was received in the past 30 seconds or longer, and turn red if no message was received for more than 2 minutes.

Here’s the flow:

Have fun with the code:

[{"id":"9bfbfc38.0bb22","type":"switch","z":"7a3033ea.2f403c","name":"","property":"topic","propertyType":"msg","rules":[{"t":"cont","v":"homeypro","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":390,"y":1840,"wires":[["8e52f2a5.94fe8"]]},{"id":"8e52f2a5.94fe8","type":"function","z":"7a3033ea.2f403c","name":"","func":"var nu = Date.now();\n\nglobal.set(\"LaatsteMQTTBerichtOntvangen\",nu);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":540,"y":1840,"wires":[[]]},{"id":"5dc5699.2d93198","type":"inject","z":"7a3033ea.2f403c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"1","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":380,"y":1880,"wires":[["3782d33a.022c4c"]]},{"id":"3782d33a.022c4c","type":"function","z":"7a3033ea.2f403c","name":"","func":"\nvar nu= msg.payload;\nvar meesteRecenteBerichtTimestamp = global.get(\"LaatsteMQTTBerichtOntvangen\");\n\nvar millis = nu - meesteRecenteBerichtTimestamp;\n\nverschilInSeconden = Math.floor(millis / 1000);\n\nvar icnColor=\"#888888\";\nvar pl = \"\";\nvar icon=\"\";\n\nif (verschilInSeconden<31)\n{\n   icnColor=\"#FFAA00\"; \n   icon=\"fa fa-signal\";\n}\nelse if (verschilInSeconden<121)\n{\n    if (verschilInSeconden % 2)\n    {\n        icnColor=\"#FFAA00\"; \n    } else\n    {\n        icnColor=\"#888888\"; \n    }\n    icon=\"fa fa-signal\";\n}\nelse\n{\n    icnColor=\"#FF4444\"; \n    icon=\"fa fa-signal\";\n}\npl = \"MQTT data\";\n\nmsg = {payload:pl, Iconcolor:icnColor, IconShape:icon};\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":540,"y":1880,"wires":[["63732e86.2e011"]]},{"id":"63732e86.2e011","type":"ui_template","z":"7a3033ea.2f403c","group":"f0c86728.497088","name":"mqttReceivingIndicator","order":6,"width":5,"height":1,"format":"<span style=\"vertical-align:middle; font-size:25px; color: rgb(255, 255, 255); text-align: left; \" class=\"fr-class-transparency\">\n    <i style=\"color:{{msg.Iconcolor}}!important;\" class={{msg.IconShape}} aria-hidden=\"true\"></i>&nbsp;\n    <span>{{msg.payload}}</span>\n</span>","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","x":750,"y":1880,"wires":[[]]},{"id":"f0c86728.497088","type":"ui_group","name":"Energie Vandaag","tab":"9184a885.936cb8","order":1,"disp":true,"width":"18","collapse":false},{"id":"9184a885.936cb8","type":"ui_tab","name":"Energie","icon":"dashboard","order":3,"disabled":false,"hidden":false}]
2 Likes

@RogerSt out of curiosity, do you experience less connection issues with the new version of the MQTT Cliënt (v3.0.0)?

Hi, I have not encountered an MQTT issue yet, so I cannot tell at this point in time Harrie.
Sorry, no news…

No issues so far - stable as h.ll :slight_smile:
Thanks Harrie, much appreciated!

:muscle: thanks for your feedback!

Hey all, any cool examples of dashboards to share here?
Would be good to see the results posted from all information gathered in this topic.
I know I would appreciate if all of us share cool new things no-one else has posted yet… :smiley:
Ohhhhh and of course: thanks! :sunglasses: