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

Hi, my comment not adding value :slight_smile:
It looks absolutely stunning and sexy!
i’m unfortunately not talented enough for the manual / coding lines steps and will have to wait for a version for general audience :flushed:

i’m unfortunately not talented enough for the manual / coding lines steps and will have to wait for a version for general audience

Maybe the HomeyDash project will get a more widget style dashboard, but I don’t think node-red is going to get less complicated… although it’s not that complicated, if you managed to install the software on a server and go trough to the steps in my tutorial it shouldn’t be that hard.

How is everyone’s MQTT memory usage? It seems to be way less than I started this project.
The Client went from 38MB to 22 MB
The Hub went from 35 to 23,8 MB
(Don’t know about the Broker, I run this one on my NAS)
Dont know why, maybe the Homey 3.0 update.

I have a question, probably I do something wrong, but can’t see whats wrong:

If i toggle the switch from a lamp on the node-red dashboard, I see in MQTT Explorer that the topic is updated, but the lamp stay’s off. Like the MQTT client app in the Homey does not read that topic and/or react on it.

How does mqtt client know which topic to look in? I understand that the hub only sends the current status to mqtt and node-red is used to read these topics and set the values, but I don’t see how mqtt client then looks in the right topic and act on that.

What about LWT? Do I need to configure that in the MQTT client? And in the hub, should I enable that? And what topic paths should I use?

