Notifying client when state changes (aka BPUP)

Hey guys. In my Shelly HomeSeer integration I implementd notifications from Shelly devices using URL - Shelly devices support setting “URL to access when SW input is activated/deactivated”. That’s much sexier than constantly polling the device.

Just wondering if I could do that with Bond? Iknow there’s Bond Push UDP Protocol (BPUP) but it says:

CAVEAT: BPUP is currently in Beta status.
For feature requests and concerns, please contact the Bond Engineering Team via the Bond Forums

Also, I’m not sure that this is suitable for HS as I don’t think I can “open a UDP socket to the Bond on port 30007”. But HS does support JSON and ASCII control mechnisms, so I can send commands to the HS server to trigger events or control devices. http://help.homeseer.com/help/ASCII-JSON/static/#.advanced_functions

We chose a UDP-based protocol for:

  1. best portability to low-resource devices (Smart by Bond)
  2. scalability to multiple listeners
  3. lowest latency
  4. will give a performance boost to the Bond Home apps when they start using it

Still should be considered BETA status, but given that several community integrations are already using it, we will try not to break them in the future changes to the protocol. You could look what the OpenHAB developer did. OpenHAB Integration — Key thing is, he has slow polling of the HTTP endpoint with BPUP augmenting it. I think that’s pretty smart.

The same I did with Shelly devices - polling at 20 seconds (to update power/temperature readings) - and when the notification is received (via url) about the binary state chages - I just poll immidiately.

This is also for redundancy in case the notification doesn’t work.

I agree that using a url notification isn’t scalable, but works nicely and easylly.
And I’m not asking to break existing integrations by replacing BPUP with URL. But if you could add the new feature - would be great.

The beauty of using the notification url in HS - is that it can allso be used externally via the HS server https://myhs.homeseer.com/ - not only on internal network.

@merck I suspect the deleloper is not he - it’s she.

Thanks for the correction! I had clearly not read any farther than that post on this forum. I try to make point of not making this assumption, but I suppose I’ve got a ways to go in that regard. Sorry, Sara! :blush: @SDamiano

One stupid question (because I’m sure the answer is yes) - will it work with multiple bridges? Especially SSBs?

Yes. You can either establish a UDP socket out to each bond, or you can just listen in 30007 and receive everything assuming all the bonds are on the same subnet. That latter behavior may require enabling broadcast (see docs).

Implemented, now see how it goes.

1 Like

Customer with 2 SBB and a Bridge confirmed that BPUP works for all of them. But I’m still confused myself how?

I create a UDP socket which listens on 30007 for every device. So I have three of them on same pc. But my understanding is that you can have only one IP/Port pair?

I’m not a UDP expert

It’s possible to listen on a UDP port for incoming packets regardless of the origin. This can sometimes be tricky as many utilities implicitly bind to the first client heard from. (Netcat does that.) But it’s really just Berkeley Sockets.