Need a simple way of sending a notification to my phone

I have a scene that discovers when a host on the network is down. So this scene is not associated with any device on my Vera Plus - so there are no device notifications. I’ve looked at Vera Alerts. I’ve read some postings about it - some good - some not so good. It seems like a lot of configuration and setup. Is this the best solution for me?

Is VeraAlerts even still working? I ditched it because it was becoming unreliable. I use Telegram messenger with my Vera Plus now, should be a setup guide somewhere, maybe do a Google search.

Or maybe create a virtual switch device and control that also via your scene and use Vera’s own device alerts maybe.

Just a few ideas.

Think these were the original instructions I used to setup Telegram.

There was also later a Telegram plugin for Vera I think, still looking for that thread.

And here was the 3rd party Telegram plugin

OK - got telegram on my phone and created a bot. Installed the plugin on my Vera Plus. Have this in my scene code:

luup.call_action(“urn:bochicchio-com:serviceId:VeraTelegram1”, “Send”,
{
Text=“Inverter is down!!”,
Format = “Markdown”,
DisableNotification = false
}, 3028)

Not getting any messages on my phone. If I turn on debugging in the plugin I see this:

luup_log:3028: VeraTelegram(nil@193): executeCommand(“curl -k -H ‘Content-type: application/json’ ‘https://api.telegram.org/botMY_BOT_ID_AND_TOKEN/sendMessage?parse_mode=Markdown&chat_id=-1&text=Inverter+is+down!!&disable_notification=false’”): “{"ok":false,"error_code":400,"description":"Bad Request: chat not found"}” <0x707df520>

Obviously I have something wrong. Any suggestions? Almost has to be the Id and token.

Not sure I’ve never used that plugin myself. I just sent the commands directly via my scenes.

Its a curl command so maybe try and send that from the terminal command line of your Vera Plus as a test.

Or ask on the other plugin thread, someone may reply.

Bad request chat not found, sounds like its the wrong chat id ?

You need both the correct token and chat id I think.

I thought so too - but I still have the token showing on my phone screen: Use this token to access the HTTP API: (and the token follows). I’ve compared what’s there to what I have set i the plugin and it matches. 10 numbers for the ID and 35 characters for the token.

From the first post I linked too, try sending this LUA code in a regular Vera scene just as a test

Or you can send it from the Apps - Develop Apps - Test Luup Code (Lua) area of the Vera UI7 web UI.

luup.inet.wget('https://api.telegram.org/bot<token>/sendMessage?chat_id=<chat_id>&text=<text>',5);

So it would look something like this for example

luup.inet.wget('https://api.telegram.org/bot1488542467:BBF6VF5P-jDwq7VRS79r--UK4S7DNnIc5zP/sendMessage?chat_id=-654703176&text=Hello World' ,5);

If that works as a straight wget then you know your chat ID and token are correct.

Any other issues are to do with the plugin, which I don’t know about as I’ve never used that plugin. I’d had to install it and try it for myself to be sure.

Not sure what my chatid is - username?
maybe that’s my problem

No the Chat ID is a number.

You might have to use a URL like this in your browser, to obtain your chat ID -

https://api.telegram.org/botENTER-YOUR-TOKEN-HERE/getUpdates

It should then return some data and show you what your Chat ID number is etc.

I’ve not set up something properly: this is the response I got

ok true
result []

I get the same actually as what you just posted, maybe something has changed with their HTTP API since we first set this up.

So we need to figure out another way to get your chat iD.

Try this instead, the second part of the video shows you how to do it in the mobile app

You search for @RawDataBot and then press Start, it should send you a message with data and the chat ID can be found in there.

This might help also. Ezlo wrote a guide for using Telegram HTTP commands with their Meshbot rules system, but you can use them in Vera scenes also.

I’m not sure why the part using the URL with /getUpdates no longer seems to be working? That’s how we use to get our chat ID number.

OK - I have it working. In trying to fix this just now I had deleted the original bot which also deleted my username. I created a new bot and then tried to get the chat ID using @RawDataBot. But this doesn’t work if you don’t have a username. So I added a username, got the chat ID and the new token, updated the plugin and it seems to work now. I’m getting the alert I want.
Thanks for your help.

1 Like

Great we got there in the end !

VeraAlerts works without fail for me.

1 Like

Late to the game on this, but FYI for Vera notifications I use Prowl or Pushover…

Both links are a bit old, but both providers work flawlessly for me and have done for years (although I’m shifting from prowl to pushover due to the flexibility and customisation of alerts it gives)

1 Like