Author Topic: Customising the Default Device .JSONs  (Read 11388 times)

Offline akbooer

  • Beta Testers
  • Master Member
  • *****
  • Posts: 6343
  • Karma: +288/-70
  • "Less is more"
Re: Customising the Default Device .JSONs
« Reply #15 on: August 23, 2014, 04:52:22 pm »
Can it show the date too, as for some sensors it could be a day or two before they have tripped ? E.g
Yes, of course, see previous post.  It just needs the right format string. You are, however, limited to 11 characters (in a single variable field) so you'd have to make that: 25/08 18:34, unless we add separate date and time fields.

Quote
Would you be willing to share the .json for this ?
Attached.  I made the minimum possible changes to the original .json file.  You'll need some extra magic to make it work, though. (Maybe that should go to the highest bidder?)   ;)

3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline parkerc

  • Beta Testers
  • Sr. Hero Member
  • *****
  • Posts: 2474
  • Karma: +35/-48
  • Life Moves Pretty Fast....
Re: Customising the Default Device .JSONs
« Reply #16 on: August 23, 2014, 08:40:33 pm »
Many thanks @Akbooer

Magic was never my strongest subject at school, :)

So taking what spells I do have and looking at your .json - I can see 'Timestamp' as the variable mentioned ?

Is the suggestion that I will need to create a new variable on every motion device to hold a converted human readable last tripped value? (Which is no more than 11 characters?)

Offline AgileHumor

  • Hero Member
  • *****
  • Posts: 984
  • Karma: +51/-27
  • KISS
Re: Customising the Default Device .JSONs
« Reply #17 on: August 23, 2014, 08:42:20 pm »
If you don't need it on the WebGUI...Imperihome for Android shows the last tripped in the sensor.
WMC Leviton:18xVPE06,8xVRS15,3xVRP03-W,2xVRR15,4xVRCS4,2xVRCS2,VP00R,8xVRS15 Aeon:5xDSC06106,4xDSC24,4xDSC25,12xDSB29,2xDSC11,4xDSB54,DSB05,3xDSA22,DSA38,2xDSA03202B,DSB09104,HEM Other:3xYale,12xHSM100v3,7xSP103,45604,WDHA-12,SSA2USR,EVLCD1T,6xWWA02A,7xIPC-HFW2100,URTSI,Hue,Russound,OpenSprinker

Offline parkerc

  • Beta Testers
  • Sr. Hero Member
  • *****
  • Posts: 2474
  • Karma: +35/-48
  • Life Moves Pretty Fast....
Re: Customising the Default Device .JSONs
« Reply #18 on: August 24, 2014, 02:23:36 am »
Hi @Agilehumor

Totally agree - and that's the basis/reason for creating this thread

I already have it via HomeWave (iOS) , but it's surprising how often I access the WebUI,  so I wanted to have that capability their too,

Offline akbooer

  • Beta Testers
  • Master Member
  • *****
  • Posts: 6343
  • Karma: +288/-70
  • "Less is more"
Re: Customising the Default Device .JSONs
« Reply #19 on: August 24, 2014, 10:12:16 am »
Is the suggestion that I will need to create a new variable on every motion device to hold a converted human readable last tripped value? (Which is no more than 11 characters?)

Yes, exactly so.  The easiest way to do this is to upload this Lua file (I also include the modified .json file again to keep everything in the same place), and add the following to your Lua Startup:

Code: [Select]
require "TripTimestamp"

This only works for motion sensors, but would be easy to extend to any other sensor with a SecuritySensor service.
The format can be changed by altering the appropriate constant in the Lua file.
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline akbooer

  • Beta Testers
  • Master Member
  • *****
  • Posts: 6343
  • Karma: +288/-70
  • "Less is more"
Re: Customising the Default Device .JSONs
« Reply #20 on: August 25, 2014, 11:06:26 am »
@parkerc

I see from your OP that you have door sensors.  Here's an additional .json file and a modified Lua file which extends this functionality to door sensors as well.

What do you think about advertising this to a wider audience on the Lock, Motion, and Security board with a more relevant subject line...

"Last Trip time on motion and door sensor front panels in UI5", for example, for those who won't have been incentivised to read about "Customising the Default Device .JSONs" ?

3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline AgileHumor

  • Hero Member
  • *****
  • Posts: 984
  • Karma: +51/-27
  • KISS
Re: Customising the Default Device .JSONs
« Reply #21 on: August 25, 2014, 11:11:36 am »
How about an App Store submission ;)

"Icon Add-on Pack w/Last Tripped Time"

WMC Leviton:18xVPE06,8xVRS15,3xVRP03-W,2xVRR15,4xVRCS4,2xVRCS2,VP00R,8xVRS15 Aeon:5xDSC06106,4xDSC24,4xDSC25,12xDSB29,2xDSC11,4xDSB54,DSB05,3xDSA22,DSA38,2xDSA03202B,DSB09104,HEM Other:3xYale,12xHSM100v3,7xSP103,45604,WDHA-12,SSA2USR,EVLCD1T,6xWWA02A,7xIPC-HFW2100,URTSI,Hue,Russound,OpenSprinker

