Securifi Community Forum

General Category => Ideas/Feature requests => Topic started by: fillibar on December 05, 2014, 08:46:56 pm

Title: Sensor Status as XML
Post by: fillibar on December 05, 2014, 08:46:56 pm
I was looking over the sensor data provided by the Almond+ that comes off:
<your Almond+ IP here>/cgi-bin/luci/;stok=e7xXxXxXxXxXxXxXxXxXxXx41/almond?cmd=list

The data is useful (although oddly one of my sensors shows as tampered there but not in any other interface) but the formatting is... Pretty awful in my book. Is there any way this could be reformatted as XML and include some additional pieces of information? I can parse it as is... but it is far less convenient than if it was in XML to begin with and that would allow it to be readily used by other methods. Just for grins, here is a sample of my data AND a sample of what I wish that piece would look like in XML:
Code: [Select]
{"1":{"Name":"KeyFob","FriendlyDeviceType":"KeyFob","DeviceType":"19","DeviceID":"1","Location":"Mobile","DeviceValues":{"1":{"index":"1","name":"ARMMODE","value":"3"}}}
Code: [Select]
<Status>
<Hostname>Almond</Hostname>
<Serial></Serial>
<HardwareVersion></HardwareVersion>
<SoftwareVersion>AP2-R069...</SoftwareVersion>
<Timezone>-5.00</Timezone>
<Date>12/05/2014 20:37:22</Date>
<Power>
<Failed>08/25/2014 18:37:28</Failed>
<Restored>08/25/2014 18:38:00</Restored>
</Power>
<Sensors>
<Sensor>
<Name>KeyFob</Name>
<FriendlyDeviceType>KeyFob</FriendlyDeviceType>
<DeviceType>19</DeviceType>
<DeviceID>1</DeviceID>
<Location>Mobile</Location>
<DeviceValues>
<Index>1</Index>
<Feature>ARMMODE</Feature>
<Value>3</Value>
</DeviceValues>
</Sensor>
</Sensors>
</Status>

Most of the content is already there for the sensors. It would be nice (not necessary though) to get the type of data ABOVE that (I put it in XML as Hostname through Power) also. The main thing here is the formatting of it AND having it available as XML output. The only change I made to the Sensor fields that were there was I changed the "name" field within DeviceValues to be "Feature" because looking over my sensors that seems to be more of what they are and it makes it easier to distinguish from the sensor "Name" field.
Title: Re: Sensor Status as XML
Post by: rpr69 on January 06, 2015, 02:00:28 pm
It should be a fairly simple thing to add for the developers, since the raw data is already stored as XML in the file /DeviceList.xml so it would just need to be exposed via the web server. Worst case you could probably symlink it.

See my Wiki page http://wiki.securifi.com/index.php?title=Sensor_Values_to_Cloud_IoT_Service (http://wiki.securifi.com/index.php?title=Sensor_Values_to_Cloud_IoT_Service) for how I use it to upload data to a cloud database.