Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


[TUTORIAL] Pushover Notification Service


AutoFrank

Recommended Posts

Hi,

I have been working with the pushover service recently as an alternative the native notification service within the HC2. I think it is worth exploring if you are looking for another option. Since it is fresh in my mind I thought I'd document it and share to hopefully help others

This draws on previous work from @SDeath and @sj3fk3  and others so all credit goes to them.

 

STEP 1 – SIGN UP AND GET USER KEY

1.       Sign up at pushover.net, usual stuff. You can use a trial account for 7 days and after that you'll need to purchase a license per platform (ie iOS, Android, etc) irrespective of how many devices you have with each platform. The licenses per platform are approx €5 each so they shouldn't break the bank

2.       Open confirmation email and verify account

3.       Log back into pushover and make note of your User Key which will be something like ubp44xxxxxxxxxxxxxx8497aihkq and this  is your User Key

4.       Copy this out as you will need this in the scenes in HC2

 

Please login or register to see this attachment.

 

Note: There is also a pushover email address under your user key should you need this for another project but you don't need it for what we are doing here

 

STEP 2 - REGISTER YOU APPLICATION

1.       Scroll down to the bottom of the dashboard and click (Register Application/Create an API Token)

2.       Give it a Name (we call our HC2 domino so I named it domino) This will appear in your client device where you receive your messages

3.       Type = Application

4.       Description/URL and icon all optional. (I added an icon as it appears on the alerts that you receive on your client devices (72px x 72px, png) and attached is the one I used)

 

Please login or register to see this image.

/monthly_2017_02/589c3124997bf_image2.png.344fc484a0e3a7cf3991f7de86ac5cf8.png" />

 

5.       Check the box and Click Create Application

6.       This is the second Token Key, it’s something like aphmpbezxxxxxxxxxerqjwsg. Copy is out as you will need this in the scenes in HC2

 

Please login or register to see this attachment.

 

 

STEP 3 – ADD CLIENT DEVICES (TO RECEIVE ALERTS ON )

1.       Android/iOS - Download the app from the appropriate store playstore or appstore

2.       Log in to the app using your username and password that you got when you opened your pushover.net account

 

Please login or register to see this attachment.

 

