0.0.17 • Published 3 years ago
mytelegrammenu v0.0.17
MyTelegramMenu
iobroker.telegram, iobroker,enums, nodejs, smarthome,telegram, telegra.ph,generates a menu from the enumerations in the iobroker, IFTTT , Google Home , Google Sheets
demo
install
- install and configure the iobroker.telegram adapter
- install this package in your iobroker folder with
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);
configure
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'
default Options
- 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;
adding a enum-objects for telegrammenu
supported types
- 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
menu control
- you can display the menu like this:
/menue
report states with telegra.ph
creating google sheets JSON endpoint
Connect IFTTT to the google sheet
adding a enum-objects for google commands
googleIgnoreEnumName flag
Changelog
0.17 (2021-17-02)
- add support for states (type of string)
0.16 (2021-17-02)
- when the telegram adapter sends an empty string, the last command in memory is not executed again
0.15 (2021-06-02)
- fixing polling restart if the table could not be read
0.14 (2020-13-12)
- automatic restart goolge sheet polling after 1 min
- add option to deactivate polling restart
0.13 (2020-05-12)
- some small bugfix with google polling
- add option googleIgnoreEnumName to ignore enum names
- add state for google lastCommand
0.12 (2020-11-29)
- 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
0.11 (2020-11-22)
- Output text to telegram adjusted for non-writeable values.
- fix unhandledRejection
- validity range when setting values (for example shelly shutter min/max position)