My config is Homey with MQTT client and hub apps. MQTT and Node-Red on a Pi3, and topics from Hub are published to mqtt and updated (including on the node read dashbard, when status is changed in Homey.

For control MQTT client looks in the topic used to report the status but with /set appended on the end.
So if the status topic is a/b/c/dim. The topic you update to change that value is a/b/c/dim/set

1 Like

Thanks, that was what I missed.


For users that are using the dashboard on an iPad or other tablet that want to lock / unlock (turn on and off) the tablet by Homey… For example controlled by a motion detector, or on during the day:
I’ve coded a firmware for a ESP 32 (cheap microcontroller). To emulate a Bluetooth keyboard. This way you can turn the tablet wireless on and off. A nice non intrusive solution. No need for soldering.

Playing with a Node-Red dashboard (Homey-Redboard?). My college is testing with node-red and I asked a homeydash a like background…

1 Like

Very Nice! This is my little project om Google nest

image

How do u arrange for a sensor to show, like water leak or movement?

Just use a simple Switch node, and change the on/of icon to a droplet or something. You can even change the on / off icon colour (see the locks in my dashboard)
Enable “Switch shows the state of the input” and attach the sensor MQTT signal to it (you might need to change the boolean string to a real boolean value. See the first (tutorial) post how to do that with a function node.)

I also have water alarms, I personally unhide a complete Group with a big warning if something like that happens.

3 Likes

Thanks! Starting to get somewhere! Main dashboard in addition to 8 rooms, a lot of work!

2 Likes

oh, nice! how did you integrate a camera picture? can you share your node configuration?

Thank you very much, but I think there are some syntax errors in the code. Mabey you can use the “perfomattet Text”-function of the Forum?

should work now…

Hmmm there are still a lot of syntax error’s in the code. In the first place, all the quotes " are “Smart quotes”: “ ” not the simple quotes like: "
I’ve replaced it with this online script:
https://dan.hersam.com/tools/smart-quotes.html

But then there are several syntax problems left. Like “wires”: (weird rectangle)

Hope you can retry paste the unformatted Json, I’m really interested in the way you embedded the video as well :grinning:

sorry guys, long day :smile:

Let`s go for a last time;

[{"id":"286dfcc6.d4e334","type":"comment","z":"55f532a.497bccc","name":"Just a live view of cameras","info":"","x":190,"y":60,"wires":[]},{"id":"bb5fdb34.e3dd88","type":"inject","z":"55f532a.497bccc","name":"","topic":"","payload":"checkWeb","payloadType":"str","repeat":"30","crontab":"","once":true,"onceDelay":"10","x":150,"y":160,"wires":[["769295e6.93ea2c"]]},{"id":"769295e6.93ea2c","type":"ui_template","z":"55f532a.497bccc","group":"1c70d4cd.325c0b","name":"Just a view of cameras","order":1,"width":"35","height":"12","format":"<!DOCTYPE html>\n<html>\n<style>\nimg {\n    border: 1px solid #ddd;\n    border-radius: 8px;\n    padding: 2px;\n    width: 405px;\n}\n</style>\n\n<script type=\"text/javascript\">\nscope.$watch('msg', function(msg) {\n    inMessage(msg.payload);\n});\n\nfunction updatePic() {\n    document.getElementById('c51').src = \"http://(yourURL)\";\n    //alert('updated pics');\n}\n\nfunction inMessage(event) {\n    if (event.match('checkWeb')) {\n        updatePic();\n    }\n}\n\n</script>\n<center>\n<table>\n    <tr><!-- Row 1 -->\n    \t\t<td style=\"text-align: center\"><img src=\"\" id=\"c51\" /></td>\n   \t\t    <td style=\"text-align: center\"><img src=\"\" id=\"c52\" /></td>\n    \t\t<td style=\"text-align: center\"><img src=\"\" id=\"c53\" /></td>\n    \t\t<td style=\"text-align: center\"><img src=\"\" id=\"c54\" /></td>\n    </tr>\n    <tr><!-- Row 2 -->\n    \t\t<td style=\"text-align: center\"><img src=\"\" id=\"c55\" /></td>\n   \t\t    <td style=\"text-align: center\"><img src=\"\" id=\"c56\" /></td>\n    \t\t<td style=\"text-align: center\"><img src=\"\" id=\"c57\" /></td>\n    \t\t<td style=\"text-align: center\"><img src=\"\" id=\"c58\" /></td>\n    </tr>\n</table>\n</center>\n</html>","storeOutMessages":false,"fwdInMessages":false,"templateScope":"local","x":380,"y":160,"wires":[[]]},{"id":"debe02e2.7163a","type":"ui_template","z":"55f532a.497bccc","group":"1c70d4cd.325c0b","name":"Clock Toolbar","order":5,"width":"0","height":"0","format":"\n<script id=\"titleScript\" type=\"text/javascript\">\n    $('#clock').remove();\n    var toolbar = $('.md-toolbar-tools');\n    var div = $('<div></div>');\n    var p = $('<p/ id=\"clock\">');\n    $('#titleScript').parent().hide();\n    div.append(p);\n    div[0].style.margin = '5px 5px 5px auto';\n    toolbar.append(div);\n\n    function displayTitle(lh) {\n        p.text(lh); \n    }\n    \n    function upTime() {\n        var d = new Date();\n        p.text(d.toLocaleTimeString('de-AT'));\n    }\n\n    // Watch the payload and update the title\n    (function(scope) {\n        scope.$watch('msg.payload', function(data) {\n            if (data.match(\"systemsummary\")) { //Systemstatus\n                m = data;\n                n = m.split(':');\n                //alert(n[1]);\n                var sSummary = parseInt(n[1], 10);\n                if(sSummary === 14){\n                    document.getElementById(\"clock\").style.backgroundColor =\"transparent\";\n                }\n                if(sSummary < 14){\n                    document.getElementById(\"clock\").style.backgroundColor =\"#FF0033\";\n                }\n            }else{\n                displayTitle(data);\n            }\n        });\n        setInterval(upTime,1000);\n    })(scope);\n</script>","storeOutMessages":false,"fwdInMessages":false,"templateScope":"local","x":160,"y":100,"wires":[[]]},{"id":"1c70d4cd.325c0b","type":"ui_group","z":"","name":"LiveVideo","tab":"df07ccac.714e9","disp":false,"width":"35","collapse":false},{"id":"df07ccac.714e9","type":"ui_tab","z":"","name":"LiveVideo","icon":"dashboard","disabled":false,"hidden":false}]
1 Like

Problems figuring out your ip cam URL?

https://security.world/rtsp/

Thanks, that seems to work. (All though I still need to work out the ip cam URL (its behind a password)). Did you write this script yourself, or is it based on something you have found?

yes, did u see my link above?

Depending on the make; ex linksys with password:

http://user:pass@192.168.2.1/snapshot.jpg?user=user&pwd=pass

That seems to work Thangodelta. It’s not updating sadly. maybe I need to add a random number after every reload behind the “?” in the url. Anyway, thanks for sharing.

Checkweb should do that job for you, myself pic is updated every 30 sec