DE

EgiGeoZone

EgiGeoZone Forum

Download

 

EgiGeoZone Telegram Plugin

Go to version history

Description

The new EgiGeoZone Telegram Plugin https://play.google.com/store/apps/details?id=de.egi.geofence.geozone.plugin.tgm can send commands in form of messages to the FHEM TelegramBot module. The messages are sent via the Telegram message service.
It is conceivable that such messages can also be sent to other bots or subscribers.

Install the TelegramBot module in Fhem

Here you can find the description: : https://wiki.fhem.de/wiki/TelegramBot

Registrieren des Bots

Attention: The EgiGeoZone Telegram plugin can not register a bot at the moment! Please use one of the official Telegram apps to register the bot.

After registering the bot, search him with the complete name in the official Telegram app and start a chat with him. For that  enter /start and submit or click the START button.

Set EgiGeoZone Telegram Plugin

 Now start the EgiGeoZone Telegram Plugin.

In the main dialog you should activate the plugin by clicking on the Enable Plugin button. Thus this will take up his work. If you do not want to send messages via this plugin, you can deactivate it here quickly.
Also in the EgiGeoZone app in the settings allow the transmission to the plugins.

main 


The red/green symbol should show the login status.

You can then specify up to six zones with the corresponding commands.
The name of the zone must exactly match the name from the EgiGeoZone app, otherwise the command will not be executed. Next to the name of the zone, enter the command or message.


By pre-defining the keyword defined in Fhem (attribute: "cmdKeyword"), the TelegramBot module from Fhem can execute the command directly.
You can also send an arbitrary string as a message and then have to interpret it in the Fhem itself and perform the appropriate actions. This can happen, for example, via a Notify.

Some variables can be specified in the message. These are replaced with the correct values ​​at runtime.

These are:

${zone} The name of the zone
${transition} enter / leave in words
${transitionType} 1 for Enter / 0 for Exit (as in the Geofancy module of Fhem)
${latitude} Latitude
${longitude} Longitude
${deviceId} Device ID
${date} Date / time in ISO format
${realLatitude} latitude reported from Google services, when the event is received
${realLongitude}  longitude reported from Google services, when the event is received
${accuracy}
accuracy reported from Google services, when the event is received

Log In

To log in, click the Login button.
Then enter and send the telephone number in the form of + 49XXX1111222. Shortly afterwards an SMS or a message is received in the official Telegram app with the confirmation code.


phone

Confirmation code

Enter this confirmation code in the following dialog. In addition, enter the first name, surname and the name of the bot, with "Bot" at the end of the name as it was registered!


code

Others

The plugin displays error messages and responses from the TelegramBot module from Fhem as notifications.
Restart authorization procedure: If any error messages appear, please log out and log in again.

A log file can be found in the tgmplugin directory. This is quite talkative in the first versions (log-level INFO). I will put this level on ERROR in a next version.

Tip: Using the official Telegram app you can follow the progress of the chat.

 

If you have any questions, please post them in the forum https://rpi.spdns.eu/egigeozone/index.php?board=17.0

 

Versions

02.03.2018 - Version 1.0.9

Version 1.0.9:
- Now you can use 3 more variables
    ${realLatitude}
    ${realLongitude}
    ${accuracy}

08.10.2017 - Version 1.0.7

Version 1.0.7:
- Bugfixing: At Test button the Transition and TransytionType variables were interchanged

01.06.2017 - Version 1.0.6

Version 1.0.6:
- Avoid sending message twice

17.05.2017 - Version 1.0.5

Version 1.0.5:
- Bugfixing

11.05.2017 - Version 1.0.4

Version 1.0.4:
- Delete saved properties (BOT ID und code) when logging out
- Test works now also first time after login
- Notification if bot not found

03.05.2017 - Version 1.0.3

Version 1.0.3:
- Set log level. error = less logs(... menu/log level)
- Show saved properties (... menu/properties)
- Bugfixing at logging