DzVents notify subsystem Telegram not working  [Solved]

Easy to use, 100% Lua-based event scripting framework.
Post Reply
delcara
Posts: 10
Joined: Wednesday 07 November 2018 11:48
Target OS: Raspberry Pi
Domoticz version: 4.10171
Location: Netherlands
Contact:

DzVents notify subsystem Telegram not working

Post by delcara » Monday 12 November 2018 14:58

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: 1344
Joined: Tuesday 03 January 2017 15:18
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Netherlands
Contact:

Re: DzVents notify subsystem Telegram not working

Post by waaren » Monday 12 November 2018 15:23

delcara wrote:
Monday 12 November 2018 14: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
Raspberry (debian stretch via berryboot on Synology DS916+) , Domoticz (almost) latest Beta, , dzVents 2.6, RFLink, RFXtrx433e, P1, Youless, Harmony, Hue, Yeelight, Xiaomi, HomeWizard, Zwave, Amazon echo

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

Re: DzVents notify subsystem Telegram not working

Post by delcara » Monday 12 November 2018 15:45

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: 1344
Joined: Tuesday 03 January 2017 15:18
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Netherlands
Contact:

Re: DzVents notify subsystem Telegram not working  [Solved]

Post by waaren » Monday 12 November 2018 16:38

delcara wrote:
Monday 12 November 2018 15: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.
Raspberry (debian stretch via berryboot on Synology DS916+) , Domoticz (almost) latest Beta, , dzVents 2.6, RFLink, RFXtrx433e, P1, Youless, Harmony, Hue, Yeelight, Xiaomi, HomeWizard, Zwave, Amazon echo

Joep123
Posts: 36
Joined: Monday 26 March 2018 18:44
Target OS: Raspberry Pi
Domoticz version: Beta
Contact:

Re: DzVents notify subsystem Telegram not working

Post by Joep123 » Monday 12 November 2018 19: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}

User avatar
waaren
Posts: 1344
Joined: Tuesday 03 January 2017 15:18
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Netherlands
Contact:

Re: DzVents notify subsystem Telegram not working

Post by waaren » Monday 12 November 2018 20:05

Joep123 wrote:
Monday 12 November 2018 19: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.
Raspberry (debian stretch via berryboot on Synology DS916+) , Domoticz (almost) latest Beta, , dzVents 2.6, RFLink, RFXtrx433e, P1, Youless, Harmony, Hue, Yeelight, Xiaomi, HomeWizard, Zwave, Amazon echo

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

Re: DzVents notify subsystem Telegram not working

Post by delcara » Tuesday 13 November 2018 8:41

waaren wrote:
Monday 12 November 2018 16:38
delcara wrote:
Monday 12 November 2018 15: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: 1344
Joined: Tuesday 03 January 2017 15:18
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Netherlands
Contact:

Re: DzVents notify subsystem Telegram not working

Post by waaren » Wednesday 14 November 2018 12:34

delcara wrote:
Tuesday 13 November 2018 8: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.
Raspberry (debian stretch via berryboot on Synology DS916+) , Domoticz (almost) latest Beta, , dzVents 2.6, RFLink, RFXtrx433e, P1, Youless, Harmony, Hue, Yeelight, Xiaomi, HomeWizard, Zwave, Amazon echo

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

Re: DzVents notify subsystem Telegram not working

Post by delcara » Wednesday 21 November 2018 18:37

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: No registered users and 1 guest