more G-Labs products

Author Topic: PushBullet (PushingBox alternative)  (Read 7815 times)

September 22, 2015, 08:16:04 PM
Reply #15

mvdarend

  • *****
  • Information
  • Hero Member
  • Posts: 431
To be honest I have no idea what you are trying to do... Have you tried it with a normal switch or button?

- What is TestPB, it doesn't look like a normal button to me, does it actually have a change event?
- Why have you given 'Network 1' the name 'PushBullet'? The name is probably conflicting with the actual PushBullet APP.

And how exactly are the three screenshots related to each other?


September 22, 2015, 08:56:03 PM
Reply #16

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
Hi Bitcraze,

"gray led" means that the program is not enabled. starting from r494, hg won't let disabled program to run. so enable that program first (yellow led).


September 23, 2015, 09:54:15 AM
Reply #17

Bitcraze

  • ***
  • Information
  • Full Member
  • Posts: 73
Hi, Gene

Thanks for the reply. :)

It is enabled (see attached), bit icons show blue?

The code is eneterd.

September 23, 2015, 10:35:01 AM
Reply #18

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
Well the name of the button is different from the name shown in this screenshot. So where is that grayed button coming from? :)


September 23, 2015, 06:05:08 PM
Reply #19

Bitcraze

  • ***
  • Information
  • Full Member
  • Posts: 73
Hi, Gene

I don't quite understand?

Let me tell you the steps I took:

I added the .hgx file to "Messaging and Social" and enabled. Then added the Authorization token. Should it show BLUE on the left?

In Configure, Groups, I added a Test Group.

In that Group, I added Module by selecting from the List: Pushbullet 1000

The Button Pushbullet then shows under Test Group. The light is Grey, but goes yellow for a split second when I click it, then back to Grey.

Every 6th click or so, it would go green, and stay green, until clicked.

No PushBullet Notifications received on my Android phone.



September 23, 2015, 07:04:56 PM
Reply #20

mvdarend

  • *****
  • Information
  • Hero Member
  • Posts: 431
I think you're misunderstanding how the PushBullet APP works. Basically it's the same as the Pushing Box APP.

Quote
In that Group, I added Module by selecting from the List: Pushbullet 1000

You don't need to do that, just activating the APP is enough. (Blue is in the latest test version, I think it means running in background.)

Add a simple switch, light or sensor to a group, and then activate Pushbullet notifications. When a value changes for the given switch, light or sensor you should receive a pushbullet notification.

Or you can try the C# example from the first post.
« Last Edit: September 23, 2015, 07:09:06 PM by mvdarend »

September 29, 2015, 08:40:40 AM
Reply #21

Bitcraze

  • ***
  • Information
  • Full Member
  • Posts: 73
Hi,

Thanks so much: Working perfectly!  ;)

October 28, 2015, 11:58:44 AM
Reply #22

mvdarend

  • *****
  • Information
  • Hero Member
  • Posts: 431
Hi!

It's nice program. Works fine. But, can I change character encoding?

The program send me that:

Code: [Select]
Riaszt� rendszer �les�tve!
Riaszt� rendszer �les�tve!

but really like this:
Code: [Select]
Riasztó rendszer élesítve!
Riasztó rendszer élesítve!

Hi KaZe, I noticed while testing something else today that the character encoding works properly, could you confirm?. (I'm running v498)

October 28, 2015, 12:31:08 PM
Reply #23

KaZe

  • ****
  • Information
  • Sr. Member
  • Posts: 219
Hi mvdarend!

I test it on v499. You're right. I confirm that, the character encoding works properly for me too. Nice :)

November 30, 2015, 08:07:52 PM
Reply #24

KaZe

  • ****
  • Information
  • Sr. Member
  • Posts: 219
Hi!

I add 1 more feature to the program. "Pushbullet notifications only under away security mode".
So, if this checkbox checked, you only get the notifications, if the security system is "away" mode. (so, nobody at home)
I think this feature usefull for everyone, who use built in security system.

December 21, 2015, 11:27:55 AM
Reply #25

roger.wills

  • ***
  • Information
  • Full Member
  • Posts: 53
Hi,

Pushbullet is working as described above. How do I go about changing the message text so that it reads more like real english. So to be clear, at the moment I get a message along the lines of:

Module: Roger's Garage Door
 Parameter: Status.Level
 Value: 0

But I want to change it to something like:

Roger's Garage Door is closed.

Similarly, when it is open, i.e. status level is 1, I want it to say something along the lines of "Roger's Garage Door is open".

 It will help with the WAF!

December 21, 2015, 11:40:53 AM
Reply #26

mvdarend

  • *****
  • Information
  • Hero Member
  • Posts: 431
One way is to change the program itself to check for the type of sensor and then to give custom strings depending on the sensor type, you can then change this line for a more friendly message:

Code: [Select]
string theMessage = String.Format("Module: {0}{3} Parameter: {1}{3} Value: {2}{3}", module.Instance.Name, property.Name, property.Value, Environment.NewLine);   

Another way is to not use the 'Pushbullet notifications' checkbox. I only ever use it for testing, for 'real' messages I usually create a new program with something like the following:

Code: [Select]
When.ModuleParameterChanged( (module, parameter) =>
{                             
  if (module.Is("Roger's Garage Door"))
  {   
    if(parameter.Name == "Status.Level")
    {     
      var pushBullet = Modules.InDomain("HomeAutomation.Network.Pushbullet").WithAddress("1").Get();
      string messageToSend = String.Empty;
      if(parameter.Value == "1")
      {
        messageToSend = "Roger's Garage Door is open!";
      }
      else
      {
        messageToSend = "Roger's Garage Door is closed.";
      }
      pushBullet.Command("Send").Set(messageToSend);
      return false;
    }
  }
  return true;
}); 

I haven't tested the above code.

December 28, 2015, 06:04:09 PM
Reply #27

roger.wills

  • ***
  • Information
  • Full Member
  • Posts: 53
Hey Marcel,

Your code was absolutely spot on! Thanks very much.

Next question!

I need to be able to send pushbullet messages to more than one recipient. In my particular scenario, we have a double garage, one port is used by me, the other by my wife. I need to be able to notify her when door opens and closes and I need to notify me whenever my door opens or closes (I may also choose to add a notification to me whenever my wife's garage door opens or closes as well). How do I go about that? Is it a case of having a second instance of the Pushbullet program say Pushbullet2 so that I can input my wife's access token and then modify the code you have written accordingly? Or is there a simpler way? I assume that Pushbullet2 would also require some modification?

Thanks,

Roger

December 28, 2015, 08:09:38 PM
Reply #28

mvdarend

  • *****
  • Information
  • Hero Member
  • Posts: 431
To be honest, I've never tried anything like that.

Your idea sounds like it should work, but I've no idea if it will. I fear you'll have some conflicts with two almost identical programs running.