TIANE sample
Using the TIANE-Discord sample bundle
The TIANE-Discord example bundle in samples/tiane-discord shows how to make tiane act as a discord bot. TIANE is a german open source smart home assistant written in python. Here is a guide to how to get it working.
Prerequisites
- Working NodeCG & nodecg-io installation
- A working TIANE server installation. (No room client required)
- a Discord Bot token
Configure the TIANE sample bundle
-
Edit the file
samples/tiane-discord/extension/index.ts. Look for this lineconst discordChannel = ""; // Insert channel for the discord bot herePut the channel id of a discord channel where you want to talk to TIANE between the quotation marks. See here to find out how to get a channel id.
-
Run
npm run buildin the main nodecg-io directory. -
Edit the file
server/TIANE_config.jsonon your TIANE server:{ "websocket": "enabled", "websocket_port": 19526, "websocket_timeout": 20 }Make sure
websocketis either set toenabledorsecureand set a port of your desire. -
Start nodecg with nodecg-io installed. The TIANE-Discord bundle is currently part of it so it should also be loaded.
-
Go to the
nodecg-iotab in the nodecg dashboard. -
Login using your password. If this is your first run, then enter the password with which you want to encrypt your configurations and credentials.
-
Create a new TIANE service instance using the left upper menu.
-
Enter address of the TIANE-Server
The created instance should be automatically selected, if not select it in the upper left menu. Enter host and port you just set in
server/TIANE_config.jsonin this format:{ "address": "127.0.0.1:19526" }After entering it, click save.
Note: If you don't see the editor on the right, try reloading the page.
-
Create a new Discord service instance. (See the Discord Sample on how to do this)
-
Set the created TIANE and Discord service instances to the service dependency of the TIANE-Discord bundle.
Select the TIANE-Discord bundle and the TIANE service in the left bottom menu and then select the service instance that should be used by the TIANE-Discord bundle (in this case the name of the previously created twitch instance). Then do the ame for the discord bundle.
-
Ping your discord bot in the channel you set in the first step and ask tiane something.