3.       Give your device a name and click Register Device (I think it's better to avoid spaces and special characters if possible)

 

Please login or register to see this attachment.

 

4.       Go back to pushover.com and on your dashboard you'll see this new device added with the name you gave it. (Clicking the Pushover icon on the top left gets you back to your dashboard should you navigate off to another page)

 

Please login or register to see this attachment.

 

Repeat all part of STEP 3 for all other client devices. If you have multiple you'll end up with something like following

 

Please login or register to see this attachment.

 

You will see an Alert in your pushover app for each device that is added

 

Please login or register to see this attachment.

 

Within the pushover dashboard you can set up quiet times, groups and aliases but you don't need any of this to get started.

 

STEP 4 – HC2 SETUP

1.       Create a variable called pushoverBody in the top part of the variables panel

2.       Create a new scene called pushoverSend and copy the following code into it ( this is the 'engine' that will call the pushover api and  send the alert)

3.       You will need to add your own user key and token key to line 14

 

Please login or register to see this code.

 

4.       Create another scene and call the pushover Test

5.       Copy the following code to run a test (Change line 11 & 12 to the names of your device(s) that you wish to send the alert to. I have included 2 devices on my sample code) Change the Alert/Message Text as required

Please login or register to see this code.

6.       Confirm that you should see an alert on the devices that you specified

 

Please login or register to see this attachment.

 

This is the code that you can put into any scene that you wish to send an alert from, making the necessary adjustments to receiving devices, message and priority should you wish

Full details of the API can be found at

Please login or register to see this link.

 

After 7 days it will stop working and you will need to purchase the required licenses at ~ €5 each

 

.. and that it !!

 

-f

Edited by AutoFrank
  • Like 1
Link to comment
Share on other sites

  • 3 weeks later...
On 2/9/2017 at 10:11 PM, AutoFrank said:

f

Hi Frank

Get Debug line 13:attempt to concatenate local 'msg' (a nil value) on "pushoverSend "scene

Have copied both scenes, created "pushoverBody"global, inserted "user' and 'api token" and put user pushover devices line 8 of test scene.

pushover message works fine in test message from pushover app

 

Best guess?

Thanks Jamie

Edited by Jamie mccrostie
Link to comment
Share on other sites

  • Topic Author
  • 8 hours ago, Jamie mccrostie said:

    Hi Frank

    Get Debug line 13:attempt to concatenate local 'msg' (a nil value) on "pushoverSend "scene

    Have copied both scenes, created "pushoverBody"global, inserted "user' and 'api token" and put user pushover devices line 8 of test scene.

    pushover message works fine in test message from pushover app

     

    Best guess?

    Thanks Jamie

    @Jamie mccrostie

     

    Could you share what's on line 13 ? 

    Link to comment
    Share on other sites

  • Topic Author
  • 6 minutes ago, Jamie mccrostie said:

    Please login or register to see this attachment.

    Sorry ment to add that and got side tracked

    @Jamie mccrostie

     

    It looks like the global variable, referenced on line 13 does not exist. Could you check that it exists in the variables panel and if not could you create it and re run.

    Link to comment
    Share on other sites

    @AutoFrank  Here in  lies the problem with ipads, they want to captilise everything

     

     

    Working but you have to trigger both scenes at the same time. Sorted

    I get now ,its been a big day...

    Thanks

    Edited by Jamie mccrostie
    Link to comment
    Share on other sites

  • Topic Author
  • 21 minutes ago, Jamie mccrostie said:

    @AutoFrank  Here in  lies the problem with ipads, they want to captilise everything

     

     

    Working but you have to trigger both scenes at the same time. Sorted

    I get now ,its been a big day...

    Thanks

     

    @Jamie mccrostie

     

    super. Glad you got it working:-)

    Link to comment
    Share on other sites

    • T.Konopka featured this topic
    • 1 year later...

    The topic has been moved from "

    Please login or register to see this link.

    " to "

    Please login or register to see this link.

    ".

     

    Temat został przeniesiony z "

    Please login or register to see this link.

    " do "

    Please login or register to see this link.

    ".

    Link to comment
    Share on other sites

    • 5 months later...
    Guest andyhud

    Hi @AutoFrank

     

    Great work as ever. I'm in the process of setting up your Smart Message Hub

     

    So far I've got Pushover working on my Android 8.1 Oreo phone but when I run that test scene I always get 2 notifications to my phone, not one.

     

    Any idea why?

     

    Here is my code of the "pushoverSend" Scene

     

    Please login or register to see this code.

    and here is my Test Scene

     

    Please login or register to see this code.

    and here is the screenshot off my phone. I only clicked the "pushover Test" start button once, but got this many notifications on my phone!?!

    Thanks

     

    Andy

    Please login or register to see this attachment.

    Edited by andyhud
    Link to comment
    Share on other sites

  • Topic Author
  • 37 minutes ago, andyhud said:

    Any idea why?

    can you share your message hub scene code and the code you are using to call it ?

    I'll try and take a look later

    Link to comment
    Share on other sites

    Guest andyhud
    4 minutes ago, AutoFrank said:

    can you share your message hub scene code and the code you are using to call it ?

    I'll try and take a look later

     

    Hey @AutoFrank

     

    Thanks for your message. I should have clarified

     

    I have not done anything MessageHub related yet. Just this tutorial at the top of this thread for Pushover Notification Setup

     

    So all I have is the 2 Scenes (as per your tutorial above):

     

    • "pushoverSend"
    • "pushover Test"

     

    but when I click the arrow to execute the pushover Test scene it runs but I get multiple notifications to my phone as per the screenshot from my phone above

     

    Thanks again

     

    Andy

    Link to comment
    Share on other sites

    • 11 months later...

    Hi!
    This scene has worked for years, but since this friday, I get the following error in the debug log:

     

    [DEBUG] 21:25:36: Success: Invalid argument

     

    Anyone knows what I can do about it? I didn't changed a thing.

    Thanks in advance.

    Link to comment
    Share on other sites

    • 1 month later...
    On 11/6/2018 at 4:09 PM, andyhud said:

    Any idea why?

    some trouble

    I solved the problem for myself so:

     

    remove 2 lasts lines from pushoverSend scene

    Please login or register to see this code.

     

    and add this to triggered scene (pushover Test) with delay:

     

     

    Please login or register to see this code.

    now i have only one push at time

     

    • Thanks 1
    Link to comment
    Share on other sites

    • 6 months later...

    Hello everybody

    Here I would have a version for the HC3 as a QuickApp.
    Have fun with it!
    Greetings from Germany / Sauerland
    Frank

    Please login or register to see this attachment.

    • Like 1
    Link to comment
    Share on other sites

    • 1 year later...

    I you wan to have Prio 2 messages, you need to setup an expire for the message and even a retry.

    Example:

     

    local dvc, prio   = "yourphonename", "2"
    local rtr, exp    = "30", "3600"
    local ttl, msg    = "ALARM at home!", "Movement detected."
    local requestBody = '&device='..dvc ..'&priority=' ..prio ..'&retry=' ..rtr ..'&expire=' ..exp ..'&title=' ..ttl ..'&message=' ..msg 
    fibaro:setGlobal("pushoverBody", requestBody)
     

    Link to comment
    Share on other sites

    • 1 year later...

    Sorry to bring up an old thread but I'm just wondering how you add in sounds to your scene as above. I have tried adding in the below code but this does not allow for sounds to be played on my iPhone pro Max 13. The push notification does come through on my phone with the required text but just no sound. I'm pretty sure I may have got the code wrong below and just want to check with somebody on the forum who knows what they're doing if I have or if not how I can rectify it.

     

    Thanks,

     

    Hal

     

    Please login or register to see this code.

     

    Link to comment
    Share on other sites

    Hi @Hallamnet ,

     

    here is code for sending Pushover messages scene stripped from my UHAS Advanced Notification Center:

    Please login or register to see this code.

    Function sendHTTPmessage() is universal and can be used for all available notification services as included in UHAS ANC: Telegram, GroupMe, WhatsApp, Signal...

     

    And here is code that can be used in your scene to compose Pushover message including sound, attachment, url link and even duration for highest priority messages which are usually sounding and warning you until you read them in Pushover app. Very useful for sending alarms that just must be noticed!

     

    Please login or register to see this code.

     

    Above code works nicely in my UHAS ANC notification scene. I didn't test above stripped code, but it will work if there is no typos :-D

     

    Enjoy coding :-)

     

    • Thanks 1
    Link to comment
    Share on other sites

     

    On 2/5/2023 at 1:41 PM, Hallamnet said:

    Please login or register to see this code.

     

    Change above lines in

     

    local snd                = "siren"           -- see pushover.net API for built-in notification sound names

    and add

                         .. '&sound=' .. snd

    to the requestBody.

     

    and check your sound settings in the Pushover app

     

     

     

    Edited by Alex de Bruin
    typo
    • Thanks 1
    Link to comment
    Share on other sites

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Reply to this topic...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.

    ×
    ×
    • Create New...