Choose style:

Author Topic: Sensor polling  (Read 8680 times)

0 Members and 1 Guest are viewing this topic.

Offline mr23

  • Backer
  • *
  • Posts: 204
  • Thanks: 1
  • Registered : 02/08/2013
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYears
Sensor polling
« on: October 06, 2014, 11:30:30 pm »
Securifi:

I found that by polling the following address I can receive a JSON string of the sensor values


An example of the JSON is:

Code: [Select]
{"1":{"Name":"KeyFob A","FriendlyDeviceType":"KeyFob","DeviceType":"19","DeviceID":"1","Location":"Car 1","DeviceValues":{"1":{"index":"1","name":"ARMMODE","value":"0"}}},"2":{"Name":"KeyFob B","FriendlyDeviceType":"KeyFob","DeviceType":"19","DeviceID":"2","Location":"Car 2","DeviceValues":{"1":{"index":"1","name":"ARMMODE","value":"0"}}},"3":{"Name":"Garage Door","FriendlyDeviceType":"ContactSwitch","DeviceType":"12","DeviceID":"3","Location":"Garage Overhead  Door","DeviceValues":{"1":{"index":"1","name":"STATE","value":"false"},"2":{"index":"2","name":"LOW BATTERY","value":"false"},"3":{"index":"3","name":"TAMPER","value":"false"}}},"4":{"Name":"MudRoom Strip","FriendlyDeviceType":"SmartACSwitch","DeviceType":"22","DeviceID":"4","Location":"Battery Charger","DeviceValues":{"1":{"index":"1","name":"SWITCH BINARY","value":"true"},"2":{"index":"2","name":"AC_FREQUENCYMULTIPLIER","value":"0x0001"},"3":{"index":"3","name":"AC_FREQUENCYDIVISOR","value":"0x0001"},"4":{"index":"4","name":"AC_POWERMULTIPLIER","value":"0x0080"},"5":{"index":"5","name":"AC_POWERDIVISOR","value":"0x03e8"},"6":{"index":"6","name":"AC_VOLTAGEMULTIPLIER","value":"0x0008"},"7":{"index":"7","name":"AC_VOLTAGEDIVISOR","value":"0x03e8"},"8":{"index":"8","name":"AC_CURRENTMULTIPLIER","value":"0x0001"},"9":{"index":"9","name":"AC_CURRENTDIVISOR","value":"0x03e8"},"10":{"index":"10","name":"AC_FREQUENCY","value":"0x003c"},"11":{"index":"11","name":"ACTIVE_POWER","value":"0x0006"},"12":{"index":"12","name":"RMS_VOLTAGE","value":"0x3c4e"},"13":{"index":"13","name":"RMS_CURRENT","value":"0x000a"}}}}

Can you provide samples for all of the other supported sensors/devices?

Thanks,
-Chris

Offline rpr69

  • Backer
  • *
  • Posts: 133
  • Thanks: 0
  • Registered : 08/09/2014
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYears
Re: Sensor polling
« Reply #1 on: October 09, 2014, 02:18:33 pm »
::)Securifi:

I found that by polling the following address I can receive a JSON string of the sensor values


An example of the JSON is:

Code: [Select]
{"1":{"Name":"KeyFob A","FriendlyDeviceType":"KeyFob","DeviceType":"19","DeviceID":"1","Location":"Car 1","DeviceValues":{"1":{"index":"1","name":"ARMMODE","value":"0"}}},"2":{"Name":"KeyFob B","FriendlyDeviceType":"KeyFob","DeviceType":"19","DeviceID":"2","Location":"Car 2","DeviceValues":{"1":{"index":"1","name":"ARMMODE","value":"0"}}},"3":{"Name":"Garage Door","FriendlyDeviceType":"ContactSwitch","DeviceType":"12","DeviceID":"3","Location":"Garage Overhead  Door","DeviceValues":{"1":{"index":"1","name":"STATE","value":"false"},"2":{"index":"2","name":"LOW BATTERY","value":"false"},"3":{"index":"3","name":"TAMPER","value":"false"}}},"4":{"Name":"MudRoom Strip","FriendlyDeviceType":"SmartACSwitch","DeviceType":"22","DeviceID":"4","Location":"Battery Charger","DeviceValues":{"1":{"index":"1","name":"SWITCH BINARY","value":"true"},"2":{"index":"2","name":"AC_FREQUENCYMULTIPLIER","value":"0x0001"},"3":{"index":"3","name":"AC_FREQUENCYDIVISOR","value":"0x0001"},"4":{"index":"4","name":"AC_POWERMULTIPLIER","value":"0x0080"},"5":{"index":"5","name":"AC_POWERDIVISOR","value":"0x03e8"},"6":{"index":"6","name":"AC_VOLTAGEMULTIPLIER","value":"0x0008"},"7":{"index":"7","name":"AC_VOLTAGEDIVISOR","value":"0x03e8"},"8":{"index":"8","name":"AC_CURRENTMULTIPLIER","value":"0x0001"},"9":{"index":"9","name":"AC_CURRENTDIVISOR","value":"0x03e8"},"10":{"index":"10","name":"AC_FREQUENCY","value":"0x003c"},"11":{"index":"11","name":"ACTIVE_POWER","value":"0x0006"},"12":{"index":"12","name":"RMS_VOLTAGE","value":"0x3c4e"},"13":{"index":"13","name":"RMS_CURRENT","value":"0x000a"}}}}

Can you provide samples for all of the other supported sensors/devices?

Can the same information be accessed from the Securifi web portal? If so, can you provide an example link and result? If not, please add it to the backlog.

Below is an example of the stream integrated into a Visualization package.
http://the12lab.com/Misc_Data/50pct_AlmondPlusMonitor.png

Thanks,
-Chris

Cool! I have done something similar, documented on the Wiki here: http://wiki.securifi.com/index.php?title=Sensor_Values_to_Cloud_IoT_Service

I am using the /DeviceList.xml file as my input, I think if you combine my approach there with what you are doing you should be able to figure out the other stuff you are looking for.

Offline mr23

  • Backer
  • *
  • Posts: 204
  • Thanks: 1
  • Registered : 02/08/2013
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYears
Re: Sensor polling
« Reply #2 on: October 14, 2014, 12:27:05 am »
It seems you don't need a specific token to read this data from the Almond+.
Anyone (with an Almond+ at 10.10.10.254, Sensors 12,19,22) can try it by going to
[obsoleted by Almond+ firmware changes in 2015Q1]
Only a few devices (19,12,22) are coded into it so far.
The first slide (Security) uses the (12,19 = ContactSwitch and KeyFob).
The second slide (Energy Switch) uses the (22 = SmartACSwitch).
If you check Show Table, then Poll DataSource it will update periodically (5 sec).
If you check Aggregate DataSource, it will build a history of values.

Offline na2f

  • Newbie
  • *
  • Posts: 5
  • Thanks: 0
  • Registered : 13/07/2015
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYears
Re: Sensor polling
« Reply #3 on: July 13, 2015, 03:28:29 am »
@mr23 : Can you show me the development code for this process and explain it? peace! :)

Offline mr23

  • Backer
  • *
  • Posts: 204
  • Thanks: 1
  • Registered : 02/08/2013
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYears
Re: Sensor polling
« Reply #4 on: July 13, 2015, 09:52:57 pm »
@mr23 : Can you show me the development code for this process and explain it? peace! :)

Securifi changed the access protocol, so this particular example will no longer function.

Offline na2f

  • Newbie
  • *
  • Posts: 5
  • Thanks: 0
  • Registered : 13/07/2015
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYears
Re: Sensor polling
« Reply #5 on: July 13, 2015, 10:09:39 pm »
Owh..really..okey thanks. Do you have any idea how to take data from sensor to our local server?by pushing or polling.

Offline fillibar

  • Backer
  • *
  • Posts: 2060
  • Thanks: 4
  • Registered : 02/08/2013
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYears
Re: Sensor polling
« Reply #6 on: July 14, 2015, 10:17:49 am »
There actually was a reason for the access changing. That string of X was an ID but with or without it previously it was possible to control the devices directly without access control. If your Almond+ was accessible on the Internet (you exposed port 80 and could get to it by DNS) anyone anywhere could get a list of devices, status, and then control them. Once that little flaw was found Securifi quickly fixed it and locked it down. Now it is a more difficult process that does not lend itself as readily for status parsing (as the previous JSON).

Sorry I do not have a description of how to do it, but thought the why part might be useful.
Almond 3 mesh handling the home.

 

Page created in 0.044 seconds with 19 queries.

bottleneck