Choose style:

Author Topic: Websocket sensors?  (Read 10301 times)

0 Members and 1 Guest are viewing this topic.

Offline bear9rpp

  • Newbie
  • **
  • Posts: 22
  • Thanks: 0
  • Registered : 18/05/2016
    YearsYearsYearsYearsYearsYearsYearsYears
Websocket sensors?
« on: May 18, 2016, 03:11:00 pm »
As far as I know, z-wave and zigbee are the only two forms of communication medium that Almond understands.

Would it be possible to create support for a third type of sensors that communicates using Websocket? From quick inspection, the current Websocket API data direction is only one way, being reporting. Creating an incoming API allows for all the tinkerers out there to interface with Almond with their own devices (i.e. PCs / embedded systems / microcontrollers)  will definitely help the produce gain popularity, of course i understand that will take away interest/sales from Securifi-branded sensors.  Then again, the concept of licensing out more elaborate features can be considered while leaving simple status/trigger information to be free. 

I am planning to experiment with the Websocket to interface with my local linux based webcam surveillance system, to have the linux box listen for activities on the motion sensor via WebSocket and trigger recording.  This use case fits well with current API, but I can see usefulness for complete two-way communication that Almond can react to.

Just a thought.

Offline bear9rpp

  • Newbie
  • **
  • Posts: 22
  • Thanks: 0
  • Registered : 18/05/2016
    YearsYearsYearsYearsYearsYearsYearsYears
Re: Websocket sensors?
« Reply #1 on: May 18, 2016, 05:14:48 pm »
Sorry, just realized two-way communication is actually possible via the WebSocket API now that I've spent some time reading posts in the software development section.

But the concept of adding a WebSocket-based virtual sensor/device still holds.  It will allow for incorporation of DIY sensors to be included in the rules

Offline rpr69

  • Backer
  • *
  • Posts: 133
  • Thanks: 0
  • Registered : 08/09/2014
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYears
Re: Websocket sensors?
« Reply #2 on: May 20, 2016, 12:34:47 pm »
I too would have liked that, but since I highly doubt that is in any near future plans from Securifi I am going the opposite route. I setup Home Assistant and built a bridge app to get A+ data into HA, plus all of the other stuff that A+ doesn't do, like unsupported/homebrew sensors. So far so good.

Offline SecureComp

  • Backer
  • *
  • Posts: 541
  • Thanks: 1
  • Registered : 05/08/2014
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYears
Re: Websocket sensors?
« Reply #3 on: June 01, 2016, 01:24:58 am »
I too would have liked that, but since I highly doubt that is in any near future plans from Securifi I am going the opposite route. I setup Home Assistant and built a bridge app to get A+ data into HA, plus all of the other stuff that A+ doesn't do, like unsupported/homebrew sensors. So far so good.

Actually all the stuff is there to create a virtual device if you want. The issue is creating one that satisfies everybody asking for one.

Do you think folks would generally be happy with a simple virtual Binary Device?

You know what follows on this, messaging. Sending an email as folks have asked or an SMS message. Well, I wouldn't bother loading that onto the A+ but it could certainly generate a status message that could be checked from any other device whether it be a RaspPI or VM machine running on a PC which then in turn could generate the email or SMS easily.  All at the whopping cost of $20 at most.
Kickstarter Backer
Securifi Wiki Editor and Beta Tester, Not a Securifi employee
Almond+, many sensors, IOS App, Android Apps and Widgets

Offline bear9rpp

  • Newbie
  • **
  • Posts: 22
  • Thanks: 0
  • Registered : 18/05/2016
    YearsYearsYearsYearsYearsYearsYearsYears
Re: Websocket sensors?
« Reply #4 on: June 01, 2016, 10:18:56 am »
@SecureComp

Yes, a binary device is fine.  Are you saying current websocket APIs already allows for creation of such a device?  Do tell please...

Offline SecureComp

  • Backer
  • *
  • Posts: 541
  • Thanks: 1
  • Registered : 05/08/2014
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYears
Re: Websocket sensors?
« Reply #5 on: June 01, 2016, 12:38:21 pm »


@SecureComp

Yes, a binary device is fine.  Are you saying current websocket APIs already allows for creation of such a device?  Do tell please...

No, there is one very important piece missing in the release version of the software to accomplish what I believe folks want to do.

I need to understand exactly what it is the users would want.

It was mentioned that folks want to create a "DIY" device.  Well that device would have to follow the Class rules of an existing device, that or create and entirely new device with all kinds of "settings".  Mimicking an existing device class would be easier. Creating a new device such as a virtual notification device is possible but I question the actual utility of such a device.

The job of something like Homeseer is far different than that of the Almond+ imho.

Kickstarter Backer
Securifi Wiki Editor and Beta Tester, Not a Securifi employee
Almond+, many sensors, IOS App, Android Apps and Widgets

Offline rpr69

  • Backer
  • *
  • Posts: 133
  • Thanks: 0
  • Registered : 08/09/2014
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYears
Re: Websocket sensors?
« Reply #6 on: June 01, 2016, 01:26:37 pm »
The stuff I've been doing in Home Assistant isn't even necessarily 'sensors' in the sense that we are talking now, it's more about information and dashboards. I have a page that gives me room status (doors, windows, locks, etc, mostly from A+), server and network stats, one with IP camera views, one with weather/environment data (from Forecast.io, Raspberry Pi sensors, and radar maps), and one with presence status (from A+). I still need to add smoke alarm and water alarm sensors, and then work on the sending to A+ part, but I'm very encouraged so far. I can't do any of this with the A+ now, nor does it look like I could in the future, so I'm taking the good stuff from A+ and adding even more good stuff with H-A.

Offline bear9rpp

  • Newbie
  • **
  • Posts: 22
  • Thanks: 0
  • Registered : 18/05/2016
    YearsYearsYearsYearsYearsYearsYearsYears
Re: Websocket sensors?
« Reply #7 on: June 01, 2016, 01:55:42 pm »
My requirement is really basic, I just need a websocket version of the basic sensors, such as:

binary switch (i.e. on/off state)
sensing device (i.e. temp readings)

Offline SecureComp

  • Backer
  • *
  • Posts: 541
  • Thanks: 1
  • Registered : 05/08/2014
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYears
Re: Websocket sensors?
« Reply #8 on: June 01, 2016, 02:36:57 pm »
The stuff I've been doing in Home Assistant isn't even necessarily 'sensors' in the sense that we are talking now, it's more about information and dashboards. I have a page that gives me room status (doors, windows, locks, etc, mostly from A+), server and network stats, one with IP camera views, one with weather/environment data (from Forecast.io, Raspberry Pi sensors, and radar maps), and one with presence status (from A+). I still need to add smoke alarm and water alarm sensors, and then work on the sending to A+ part, but I'm very encouraged so far. I can't do any of this with the A+ now, nor does it look like I could in the future, so I'm taking the good stuff from A+ and adding even more good stuff with H-A.

That's exactly the job of Homeseer, present info of existing systems. It certainly does more than that but it sounds like you are getting what you need.  A comprehensive software platform that allows for a configurable interface is beyond the current scope of the Securifi products.  Not that a configurable app isn't possible down the road but it's far more important to provide robust support of sensors and functionality using the LCD interface and the apps along with providing a quality WiFi router, that's the job of the Almond class of products.

Really sounds like you are doing exactly what you should be. The only thing that would ease the burden in my mind, would be the full blown Almond+, Almond 2015, Almond 3 Plug In for Homeseer.  I'm not sure I'd include that in my business model if I were Securifi but if I were a VAR, I would seriously consider making that a project.

Kickstarter Backer
Securifi Wiki Editor and Beta Tester, Not a Securifi employee
Almond+, many sensors, IOS App, Android Apps and Widgets

Offline SecureComp

  • Backer
  • *
  • Posts: 541
  • Thanks: 1
  • Registered : 05/08/2014
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYears
Re: Websocket sensors?
« Reply #9 on: June 01, 2016, 02:42:37 pm »
My requirement is really basic, I just need a websocket version of the basic sensors, such as:

binary switch (i.e. on/off state)
sensing device (i.e. temp readings)

When you say " websocket version", what do you mean?

Any 'virtual' device that would be created would need to work as if it were a sensor, meaning it would process input from the websocket , have responses displayed via the websocket interface as well as support the SDK.

As for creating a virtual device that mimics every possible sensor, that's not going to happen. At best I'd be willing to spend some time on a single device, likely something like a binary device.

So I'm not following your train of though, forgive me, but in requesting something like a sensing device, specifically a thermostat for example, what would you be doing that isn't handled by an actual thermostat sensor currently?
Kickstarter Backer
Securifi Wiki Editor and Beta Tester, Not a Securifi employee
Almond+, many sensors, IOS App, Android Apps and Widgets

Offline bear9rpp

  • Newbie
  • **
  • Posts: 22
  • Thanks: 0
  • Registered : 18/05/2016
    YearsYearsYearsYearsYearsYearsYearsYears
Re: Websocket sensors?
« Reply #10 on: June 01, 2016, 03:00:38 pm »
websocket version as in websocket variant, or websocket equivalent.

I understand we cannot have all kinds of sensors because I too agree it is an overkill.  Only general support is needed, and I agree a binary device is a good start and likely covers 80% of the use cases

I was using temperature as an example, I'm basically looking for a way to report a readout from a virtual device, that's all.  I understand there are existing temp sensors out there, but if I have a RaspPi temp sensor node, I can communicate back to Almond as a virtual device and have it considered as part of the rule set.  (I know that with a bit of translation logic on the Pi side, the same can be done by interpreting the temp locally and communicate back to Almond as a binary device)


Offline SecureComp

  • Backer
  • *
  • Posts: 541
  • Thanks: 1
  • Registered : 05/08/2014
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYears
Re: Websocket sensors?
« Reply #11 on: June 01, 2016, 04:26:09 pm »
ok, now I think I understand what you want, thanks
Kickstarter Backer
Securifi Wiki Editor and Beta Tester, Not a Securifi employee
Almond+, many sensors, IOS App, Android Apps and Widgets

Offline matt

  • Backer
  • *
  • Posts: 151
  • Thanks: 1
  • Registered : 26/08/2013
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYears
Re: Websocket sensors?
« Reply #12 on: June 01, 2016, 09:09:20 pm »
Isn't a device just a set of properties (like a struct basically)? It seems like it would be simple to be able to add a device in the same fashion as a devicelist. You could use existing devicetypes and devicevalue-types, or arguably create arbitrary ones (as a combination of any existing devicevalues).

{
"cmd":"adddevice",
"data":
{"devicename":"ContactSwitch #1","friendlydevicetype":"ContactSwitch","devicetype":"12","location":"Default","devicevalues":
 {"1":   {"index":"1","name":"STATE","value":"true"},"2":{"index":"2","name":"LOW BATTERY","value":"0"},"3":{"index":"3","name":"TAMPER","value":"true"}}}
}

or:

{
"cmd":"adddevice",
"data":
{"devicename":"BinarySwitch
 #2","friendlydevicetype":"BinarySwitch","devicetype":"1","location":"Default","devicevalues":{"1":{"index":"1","name":"SWITCH BINARY","value":"true"}}}
}

For me, I basically want it to be a data store that interacts with rules/scenes and sends action notifications. I think the only thing that would be different would be it would be internally tagged as a "virtual" device, which instead of interacting with the zigbee/zwave stack, would send out the request on the websockets/sdk, and update values according to responses it received.

At the simplest level, it could just update the information store when a setdeviceindex action is presented (from A+ apps or WSs), and notify about the change, hoping that is actually done by the 3rd party connections in response to the notification. More complete would be to have a request/response WS/SDK API, e.g. "deviceindexrequest" and "deviceindexresponse" (not great names, but off the top of my head) where it would ask for the change to be made, and then receive confirmation that the change was made (as I assume happens internally with the zigbee/zwave stack).

But of course, having a virtual binary switch would be a great improvement on what is there now, this is just me giving a more full request than my multiple other feature requests for the same change.

Offline SecureComp

  • Backer
  • *
  • Posts: 541
  • Thanks: 1
  • Registered : 05/08/2014
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYears
Re: Websocket sensors?
« Reply #13 on: June 01, 2016, 11:32:25 pm »
Basic answer is yes.

The creating of the device definition is straightforward enough.
There has to be an additional identifier to key the I/O a different route.

It's the I/O which is the big deal and requires not insignificant effort on the part of Securifi to route appropriately.

And no, you'd need that all ACK NACK thing working, can't blow it off imho.

But there's more than one way to skin a cat.

In fact, if I were doing the initial s/w dev, I'd have had a debug option to check messaging before handing off to the zigbee/zwave stuff. And if i had that I'd dump it to a file and processing file is no big deal...just saying.  8)
Kickstarter Backer
Securifi Wiki Editor and Beta Tester, Not a Securifi employee
Almond+, many sensors, IOS App, Android Apps and Widgets

Offline d.kiran

  • Backer
  • *
  • Posts: 500
  • Thanks: 0
  • Registered : 11/09/2013
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYears
Re: Websocket sensors?
« Reply #14 on: June 03, 2016, 11:10:24 am »
In fact, if I were doing the initial s/w dev, I'd have had a debug option to check messaging before handing off to the zigbee/zwave stuff. And if i had that I'd dump it to a file and processing file is no big deal...just saying.  8)

I would think Securifi already has this part. Debugging stuff like routing and messaging is difficult if you don't have the ability to stub out either endpoints.

 

Page created in 0.067 seconds with 17 queries.