potrudeau / homebridge-messenger

Send HomeKit messages with HomeBridge (Pushover / IFTTT / Email)
MIT License
105 stars 9 forks source link

Got SIGTERM, shutting down Homebridge... when Error: application token is invalid #2

Closed DJay-X closed 4 years ago

DJay-X commented 4 years ago

Thanks to your new discovered plugin I'm trying to also play around Pushover. I noticed that homebridge is crashing when the token is invalid. Maybe not the whole homebridge should stop working and crash in such a case?

Thanks in advance. Love that I have found your project.

Apr 23 15:34:57 raspberrypi-3BPlus homebridge[6416]: [2020-4-23 15:34:57] [Messenger] Test-Pushover-Messages : Message sent to xxxxxxxxx
Apr 23 15:34:57 raspberrypi-3BPlus homebridge[6416]: [2020-4-23 15:34:57] Error: application token is invalid
Apr 23 15:34:57 raspberrypi-3BPlus homebridge[6416]:     at Pushover.errors (/usr/local/lib/node_modules/homebridge-messenger/node_modules/pushover-notifications/lib/pushover.js:83:12)
Apr 23 15:34:57 raspberrypi-3BPlus homebridge[6416]:     at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/homebridge-messenger/node_modules/pushover-notifications/lib/pushover.js:167:11)
Apr 23 15:34:57 raspberrypi-3BPlus homebridge[6416]:     at IncomingMessage.emit (events.js:322:22)
Apr 23 15:34:57 raspberrypi-3BPlus homebridge[6416]:     at endReadableNT (_stream_readable.js:1187:12)
Apr 23 15:34:57 raspberrypi-3BPlus homebridge[6416]:     at processTicksAndRejections (internal/process/task_queues.js:84:21)
Apr 23 15:34:57 raspberrypi-3BPlus homebridge[6416]: [2020-4-23 15:34:57] Got SIGTERM, shutting down Homebridge...
DJay-X commented 4 years ago

And I have problems to identify what my "user" and "token" is?

When I go over to https://pushover.net and login, I did "Create a New Application". I received a API Token/Key like "ab34cd78ef12gh56ij90kl34mn78op" I assume this is to put in the config under "token": "ab34cd78ef12gh56ij90kl34mn78op". But what do I have to use for "user": "xxxx",? Obviously it's not my E-Mail I login to Pushover.

Unfortunately I can't find anything in the readme instructions here.

Sorry for bothering and thanks in advance.

potrudeau commented 4 years ago

To be honest, it's as designed. If Pushover or any other service is not able to send the message, it raises an error. The goal for this is to tell you that something is wrong. That being said, I will try and find an improvement on this. Homebridge doesn't have any warning mecanism.

potrudeau commented 4 years ago

For your other question, Pushover requires two things: Your application token AND your user key. Your user key is available in the dashboard

DJay-X commented 4 years ago

Saying that, this does make sense. 😅 "user": = User Key from Dashboard "token": = Create a New Application, API Token/Key

Thanks you. 🙈 Works now.

If you are willing and it is possible to implement url and attachment Pushover seems to be a great alternative for IFTTT Notification maybe. At lease another option.

potrudeau commented 4 years ago

URL is possible. So is sending HTML messages.

Attachment would probably require to add a file upload fonction. See pushover API. That doesn't seem like a good idea.

DJay-X commented 4 years ago

I thought it would maybe possible to grab the image from an URL like IFTTT is doing it.

I use the URL for URL-Scheme to open with the Push an Application like evehome:// or HomeConnect://

Maybe you move me over to your plugin completely by finding some equal features. :)

By the way, I miss your PayPal or BuyMeACoffee link. ;)

Thanks a lot. I appreciate your work and the friendly contact.

potrudeau commented 4 years ago

IFTTT is a bit different than Pushover. The APIs are not the same. However, Pushover is faster and more reliable. You could have an image in HTML format like this in your message. That will work once the HTML property will be added.

2020-04-23 10_40_52-Homebridge-Dev

DJay-X commented 4 years ago

That looks perfect to me. Main thing is to insert a custom url to point to the image. And the Image is showing up in the notification like in the example. 80095383-1eea8380-8568-11ea-88dc-aaa924ac3d6d An click on "View", I think in Pushover it's "Open URL" would open what is under "url": evehome://

👍

potrudeau commented 4 years ago

URL and Message will be added when issue #3 will be completed. It will used Pushover's features. It should work like you wish (but it's not related to plugin, but how Pushover works).

I will close this issue.