DzVents notify subsystem Telegram not working  [Solved]

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

Post Reply
delcara
Posts: 11
Joined: Wednesday 07 November 2018 10:48
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10171
Location: Netherlands
Contact:

DzVents notify subsystem Telegram not working

Post by delcara »

Version: 4.10197
Build Hash: 90c95998
Compile Date: 2018-11-11 15:33:34
dzVents Version: 2.4.7

When I try to only sent notifications to Telegram it's not working, I receive notifications on all configured services. (Email, pushover, telegram etc..)

The code below is working for pushover:

Code: Select all

dz.notify("Domoticz", "test", dz.PRIORITY_NORMAL,dz.SOUND_DEFAULT, "" , dz.NSS_PUSHOVER)
When I replace dz.NSS_PUSHOVER whith dz.NSS_TELEGRAM I receive notifications on all services. Maybe it's a stupid simple thing but I can't seem to get it working. Is the syntax different for Telegram?

This is not working:

Code: Select all

dz.notify("Domoticz", "test", dz.PRIORITY_NORMAL,dz.SOUND_DEFAULT, "" , dz.NSS_TELEGRAM)
Raspberry pi 3, Domoticz Beta, Nginx, dzVents 2.7.4, RFXtrx433e, P1 smart meter, Harmony, Hue, Zwave, Amazon echo, Sonos, Synology DS413, HomeBridge, HA Bridge, Ubiquiti.
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: DzVents notify subsystem Telegram not working

Post by waaren »

delcara wrote: Monday 12 November 2018 13:58 When I try to only sent notifications to Telegram it's not working, I receive notifications on all configured services. (Email, pushover, telegram etc..)
This is not working:

Code: Select all

dz.notify("Domoticz", "test", dz.PRIORITY_NORMAL,dz.SOUND_DEFAULT, "" , dz.NSS_TELEGRAM)
Please have a look here as Telegram is not implemented in dzVents yet
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
delcara
Posts: 11
Joined: Wednesday 07 November 2018 10:48
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10171
Location: Netherlands
Contact:

Re: DzVents notify subsystem Telegram not working

Post by delcara »

Thnx, noted. Will try with this function in global_data till telegram support comes to DzVents.
Raspberry pi 3, Domoticz Beta, Nginx, dzVents 2.7.4, RFXtrx433e, P1 smart meter, Harmony, Hue, Zwave, Amazon echo, Sonos, Synology DS413, HomeBridge, HA Bridge, Ubiquiti.
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: DzVents notify subsystem Telegram not working  [Solved]

Post by waaren »

delcara wrote: Monday 12 November 2018 14:45 Thnx, noted. Will try with this function in global_data till telegram support comes to DzVents.
Did a little bit of research and this code does also work on my system

Code: Select all

 dz.notify("Domoticz", "test", dz.PRIORITY_NORMAL,dz.SOUND_DEFAULT, "" , "telegram")
One other option is to add this line

Code: Select all

		['NSS_TELEGRAM'] = 'telegram',
to domoticz/dzVents/runtime/Domoticz.lua (right after the line ['NSS_PUSHSAFER'] = 'pushsafer',) but then you have to repeat this every time when you update domoticz to a new version until @dannybloe, or someone else with enough knowledge of the GIT procedures, adds this to the version on GIT.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Joep123
Posts: 56
Joined: Monday 26 March 2018 18:44
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Contact:

Re: DzVents notify subsystem Telegram not working

Post by Joep123 »

I use https://api.telegram.org/bot6488742271: ... t=#MESSAGE in Custom HTTP/Action. Works perfect for Telegram notifications (Of course I changed the Chat ID and API).

Code: Select all

...... = {dz.NSS_HTTP}
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: DzVents notify subsystem Telegram not working

Post by waaren »

Joep123 wrote: Monday 12 November 2018 18:51 I use https://api.telegram.org/bot6488742271: ... t=#MESSAGE in Custom HTTP/Action. Works perfect for Telegram notifications (Of course I changed the Chat ID and API).

Code: Select all

...... = {dz.NSS_HTTP}
@Joep123, that is more or less the same approach as in the post I included in my original reply and that indeed works flawless. My preference for the dz.notify method I described in my later response is because you don't have to include the api-key and chat-id in your script.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
delcara
Posts: 11
Joined: Wednesday 07 November 2018 10:48
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10171
Location: Netherlands
Contact:

Re: DzVents notify subsystem Telegram not working

Post by delcara »

waaren wrote: Monday 12 November 2018 15:38
delcara wrote: Monday 12 November 2018 14:45 Thnx, noted. Will try with this function in global_data till telegram support comes to DzVents.
Did a little bit of research and this code does also work on my system

Code: Select all

 dz.notify("Domoticz", "test", dz.PRIORITY_NORMAL,dz.SOUND_DEFAULT, "" , "telegram")
One other option is to add this line

Code: Select all

		['NSS_TELEGRAM'] = 'telegram',
to domoticz/dzVents/runtime/Domoticz.lua (right after the line ['NSS_PUSHSAFER'] = 'pushsafer',) but then you have to repeat this every time when you update domoticz to a new version until @dannybloe, or someone else with enough knowledge of the GIT procedures, adds this to the version on GIT.
Thnx! I see you have already created a pull request. :D Implemented it and works fine. Will repeat this until every update until it is added to a beta release.
Raspberry pi 3, Domoticz Beta, Nginx, dzVents 2.7.4, RFXtrx433e, P1 smart meter, Harmony, Hue, Zwave, Amazon echo, Sonos, Synology DS413, HomeBridge, HA Bridge, Ubiquiti.
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: DzVents notify subsystem Telegram not working

Post by waaren »

delcara wrote: Tuesday 13 November 2018 7:41 I see you have already created a pull request. :D Implemented it and works fine. Will repeat this until every update until it is added to a beta release.
PR is merged. Telegram can be used natively from domoticz version 4.10200 (dzVents 2.4.8) onwards.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
delcara
Posts: 11
Joined: Wednesday 07 November 2018 10:48
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10171
Location: Netherlands
Contact:

Re: DzVents notify subsystem Telegram not working

Post by delcara »

Updated domoticz and using it natively now!
Raspberry pi 3, Domoticz Beta, Nginx, dzVents 2.7.4, RFXtrx433e, P1 smart meter, Harmony, Hue, Zwave, Amazon echo, Sonos, Synology DS413, HomeBridge, HA Bridge, Ubiquiti.
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest