Skip to content

Instantly share code, notes, and snippets.

View unixweb's full-sized avatar
🏠
Working from home

Joachim Hummel unixweb

🏠
Working from home
View GitHub Profile
@unixweb
unixweb / assistant_library_with_local_commands_demo.py
Last active November 11, 2017 18:31 — forked from t1m0thyj/assistant_library_with_local_commands_demo.py
Custom src/main.py script for Google Assistant on Raspberry Pi
#!/usr/bin/env python3
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@unixweb
unixweb / main.py
Created November 11, 2017 20:58 — forked from yodakohl/main.py
#!/usr/bin/env python3
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@unixweb
unixweb / main.py
Last active January 15, 2018 20:21
main.py for Google-Assistant AIY Project
#!/usr/bin/env python3
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@unixweb
unixweb / flow.json
Last active November 20, 2017 11:37
Satellite Tracking with Node-Red
[{"id":"3032c892.f64c88","type":"change","z":"714cf6f5.79bd2","name":"... to \"ISS\"","rules":[{"t":"set","p":"payload","pt":"flow","to":"ISS","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":435,"y":393,"wires":[[]]},{"id":"65fd3912.8c08f8","type":"inject","z":"714cf6f5.79bd2","name":"Set flow.payload ...","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":171,"y":392,"wires":[["3032c892.f64c88"]]},{"id":"6cca73f6.c2f5dc","type":"inject","z":"714cf6f5.79bd2","name":"Set flow.payload ...","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":168,"y":447,"wires":[["e4611412.f78248"]]},{"id":"e4611412.f78248","type":"change","z":"714cf6f5.79bd2","name":"... to \"AGGIESAT\"","rules":[{"t":"set","p":"payload","pt":"flow","to":"AGGIESAT","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":447,"y":448,"wires":[[]]},{"id":"368e42a7.a7ee3e","type":"change","z":"714cf6f5.79bd2","name":"... to \"CUBESAT\"
@unixweb
unixweb / fritz-box-callmonitor.json
Last active March 28, 2018 23:16
FritzBox Call Monitor with Web Push Notification
[
{
"id": "5201f39c.5bf36c",
"type": "inject",
"z": "bce2c081.53f4e",
"name": "Click to Test",
"topic": "Test Caller",
"payload": "{\"type\":\"INBOUND\",\"id\":\"0\",\"timestamp\":\"21.11.17 10:15:45\",\"caller\":\"0151123456789\",\"callee\":\"89898989\"}",
"payloadType": "json",
"repeat": "",
@unixweb
unixweb / moon-calender.json
Last active December 3, 2017 20:14
Moon Calender for Node-Red to implement in any smarthome solution
[{"id":"c22423c2.1e727","type":"inject","z":"43367500.55eb6c","name":"make request","topic":"","payload":"","payloadType":"date","repeat":"3600","crontab":"","once":false,"x":146,"y":168.00000190734863,"wires":[["995dc366.8a14e"]]},{"id":"995dc366.8a14e","type":"http request","z":"43367500.55eb6c","name":"","method":"GET","ret":"txt","url":"https://www.timeanddate.de/mond/phasen/deutschland/muenchen","tls":"","x":356.51953887939453,"y":167.0000057220459,"wires":[["c82b2ba.c1f4bd8"]]},{"id":"c82b2ba.c1f4bd8","type":"html","z":"43367500.55eb6c","name":"","tag":"div.three p","ret":"html","as":"single","x":559.5195541381836,"y":166.99999809265137,"wires":[["4f5c03b6.a6543c"]]},{"id":"4f5c03b6.a6543c","type":"function","z":"43367500.55eb6c","name":"Parse msg","func":"// outputs: 2\nmsg.payload = msg.payload[0]; \nreturn msg;","outputs":1,"noerr":0,"x":757.5195846557617,"y":165.00000476837158,"wires":[["da31befc.20712"]]},{"id":"da31befc.20712","type":"switch","z":"43367500.55eb6c","name":"","property":"payload","p
@unixweb
unixweb / google-home-flow.json
Last active January 7, 2018 08:42
Google Home Speech with Node-Red
[{"id":"bb4433fd.83e2e8","type":"mqtt in","z":"7178696f.8022","name":"Air Pressure","topic":"pressure/p1","qos":"2","broker":"f0d962da.ee7f7","x":113,"y":75.99996948242188,"wires":[["5f72bbfe.d37b3c"]]},{"id":"5f72bbfe.d37b3c","type":"function","z":"7178696f.8022","name":"Time and Date","func":"// (1) wandelt timestamo ins ISO Datumformat um\n//msg.timestamp= new Date().toISOString()\n\n// (2) beliebiges Datum festlegbar: hier: YYYY-MM-DD HH:MM.SS\n// (Ausgabeformat wird am Ende zusammengestellt)\nvar now = new Date(); \nvar year = now.getFullYear();\nvar month = now.getMonth()+1; \nvar day = now.getDate();\nvar hour = now.getHours();\nvar minute = now.getMinutes();\nvar second = now.getSeconds(); \nif(month.toString().length == 1) {\nvar month = '0'+month;\n}\nif(day.toString().length == 1) {\nvar day = '0'+day;\n} \nif(hour.toString().length == 1) {\nvar hour = '0'+hour;\n}\nif(minute.toString().length == 1) {\nvar minute = '0'+minute;\n}\nif(second.toString().length == 1) {\nvar sec
@unixweb
unixweb / fritzbox.json
Created March 4, 2018 13:08
Anwesendheit prüfen über Fritzbox
[{"id":"8193bec1.ab0e2","type":"function","z":"12894464.d36a6c","name":"format output","func":"msg.payload = msg.payload.NewActive\nreturn msg;\n","outputs":1,"noerr":0,"x":640,"y":160,"wires":[["e10b8db6.e65618"]]},{"id":"e10b8db6.e65618","type":"debug","z":"12894464.d36a6c","name":"","active":true,"tosidebar":true,"console":false,"complete":"false","x":850,"y":160,"wires":[]},{"id":"1df720be.9bcdb7","type":"fritzbox-in","z":"12894464.d36a6c","device":"226d6f30.6449e","name":"","service":"urn:dslforum-org:service:Hosts:1","action":"GetSpecificHostEntry","arguments":"{\"NewMACAddress\":\"value\"}","x":410,"y":160,"wires":[["8193bec1.ab0e2"]]},{"id":"a24eaab8.1743c","type":"inject","z":"12894464.d36a6c","name":"20:82:C0:26:86:FE","topic":"","payload":"{\"NewMACAddress\":\"30:X7:XD:XX:XX:XX\"}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":"","x":190,"y":160,"wires":[["1df720be.9bcdb7"]]},{"id":"226d6f30.6449e","type":"fritzbox-config","z":"","name":"","host":"192.168.1.1","port":"49000
@unixweb
unixweb / simbutler.py
Last active June 4, 2019 17:35
GSM Raspberry Pi SMS Butler
# SIMBUTLER.py
# pip install pyserial
import RPi.GPIO as GPIO
import serial
import time, sys
import datetime
P_BUTTON = 24 # Button, adapt to your wiring
@unixweb
unixweb / sensor-dht22.py
Created May 6, 2018 09:37
Read Sensors Data from DHT11 / DHT22 and push the data into a InfluxDB
# Copyright (c) 2014 Adafruit Industries
# Author: Tony DiCola
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions: