This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let CONFIG = { | |
| debug: false, | |
| active: false, // passive BLE scanning is sufficient | |
| // BTHome light sensor(s) that will report to this device | |
| sensorMACs: [ | |
| "3c:2e:f5:ba:e8:bd" // Shelly BLU Motion sensor | |
| ], | |
| lightId: 0, // Channel 0 in Lights x4 mode | |
| fullBrightness: 100, // max brightness | |
| minBrightness: 5, // min brightness (avoid completely dark) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let CONFIG = { | |
| // the BTHome motion and light sensors that will report to this device | |
| // add a Bluetooth MAC address for each reporting sensor | |
| sensorMACs: [ | |
| "3c:2e:f5:ba:e8:bd".toLowerCase() // Shelly BLU Motion sensor | |
| ], | |
| lightId: 0, // Channel 0 in Lights x4 mode | |
| fullBrightness: 100, // max when very bright ambient | |
| minBrightness: 5, // min when very dark (soft night light) | |
| timeoutSec: 300, // shared timeout for motion |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function subscribeToStatusUpdates(topic) { | |
| MQTT.subscribe(topic , function(t, message) { | |
| if (typeof message === "undefined" || message === null) { | |
| print("Received undefined or null message - ignoring"); | |
| return; | |
| } | |
| try { | |
| let payload = JSON.parse(message); | |
| if (payload.source === "button") { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # python configure_shelly.py --password <password> --method BLE.SetConfig --device-file .\shelly_ips.txt --config "{ \"rpc\": { \"enable\": true } }" | |
| # python configure_shelly.py --password <password> --method BLE.GetConfig --device-file .\shelly_ips.txt | |
| # python configure_shelly.py --password <password> --method Cloud.SetConfig --device-file .\shelly_ips.txt --config "{ \"enable\": true }" | |
| # python configure_shelly.py --password <password> --method Cloud.GetConfig --device-file .\shelly_ips.txt | |
| import requests | |
| import json | |
| from requests.auth import HTTPDigestAuth | |
| import argparse |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| alias: Speakers - Set Sleep Volume | |
| description: Set the volume of speakers lower overnight. | |
| triggers: | |
| - trigger: time | |
| at: "23:00:00" | |
| conditions: [] | |
| actions: | |
| - action: media_player.volume_set | |
| metadata: {} | |
| data: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| alias: Alert on Pool Gate Opened | |
| description: "" | |
| mode: single | |
| triggers: | |
| - type: opened | |
| device_id: 896de4d80d8fa631e58804be71b50b51 | |
| entity_id: f40b16da6652e7402e9b819f707cedf3 | |
| domain: binary_sensor | |
| for: | |
| hours: 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| alias: Office Lights - Follow Moulding Lights | |
| triggers: | |
| - entity_id: | |
| - switch.ofc_moulding_lights | |
| from: "on" | |
| to: "off" | |
| trigger: state | |
| - entity_id: | |
| - switch.ofc_moulding_lights | |
| from: "off" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import board | |
| import time | |
| import terminalio | |
| import displayio | |
| import digitalio | |
| from adafruit_display_text import label | |
| import adafruit_ili9341 | |
| # Release any resources currently in use for the displays | |
| displayio.release_displays() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var CosmosClient = require('@azure/cosmos').CosmosClient; | |
| var config = require('./config.js'); | |
| var client = new CosmosClient({ | |
| endpoint: config.connection.endpoint, | |
| auth: { masterKey: config.connection.authKey } | |
| }); | |
| async function upsertProcedureAndExecute(sprocDef, docToInsert) { | |
| const { database } = await client.databases | |
| .createIfNotExists({ id: config.names.database }); |
NewerOlder