Node-RED
Auf dem Raspi. Der Raspi ist die ideale Plattform.
Hier sind die ersten Versuche: https://sites.google.com/site/raspihs1/software/node-red
Hier ist die Hauptseite von Node-Red :
https://nodered.org/docs/tutorials/first-flow
Funktion :
// Create a Date object from the payload
var date = new Date(msg.payload);
// Change the payload to be a formatted Date string
msg.payload = date.toString();
// Return the message so it can be sent on
return msg;
https://cookbook.nodered.org/basic/
Welche Version von node.js ist schon auf dem Raspi drauf ?
$ node -v
Als erstes Mal die Updates einspielen (Geht zunächst auch ohne das)
$ update-nodejs-and-nodered
Und endlich :
$ node-red-start
Start Node-RED
Once Node-RED has started, point a browser at http://192.168.178.64:1880 (/ui)
Dashboard at http://192.168.178.64:1880/ui
Use node-red-stop to stop Node-RED
Use node-red-start to start Node-RED again
Use node-red-log to view the recent log output
Use sudo systemctl enable nodered.service to autostart Node-RED at every boot
Use sudo systemctl disable nodered.service to disable autostart on boot
______
Dashboard installieren: Entweder so : https://randomnerdtutorials.com/getting-started-with-node-red-dashboard/
oder auch aus dem laufenden Node-RED.
Dashboard : Start im pi - Startverzeichnis : pi@pi3:~ $
(pi@pi3:~ $ node-red-stop)
pi@pi3:~ $ cd ~/.node-red
pi@pi3:~/.node-red $ npm install node-red-dashboard
Piface : (Von den zwei Paketen das folgende gewählt : node-red-contrib-piface-digital 0.0.5 )
https://flows.nodered.org/node/node-red-contrib-piface-digital
! Das SPI Interface aktivieren !
( Ich habe noch nicht verstanden, was das Folgende soll. Deswegen habe ich es noch nicht gemacht :
After rebooting you should add your user to the SPI-Group, e.g. for user pi:
usermod -a -G spi pi . )
pi@pi3:~ $ git clone https://github.com/piface/libmcp23s17.git
pi@pi3:~ $ cd libmcp23s17/
pi@pi3:~/libmcp23s17 $ make
pi@pi3:~/libmcp23s17 $ sudo make install
pi@pi3:~/libmcp23s17 $
pi@pi3:~/libmcp23s17 $ git clone https://github.com/piface/libpifacedigital.git
pi@pi3:~/libmcp23s17 $ cd libpifacedigital/
pi@pi3:~/libmcp23s17/libpifacedigital $ make
pi@pi3:~/libmcp23s17/libpifacedigital $ sudo make install
pi@pi3:~/libmcp23s17/libpifacedigital $
pi@pi3:~/libmcp23s17/libpifacedigital $ cd ..
pi@pi3:~/libmcp23s17 $ cd ..
pi@pi3:~ $
pi@pi3:~ $ cd ~/.node-red
pi@pi3:~/.node-red $ npm install node-red-contrib-piface-digital
...
make: Verzeichnis „/home/pi/.node-red/node_modules/node-pifacedigital/build“ wird verlassen
+ node-red-contrib-piface-digital@0.0.5
added 100 packages from 75 contributors and audited 291 packages in 65.978s
found 0 vulnerabilities
pi@pi3:~/.node-red $
pi@pi3:~/.node-red $ date
So 7. Apr 13:26:32 CEST 2019
pi@pi3:~/.node-red $
Ausprobieren :
OWFS :
https://flows.nodered.org/node/node-red-contrib-owfs
pi@pi3:~ $ cd ~/.node-red
pi@pi3:~/.node-red $ npm install node-red-contrib-owfs
+ node-red-contrib-owfs@1.2.0
added 4 packages from 4 contributors and audited 297 packages in 10.646s
found 0 vulnerabilities
pi@pi3:~/.node-red $
___________________________
Der aktuellen Status der Raumtemperatur https://flows.nodered.org/node/node-red-contrib-heater-controller
https://github.com/node-red/node-red-nodes/tree/master/hardware/PiFace
https://flows.nodered.org/node/node-red-contrib-piface-digital
http://www.steves-internet-guide.com/node-red-variables/
var count=global.get('gcount') || 0;
count += 1 ;
global.set('gcount',count);
msg.payload = count ;
return msg;
https://developer.mozilla.org/de/docs/Web/JavaScript
https://github.com/njh/node-red-contrib-owfs
Noch nicht getestet : https://github.com/bashGroup/node-red-contrib-smartfritz
Diesen Node hat die c't beschrieben : https://flows.nodered.org/node/node-red-contrib-fritz
https://tech.scargill.net/node-red-and-highcharts/
https://flows.nodered.org/node/node-red-contrib-simpletime
Apple Homekit Integration : https://youtu.be/99cgVSt_kGE
Baue eine Alarmanlage mit iOS (Home Assistant How-To) : https://youtu.be/SuoSXVqjyfc
Vorhandene Nodes und Flows : https://flows.nodered.org/?term=bosc&num_pages=1