Domoticz tutorial: push notifications

 

This tutorial will show you how to send PUSH notifications from your server to Pilot. Before starting, you need the following:

  • A working Domoticz server, with access to the internet;
  • The app « Pilot: Home Automation Control » has to be installed on your iPhone, and already connected to your Domoticz installation;
  • The full version of the app is required to activate push notifications;

Setting up « Pilot: Home Automation Control »

  1. Launch your « Pilot: Home Automation Control » app;
  2. Go to « Settings > Notifications »;
  3. Activate push notifications;
  4. Let Pilot send you notifications:

    Give authorization to send notifications

    Give authorization to send notifications

  5. After activating, Pilot will generate a random private key. Keep it aside, you will need it soon.

    Notifications screen correctly set up

    Notifications screen correctly set up

That is all for the Pilot app. Now it is time to setup your Domoticz server.

Setting up your Domoticz server

  1. Go to your Domoticz control panel;

    Domoticz homepage

    Domoticz homepage

  2. Go to the page « Setup > Settings »;
  3. Go to the « Notifications section » ;

    Goto notifications screen

    Goto notifications screen

  4. Go to the « Custom HTTP/Action: » section;
  5. Complete as follows :
    1. Check « Enabled »;
    2. #FIELD1 field: add the private key generated by Pilot;
    3. URL/Action : copy/paste this text :

      http://api.pilot.patrickferreira.com/#FIELD1/#SUBJECT/#MESSAGE

      Correct settings

      Correct settings

  6. Click on « Apply settings » ;

    Apply settings

    Apply settings

  7. If everything is correctly setup, you can click on « Test ». This will send a test notification to your iOS device. It should be sent to your device immediatly ;

    Réception d'un test de réception d'une notification.

    Réception d’une notification.

And there you go! Your Domoticz server and Pilot are now setup for notifications! It is now time to use this in all your Domoticz events.

Using push notifications

It is quite simple to use push notifications in your Domoticz server. All you need to do is add this item to your Domoticz events :

Élément à utiliser pour déclencher les notifications vers Pilot.

Item to be used for notifications

Let’s sum up

In this tutorial, I did the following:

  • Activate the notifications in « Pilot: Home Automation Control »;
  • Set up the notifications in my Domoticz server;
  • Learned how to use these notifications in my Domoticz events.

Got any question? Please leave your comments below!