Offline akbooer

  • Beta Testers
  • Master Member
  • *****
  • Posts: 6343
  • Karma: +288/-70
  • "Less is more"
Re: Customising the Default Device .JSONs
« Reply #22 on: August 25, 2014, 11:18:22 am »
How about an App Store submission ;)

...with a $10 price tag?
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline AgileHumor

  • Hero Member
  • *****
  • Posts: 984
  • Karma: +51/-27
  • KISS
Re: Customising the Default Device .JSONs
« Reply #23 on: August 25, 2014, 11:19:54 am »
Yes, and you'll get it because the OCD folks like me pay for it :)
WMC Leviton:18xVPE06,8xVRS15,3xVRP03-W,2xVRR15,4xVRCS4,2xVRCS2,VP00R,8xVRS15 Aeon:5xDSC06106,4xDSC24,4xDSC25,12xDSB29,2xDSC11,4xDSB54,DSB05,3xDSA22,DSA38,2xDSA03202B,DSB09104,HEM Other:3xYale,12xHSM100v3,7xSP103,45604,WDHA-12,SSA2USR,EVLCD1T,6xWWA02A,7xIPC-HFW2100,URTSI,Hue,Russound,OpenSprinker

Offline RichardTSchaefer

  • Community Beta
  • Master Member
  • ******
  • Posts: 10091
  • Karma: +764/-143
Re: Customising the Default Device .JSONs
« Reply #24 on: August 25, 2014, 12:30:50 pm »
Sorry, you can't release it to the APP store ... you can't release files with names that already exist.
You would have to release these with new names and come up with a procedure to overwrite existing files with the new files.

Maybe a Customize Device Class plugin ?

Offline akbooer

  • Beta Testers
  • Master Member
  • *****
  • Posts: 6343
  • Karma: +288/-70
  • "Less is more"
Re: Customising the Default Device .JSONs
« Reply #25 on: August 25, 2014, 12:45:00 pm »
Yup, fully aware of that... see my first reply to the OP on this thread http://forum.micasaverde.com/index.php/topic,19263.msg143031.html#msg143031

I've no intention of charging, nor trying to put on the app store.  Folk will just have to be forum users to get this!

...it'll all have to change with UI7 anyway.
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline zedrally

  • Hero Member
  • *****
  • Posts: 1212
  • Karma: +15/-5
  • Black Cat Control Systems
Re: Customising the Default Device .JSONs
« Reply #26 on: August 31, 2014, 02:13:14 am »
Not sure what I've done wrong, but I uploaded the D_DoorSensor1.json & TripTimestamp.lua (after saving the original) and I have no change in the Door Sensor image. It's still displaying the original UI5 sanitised version..

What have I missed out?
Living in the Land of Oz, give me a vegemite sandwich. Home Seer, Vera Lite & Edge, Popp, Black Cat Smart Hub & Vera G, Black Cat Lite 1 & 2's a Black Cat Dimmer or 2, Fantem Tec and then some  Black Cat Cat's Eye PIR's & Door-Window Sensors, RFXComm, Broadlink RMPro & Mini plus a Z-UNO or 2.

Offline BrianLBeaton

  • Sr. Member
  • ****
  • Posts: 325
  • Karma: +12/-1
Re: Customising the Default Device .JSONs
« Reply #27 on: August 31, 2014, 10:28:45 am »
It worked for me.  Thanks akbooer.

Offline BrianLBeaton

  • Sr. Member
  • ****
  • Posts: 325
  • Karma: +12/-1
Re: Customising the Default Device .JSONs
« Reply #28 on: August 31, 2014, 11:01:36 am »
@akbooer

Please consider extending this functionality to device type urn:schemas-micasaverde-com:device:TempLeakSensor:1.

My Fortrezz Water Leak/Temperature Sensors use this device type.

Offline zedrally

  • Hero Member
  • *****
  • Posts: 1212
  • Karma: +15/-5
  • Black Cat Control Systems
Re: Customising the Default Device .JSONs
« Reply #29 on: August 31, 2014, 07:14:52 pm »
I may have found the problem, There are 2  D_DoorSensor1.json files.

I'm very unfamiliar with working from this end, how do I delete them and start again?
Living in the Land of Oz, give me a vegemite sandwich. Home Seer, Vera Lite & Edge, Popp, Black Cat Smart Hub & Vera G, Black Cat Lite 1 & 2's a Black Cat Dimmer or 2, Fantem Tec and then some  Black Cat Cat's Eye PIR's & Door-Window Sensors, RFXComm, Broadlink RMPro & Mini plus a Z-UNO or 2.