SveinHa Skrevet 24. januar 2022 Skrevet 24. januar 2022 Har stående en gammel PC som kjører Node-Red Dashboard på TV-bordet. Siden armene mine ikke er flere meter lange laget jeg meg en enkel fjernstyring med en Ikea fjernkontroll. Funker supert: VID_20220124_121928.mp4 Bare en liten hake jeg ikke har fått til: Bildevalgene gjelder på ALLE nettlesere som har NR-Dashboard oppe. Ikke noe stort problem da men kunne likt muligheten til å styre bare enkelte... Har ikke funnet noe på nett... De strekene som kommer inn fra toppen er fra bevegelssensorer som automatisk viser kamerabilder. Siter
SveinHa Skrevet 22. november 2022 Forfatter Skrevet 22. november 2022 (endret) Tok litt tid før jeg tok tak i denne men nå har jeg løsningen klar. ui_control noden rapporterer både socketip og socketid når en browser kobler til NodeRed dashboard eller refresher siden. Når en ny socketid kommer fra en bestemt socketip lagrer jeg den og bruker den til å vise overvåkingsvideo på en bestemt skjerm når bevegelse registreres og vende tilbake til forrige bilde etter 20 sekund. Trenger litt justering av utseende men funksjonen er helt som jeg ønsket. Cluet ligger i de markerte nodene... Bildevalg fra fjernkontrollen er de forbindelsene som kommer inn i flowen nedenfra og er ikke relevante i denne sammenhengen. De har samme format som "Helmut" og "Entre" nodene men utføres uten "add socketid" noden. [{"id":"7702949852ab9901","type":"mqtt in","z":"4d395651357ab1b1","name":"BevegEldhus","topic":"zwave/Uteomraade/BevegEldhus/sensor_binary/endpoint_0/Any","qos":"2","datatype":"json","broker":"6db118ed1b0c56de","nl":false,"rap":true,"rh":0,"inputs":0,"x":90,"y":360,"wires":[["475f02fe182bf068","577772c49ea70155"]]},{"id":"11c3d40831e324b5","type":"mqtt in","z":"4d395651357ab1b1","name":"BevegGarUteNexa","topic":"zwaveGar/Uteomraade/BevegGarUteNexa/notification/endpoint_0/Home_Security/Motion_sensor_status","qos":"2","datatype":"json","broker":"6db118ed1b0c56de","nl":false,"rap":true,"rh":0,"inputs":0,"x":110,"y":480,"wires":[["516a496003dad587","c9d0a0f1ccd57266"]]},{"id":"475f02fe182bf068","type":"switch","z":"4d395651357ab1b1","name":"","property":"payload.value","propertyType":"msg","rules":[{"t":"true"}],"checkall":"true","repair":false,"outputs":1,"x":330,"y":360,"wires":[["49449e970e40a358","f1b326d487677ad4","cfe152ea919d8b93"]]},{"id":"516a496003dad587","type":"switch","z":"4d395651357ab1b1","name":"","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"8","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":330,"y":480,"wires":[["2a94f8c3bf6b4982"]]},{"id":"30095807eb325e40","type":"comment","z":"4d395651357ab1b1","name":"Vis kamerabilder i NodeRed Dashboard","info":"","x":170,"y":310,"wires":[]},{"id":"b64b1cf56eef2b3b","type":"delay","z":"4d395651357ab1b1","name":"","pauseType":"delay","timeout":"20","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"minute","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"allowrate":false,"outputs":1,"x":940,"y":400,"wires":[["a2749f7f9e3d72b0"]]},{"id":"f1b326d487677ad4","type":"function","z":"4d395651357ab1b1","name":"Reset delay","func":"//msg.delay = 600000;\nvar m1 = {reset:true};\nreturn [[m1,msg]];","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":770,"y":400,"wires":[["b64b1cf56eef2b3b"]]},{"id":"8196a6433dfa46fe","type":"inject","z":"4d395651357ab1b1","name":"","props":[{"p":"payload.value","v":"true","vt":"bool"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":330,"y":390,"wires":[["475f02fe182bf068"]]},{"id":"062a3c835cb1998a","type":"inject","z":"4d395651357ab1b1","name":"","props":[{"p":"payload.value","v":"8","vt":"num"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":330,"y":510,"wires":[["516a496003dad587"]]},{"id":"65c3fad08f3dc9d3","type":"ui_ui_control","z":"4d395651357ab1b1","name":"ui control","events":"connect","x":1310,"y":490,"wires":[["9c297afa411c710c","6aac88457b632369","07cfd0f76eb8d4ab","efdabe0971a921ab"]]},{"id":"a2749f7f9e3d72b0","type":"function","z":"4d395651357ab1b1","name":"Vis forrige bilde","func":"var bv = flow.get(\"BildeValg\")||\"Solar\"\n\n//var value=msg.payload;\nsvar = {payload:bv};\nreturn svar;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1150,"y":400,"wires":[["c938750bba76d43a"]]},{"id":"b1bdfa7a379384e5","type":"show-value","z":"4d395651357ab1b1","name":"","path":"","x":1140,"y":500,"wires":[["65c3fad08f3dc9d3","809b154c6b6ea105"]]},{"id":"577772c49ea70155","type":"show-value","z":"4d395651357ab1b1","name":"","path":"","x":80,"y":410,"wires":[[]]},{"id":"c9d0a0f1ccd57266","type":"show-value","z":"4d395651357ab1b1","name":"","path":"","x":80,"y":530,"wires":[[]]},{"id":"809b154c6b6ea105","type":"ui_iframe","z":"4d395651357ab1b1","group":"0cf69380855e1696","name":"","order":2,"width":"28","height":"22","url":"","origin":"*","scale":"80","x":1300,"y":540,"wires":[[]]},{"id":"9c21d649cb27f532","type":"switch","z":"4d395651357ab1b1","name":"PortV","property":"PortV","propertyType":"flow","rules":[{"t":"eq","v":"Stengt","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":580,"y":480,"wires":[["49449e970e40a358","f1b326d487677ad4","18654cf9e563b9cf"]]},{"id":"2a94f8c3bf6b4982","type":"switch","z":"4d395651357ab1b1","name":"PortH","property":"PortH","propertyType":"flow","rules":[{"t":"eq","v":"Stengt","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":460,"y":480,"wires":[["9c21d649cb27f532"]]},{"id":"49449e970e40a358","type":"link out","z":"4d395651357ab1b1","name":"MonitorerPå Out","mode":"link","links":["bcf9c82e2eceeb0a"],"x":635,"y":430,"wires":[]},{"id":"bb738e6b0cb8f7a7","type":"change","z":"4d395651357ab1b1","name":"store socketid1","rules":[{"t":"set","p":"sock1","pt":"flow","to":"socketid","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1490,"y":550,"wires":[[]]},{"id":"c938750bba76d43a","type":"change","z":"4d395651357ab1b1","name":"add socketid","rules":[{"t":"set","p":"socketid","pt":"msg","to":"sock1","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":1140,"y":450,"wires":[["b1bdfa7a379384e5"]]},{"id":"18654cf9e563b9cf","type":"change","z":"4d395651357ab1b1","name":"Helmut","rules":[{"t":"set","p":"url","pt":"msg","to":"http://172.16.0.101:10101/mjpg/HelmutCam/video.mjpg?q=40&s=100","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"Helmut","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":750,"y":480,"wires":[["b011e285def856b6"]]},{"id":"cfe152ea919d8b93","type":"change","z":"4d395651357ab1b1","name":"Entre","rules":[{"t":"set","p":"url","pt":"msg","to":"http://172.16.0.101:10101/mjpg/Entre/video.mjpg?q=40&s=100","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"Entre","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":740,"y":360,"wires":[["b011e285def856b6"]]},{"id":"b011e285def856b6","type":"change","z":"4d395651357ab1b1","name":"Show Videopage","rules":[{"t":"set","p":"payload","pt":"msg","to":"Kamera","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":930,"y":450,"wires":[["c938750bba76d43a"]]},{"id":"9c297afa411c710c","type":"debug","z":"4d395651357ab1b1","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"url","statusType":"auto","x":1480,"y":350,"wires":[]},{"id":"6aac88457b632369","type":"debug","z":"4d395651357ab1b1","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"socketid","targetType":"msg","statusVal":"url","statusType":"auto","x":1480,"y":400,"wires":[]},{"id":"07cfd0f76eb8d4ab","type":"debug","z":"4d395651357ab1b1","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"socketip","targetType":"msg","statusVal":"url","statusType":"auto","x":1480,"y":450,"wires":[]},{"id":"efdabe0971a921ab","type":"switch","z":"4d395651357ab1b1","name":"IP ...132","property":"socketip","propertyType":"msg","rules":[{"t":"eq","v":"172.16.0.132","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1470,"y":510,"wires":[["bb738e6b0cb8f7a7"]]},{"id":"6db118ed1b0c56de","type":"mqtt-broker","name":"DaleMQTT","broker":"172.16.0.94","port":"1883","clientid":"","autoConnect":true,"usetls":false,"protocolVersion":"5","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"sessionExpiry":""},{"id":"0cf69380855e1696","type":"ui_group","name":"Video","tab":"8f4c3716a72a96a8","order":1,"disp":false,"width":"32","collapse":false,"className":""},{"id":"8f4c3716a72a96a8","type":"ui_tab","name":"Kamera","icon":"videocam","order":11,"disabled":false,"hidden":false}] Endret 22. november 2022 av SveinHa Siter
Anbefalte innlegg
Bli med i samtalen
Du kan publisere innhold nå og registrere deg senere. Hvis du har en konto, logg inn nå for å poste med kontoen din.