37 thoughts on “Domoticz tutorial: push notifications

  1. Raoul

    Hi Patrick, Great functionallity I must say, love it! But I was wondering, is it able to disable the Arriving/Leaving home notifications? Because I’m normaly pretty aware of that so I don’t really care about those notifications…

      1. Raoul

        Hi Patrick, Thanks but that’s not what I mean. I do want to enable notifications because I want to use it for certain events in my Domoticz. I just don’t want to be notificated when I arrive and leave home. That is something the app does.

        1. patrickferreira Post author

          Oh, I see! Then all you have to do is disable notifications in the « location services » screen, and enable it in the « notifications » settings screen.
          Does that answer your question?

  2. Paul

    Patrick – nice work – couple of questions/issues.

    1) I am running V2.3786 of Domoticz – when setting up I found that I had to specify the URL as http:// not https:// – if I use https then I get an error sending on the « test » action. http works ok.

    2) on the app side – I have enabled sounds and badge icons in the notification settings on my phone – but neither seem to work – no sound or badge icon – should these be available?

    I think the app is great – and I appreciate your efforts.

    1. patrickferreira Post author

      Hi Paul,
      Thanks for your feedback! Glad you like the app,

      1) It’s pretty weird. It worked just fine a few weeks ago with HTTPS. I tried again a few minutes ago and Domoticz is sometimes having a bit of trouble with HTTPS… As you mentionned, HTTP works just fine so I changed the tutorial for the time being. I will contact the Domoticz team, HTTPS is obviously more secure for this kind of stuff.

      2) You are right, those are not implemented yet in the app. I will see what I can do.

      Please let me know if you have any other issues/suggestions.
      P

      1. Paul

        Thanks for the quick reply.

        Yes – would much prefer https to http for the notification – but it’s not super critical for me at the moment.

        Biggest thing for me would be sound notification in the app – I am using it to tell me the house alarm has been triggered – so I need to be altered when it occurs.

        Icon badges are less important (unless you have a notifications view inside the app where messages are visible)

        thanks for your work on this, Domoticz needs this interface

  3. Machiel

    First, Greet app you’ve created. I would like to know if it is possible to add 2 phones to the notification section. Now I have only one phone for the push messages but I would like to add my wife’s phone as well.

    When do you think to release the iPad version?

    1. patrickferreira Post author

      Thanks, glad you like it 🙂
      Currently it is only possible to send a notification to one iPhone. You should be able to register 2 phones for notifications in the near future. No release date though.
      iPad version has been in the works for quite some time, but I don’t have any release date.
      I don’t want it to be a « big iphone » interface.

  4. Bart Mol

    Hello Patrick,

    I really like your app, which I purchased.
    One question, I just followed your tutorial and notifications arrive at my iPhone 5.
    But the header of the pop-up window reads:
    ${PRODUCT_NAAM}
    This means product_name in Dutch.

    Any thoughts? Is it Pilot API related? Or a setting in Domoticz?

    Best regards, Bart

  5. Bart Mol

    Aha, this is only the case when the Pilot app is open. If closed, then a  » normal » notification arrives.

    1. patrickferreira Post author

      Thanks for the reporting, I’m actually surprised as you’re the first one to report this issue 😛
      Will have it fixed in the next release 😉

      Cheers!
      P

      1. Roel

        I can confirm this issue happens.

        Would you consider replacing the ${PRODUCT_NAAM} with #SUBJECT?
        It would be nice to replace ‘Pilot’ with the subject.

        If you would change the title to ${PRODUCT_NAAM}: #SUBJECT that would work too!

        Merci,

        Roel

  6. Huub

    Hi,

    I Just tested the notifications option, but it doesn’t work. Filling in the URL in a browser it shows a « Internal Server Error » error..

  7. Bart Mol

    Hello Patrick,

    I am on Domoticz version V3.5337 and I noticed that push notifications no longer work.
    I noticed that Domoticz now has a POST DATA field, maybe this has something to do with it?

  8. Leon Stolk

    Great App,

    Wanted to make a choice between Pilot and ImperiHome.
    Just removed the full version of ImperiHome from my iPhone. 😉

    Changing the API key is a good solution for receiving the push messages on several iPhones.

    1. patrickferreira Post author

      Hi Leon,

      Glad you are enjoying Pilot 🙂
      Imperihome is also a very nice app, competition is good, it helps us improve our apps everyday.

      Let me know if you have feedback/questions,
      P

  9. Arthur

    Hello Patrick,

    I activated Push notifications. I enabled all options in Notification center, sounds etc. When the Notification is sent I do not get a sound or info on my locked iPhone. When I touch the power or home button, I do see that the notification has arrived!? What could be the problem?

    Thanks,
    Arthur

  10. Guido

    Hi Patrick,

    My push notification is not working anymore. I’m on version 3.5877 of Domoticz and I notice some extra fields are available in the settings screen like POST data and POST content type. Do these need to be filled?

    cheers, Guido

    1. patrickferreira Post author

      Hi Guido,

      Those fields don’t need to be filled.
      Can you try using http or https, see if that changes anything?

      For best results, I recommend using HTTPS.
      Then, be sure that the API key in the Domoticz settings is the same as in Pilot.

      Cheers,
      P

  11. Arthur

    Hi Patrick,

    Can I push a http://« cam_ip »/snap.jpg together with the notification to my iPhone? Now i do it with a email (which I have to separately check for on my phone), but it would be very nice if it was part of the pilot push notification so that I will instantly see who is in front of my front door.

  12. Marco

    Run Domoticz V3.6616. If I manually enter the URL in the browser it works, with key, subject and message filled, the notification works. If i copy the url from the tutorial i get « Problem Sending Notification »
    If i copy the URL I used in the browser,I receive the same error. (tried both http and https)

Laisser un commentaire

Votre adresse de messagerie ne sera pas publiée. Les champs obligatoires sont indiqués avec *