This file contains 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
add | |
'"privatebus": true"' | |
to Service definition, i.e. on same scope as commands. |
This file contains 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
//use aura-sdk to switch aura light with iobroker :-) | |
//based on this: https://github.com/DanielRamosAcosta/aura-sdk/blob/master/example/rainbow.js | |
//known issue: The aura-sdk is not very reliable. I did not find a way to solve this, sadly. Sometimes it just won't switch at all. | |
//needs 32bit. For windows: | |
// * install iobroker instance using installer. | |
// * note node.js version that get's installed (or look it up after install by running node --version in iobroker terminal) | |
// * download the same node.js version in 32Bit (x86) from here: https://nodejs.org/dist/ as zip file, | |
// * make sure you download the file containinig win-x86, for example: https://nodejs.org/dist/v10.17.0/node-v10.17.0-win-x86.zip | |
// * go to the ioBroker-instance folder and rename the nodejs subfolder do nodejs_64 | |
// * create a new folder named nodejs -> extract the zip contents there |
This file contains 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
// I had an old AtmoLight ( http://www.mediacenter-pc.com/atmolight/ ) idling around. | |
// It is connected via USB (and creates a serial port) and controls four LED stripes | |
// So I wanted to control it with ioBroker. Here is the script for that. | |
// You should set the right serial port below: | |
//configure right serial port here. I recommend looking up the ID and replacing the scrint below by the id string. | |
//looks like: /dev/serial/by-id/[email protected]_AtmoLight_SMD_v04_23U9NVYR-if00-port0" | |
const portPath = "/dev/ttyUSB"; | |
//also you can configure the name of a folder in javascript.* here. There will be two states, brighness and color in there. |
This file contains 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
//manipulate FritzBox Hosts list using data.lua! | |
'use strict'; | |
const axios = require('axios').default; | |
const crypto = require('crypto'); | |
function buildUrl(host, path) { | |
return 'http://' + host + path; | |
} |
This file contains 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
const shoppingListId = 'lovelace.0.control.shopping_list'; | |
const alexa2BaseId = 'alexa2.0.Lists.SHOPPING_LIST'; //important. Needed for delete & update also. | |
const alexaAddToList = alexa2BaseId + '.#New'; | |
const alexaListId = alexa2BaseId + '.json'; | |
//switch off to silence: | |
const printDebug = true; | |
function debug(msg) { | |
if (printDebug) { |
This file contains 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
async function Berechnung () { | |
console.log("Berechnung: Start"); | |
const promise = new Promise(resolve => { | |
setTimeout(() => { resolve(1 + 1)}, 100); | |
}); | |
console.log("Berechnung: Ende"); | |
return promise; | |
} |