iobroker.telegram, iobroker,enums, nodejs, smarthome,telegram, telegra.ph,generates a menu from the enumerations in the iobroker, IFTTT , Google Home , Google Sheets
- install and configure the iobroker.telegram adapter
npm install mytelegrammenu
- create a new javascript in the iobroker
- add the following lines
const MyTelegramMenu = require('mytelegrammenu');
const options = {'enumList': ['rooms','functions'],
'locale':'de'};
const telegramMenu = new MyTelegramMenu(this,options);
you can set the following options, in the second line
- 'enumList' to select the enumeration you want to get displayed in telegram
- e.g. -> 'enumList': ['rooms','functions']
- possible value is a list of enumerations-name
- 'locale' to select language setting
- e.g. ->'locale':'en'
- possible values are 'de','en'
- 'telegramInstance' to select the telegram adapter instance
- e.g. 'telegramInstance' : 'telegram.0'
- possible value is a string of telegram adapter id
- 'feedbackToTelegram' if a state is switched via telegrammenu, you'll get an response
- e.g. 'telegramInstance': 'true'
- possible value is a boolean = true or false
- 'showRootItemsCommand' the command to display the menu
- e.g. 'showRootItemsCommand' : '/showMenu'
- this command should always start with an /
- 'MenuRows' how many buttons are there in a row?
- e.g. 'MenuRows':3
- 'MenuCols' how many buttons are in the column
- e.g. 'MenuCols':2
- 'enableGooglePolling' enable google sheet watching
- e.g 'enableGooglePolling' : true
- 'pollingInterval' how often the google sheet file is read in ms
- e.g. 'pollingInterval' : 700
- 'googleURL' JSON endpoint URL of your public Google Spreadsheets file
- e.g. 'googleURL' : 'https://spreadsheets.google.com/feeds/cells/[yourIDCode]/1/public/full?alt=json'
- googleEnumList : the enumeration list you want to use for google control
- 'googleIgnoreEnumName' : if this flag is true, we no longer need to confirm the enum name with. the googlehanlder looking only for state names.
- e.g 'googleIgnoreEnumName' : true
- 'googlePollingRestart' : automatic restart goolge sheet polling after 1 min
- e.g. 'googlePollingRestart : true'
- if you don't set an option value, the default values are:
'locale' = 'de'
'enumList' = ['rooms']
'telegramInstance' = 'telegram.0'
'feedbackToTelegram' = true
'showRootItemsCommand' = '/menue'
'MenuRows' = 3
'MenuCols' = 2
'enableGooglePolling' = false
'pollingInterval' = 750;
'googleURL' = '';
'googleEnumList' = '';
'googleIgnoreEnumName' = false;
'googlePollingRestart' = true;
- device and channel
- add all sub states
- states from type boolean (switch and button)
- states from type number
- states from type of string
if the states are writeable u can change all values with the menu
if a state not writeable telegrammenu show the current value of the state
- you can display the menu like this:
/menue
to control the telegram menu with google home we need google sheets as a JSON Endpoint
- Create a spreadsheet in Google Spreadsheets.
- Publish the sheet to the web.
- share the document with anyone and copy the link
- use the tempate link :
- use the link in options
- connect itfff to the table and then we can say google commands and these are written into the table. the telegram bot reads the table and executes the commands in iobroker
- go to https://ifttt.com/create/ and create the applet :
- than you can say "ok google schalte "Enum-Name" "StateName""
- and the bot is looking for the state and switch it
- only button or switch
if u ignore the enumnames with google polling u can say
"ok goolge [Ifttt-Command] [State Name]"
to switch a button
otherwise u have to say
"ok google [ifttt-command] [enumname] [state name]"
- add support for states (type of string)
- when the telegram adapter sends an empty string, the last command in memory is not executed again
- fixing polling restart if the table could not be read
- automatic restart goolge sheet polling after 1 min
- add option to deactivate polling restart
- some small bugfix with google polling
- add option googleIgnoreEnumName to ignore enum names
- add state for google lastCommand
- adding polling for google sheets
- adding new options for polling
- control states over google commands(reading sheets)
- refactoring telgrammenu and google comannds
- putting telegram commands in command pattern
- Output text to telegram adjusted for non-writeable values.
- fix unhandledRejection
- validity range when setting values (for example shelly shutter min/max position)