Node-Red

http://robin.me/pi
node red stuff ======================== if the palette isn't showing, install it with: sudo apt update && sudo apt install npm ======================== Node-red-dashboard ======================== sudo apt-get install npm sudo npm install -g node-red-admin node-red-admin hash-pw Password: password CD012345678901234567890123456789 ======================== start node-red: node-red-start & node-red-stop start node-red as a service: sudo systemctl enable nodered.service ======================== to add security, edit .node-red/settings.js # # # # adminAuth: { type: "credentials", users: [{ username: "admin", password: "CD012345678901234567890123456789", permissions: "*" }] }, # # # adminAuth: { type: "credentials", users: [{ username: "admin", password: "CD012345678901234567890123456789", permissions: "*", username: "guest", password: "CD012345678901234567890123456789", permissions: "read" }] } adminAuth: { type: "credentials", users: [{ username: "admin", password: "CD012345678901234567890123456789", permissions: "*" }, {username: "guest", password: "CD012345678901234567890123456789", permissions: "read"} ] }, # # # # https: { key: fs.readFileSync('/home/pi/privkey.pem'), cert: fs.readFileSync('/home/pi/cert.pem') }, node-red-dashboard ===================== to create the password use node-red-admin hash-pw install it with: npm install -g node-red-admin ======================== raspi: set static ip sudo vi /etc/dhcpcd.conf ======================== audio works: sudo apt-get install festival install node-red-contrib-say install node-red-contrib-play-audio ======================== ======================== alarm in bed block one Please speak more loudly, except when I ask you to speak in a quiet voice. ======================== sudo npm install node-red-contrib-speakerpi sudo apt-get install libasound2-dev amixer cset numid=3 1 amixer cset numid=3 2 alsamixer ======================== node-red-contrib-sonoff-server ======================== Node Red Functions: https://nodered.org/docs/writing-functions
Javascript guide: https://developer.mozilla.org/en-US/docs/Web/JavaScript/A_re-introduction_to_JavaScript