Comfort  Automation/ Security System Forums Home
Home Search search Menu menu Not logged in - Login | Register

Updating Thing status for counter devices
 Moderated by: slychiu, mattbrain, benstinton
 New Topic   Reply   Printer Friendly 
 Rate Topic 
AuthorPost
 Posted: Tuesday Jan 2nd, 2018 03:51 pm
   PM  Quote  Reply 
1st Post
Pgordon
Member
 

Joined: Saturday Sep 23rd, 2006
Location: London, United Kingdom
Posts: 237
Status: 
Offline

  back to top

Hey guys, Happy new year & all that... :-)
I have an issue to bring to your attention that you may not be aware of... - it's primarily come about because I've started playing with ActionTiles.
In essence, any of my Comfort devices that are mapped to counters don't appear to have a status registered in smartthings... (see image)
I hadn't previously noticed this, but in ActionTiles it results in the tiles initially all having a big question mark in them instead of a status.  Note that Pressing the tile causes actiontiles to send an off command to the device, and thereafter it does seem to correctly track the status, and updates the tile even when the device is controlled from elsewhere...
Interestingly, when the device is operated, regardless of the source of the command, the switch status in smartthings never shows anything other than "unknown" for the switch status, although I do see the level changing correctly...
Is it possible that you can update the switch status as well as the level in smartthings?
Cheers!
Paul G.


Attachment: Capture.PNG (Downloaded 40 times)



 Posted: Tuesday Jan 2nd, 2018 04:08 pm
   PM  Quote  Reply 
2nd Post
Pgordon
Member
 

Joined: Saturday Sep 23rd, 2006
Location: London, United Kingdom
Posts: 237
Status: 
Offline

  back to top

Here's the effect in ActionTiles...
It seems that on startup, Actiontiles has to get the device status from ST... - that much is pretty obvious.  Because the switch status for a counter device is seemingly never set, then AT displays the status as unknown - I guess it *could* also reference the level value & deduce on/off status from that (0=off, >0=on, pretty simple). but unfortunately it doesn't... (I'm going to reach out to the AT dev's separately to bring this to their attention).
It rather looks like that the device level is correctly retrieved from ST and displayed on the tile. Also, contrary to what I said above, if the device is operated from elsewhere, the level does correctly alter on the tile, but the status does not (it stays on "unknown"). However, if the device is operated from Actiontiles, it does update the tile, although it always sends an OFF to the device regardless of what state it's currently in.. at that point the tile is correctly displaying both state and level...
So it seems that AT is very dependent on the state variable in ST being specifically "on" or "off" in order to track the state...

Attachment: Capture.PNG (Downloaded 40 times)



 Posted: Tuesday Jan 2nd, 2018 04:32 pm
   PM  Quote  Reply 
3rd Post
Pgordon
Member
 

Joined: Saturday Sep 23rd, 2006
Location: London, United Kingdom
Posts: 237
Status: 
Offline

  back to top

The one other thing I've noticed, which may be better dealt with within Actiontiles, but I'll mention it here too, as it *could* be catered for via UHAI...
Actiontiles appears to append a percent symbol to every level displayed on a tile... - I've not found any indication that this is user configurable there... 
This means I get get tiles that show a level value of 255% - obviously not ideal... the 'best' way to deal with this would be IMO, to have the AT devs modify the UI code to allow the user to specify how to display the level... (i.e. as a percentage, or a raw level value, and to handle the conversion if I choose to have a raw value displayed as a %).  Again, I'm going to reach out to them to make that suggestion...
It could also be done from the UHAI end though I think? - when you write the level value up to ST, can you make it user-configurable whether you send a raw level in the 0-255 range, or a % level in the 0-100 range, - and handle the conversion within UHAI so that a value which is the correct % is always calculated & sent to ST?...
That way, I can have the correct level values shown in AT as a true % value (i.e. 255=100%) ->  (<current level> / 255) * 100 = the % value to send to ST...
Doable??
:-)
Paul G.



 Posted: Thursday Jan 4th, 2018 11:50 am
   PM  Quote  Reply 
4th Post
Pgordon
Member
 

Joined: Saturday Sep 23rd, 2006
Location: London, United Kingdom
Posts: 237
Status: 
Offline

  back to top

Quick FYI... the AT Dev's responded to my suggestion with the statement that the ST API stipulates that levels sent to ST are expected to be the 0-100 range and thus already representing a % value.
Here's the actual response:

"Hi Paul,
As a Works With SmartThings application, ActionTiles conforms to device capabilities per official API.

Per ST Documentation, Switch Level attribute is a value between 0 and 100, therefore the value is representing a percentage.

If you are using a custom DTH, please contact the developer to add conversion in the DTH. We don't support non-conforming DTHs.

Thanks

Alex"

Given that, would it be possible to amend the UHAI to make sure all level values sent to ST are compliant with that?
Cheers
Paul G.




 Posted: Friday Jan 5th, 2018 02:24 pm
   PM  Quote  Reply 
5th Post
mattbrain
UCM Pi Users


Joined: Tuesday Jun 12th, 2007
Location: United Kingdom
Posts: 185
Status: 
Offline

  back to top

Hi Paul


Have tidied up the repeated posts - the forum does occasionally throw a wobbl.


In terms of the counters object in ST, it's a tricky one. I have set up some configuration values which allow you to set upper and lower limits but the values are still mapped one to one.


In order to fix this without impacting those users who wish to use the real values (rather than converted to %), i'll add a configuration flag for the counters object to enable a conversion to % based on the upper and lower bounds (defaulting to 0 - 255).


I'll also update the switch state so that it is set to off when the counter value is at the lower bound and on for any value higher than the lower bound.


I'll try and work on it next Wednesday and post some code to try following.


Thanks,


Matt



 Posted: Friday Jan 5th, 2018 02:57 pm
   PM  Quote  Reply 
6th Post
Pgordon
Member
 

Joined: Saturday Sep 23rd, 2006
Location: London, United Kingdom
Posts: 237
Status: 
Offline

  back to top

Cool. Thanks Matt. Looking forward to it.
:D
Paul G.



 Posted: Friday Jan 5th, 2018 11:19 pm
   PM  Quote  Reply 
7th Post
wexfordman
UCM Pi Users
 

Joined: Monday Jan 1st, 2007
Location: Cork, Ireland
Posts: 546
Status: 
Offline

  back to top

Hi matt,[size=
]So, does this allow status update of lights in st ? If you remember there was a bit if a discussion on responses being tied in to light status, where currently ST does not update status when a light is activated locally in comfort ?



 Posted: Friday Jan 5th, 2018 11:19 pm
   PM  Quote  Reply 
8th Post
wexfordman
UCM Pi Users
 

Joined: Monday Jan 1st, 2007
Location: Cork, Ireland
Posts: 546
Status: 
Offline

  back to top

Hi matt,[size=
]So, does this allow status update of lights in st ? If you remember there was a bit if a discussion on responses being tied in to light status, where currently ST does not update status when a light is activated locally in comfort ?



 Posted: Monday Jan 8th, 2018 09:26 pm
   PM  Quote  Reply 
9th Post
mattbrain
UCM Pi Users


Joined: Tuesday Jun 12th, 2007
Location: United Kingdom
Posts: 185
Status: 
Offline

  back to top

Possibly, is the counter is the device being used to establish status in ST, this should solve that issue.


I'll work on the code on Wednesday and send out an update with instructions to test.


Thanks,


Matt



 Posted: Tuesday Jan 9th, 2018 09:22 pm
   PM  Quote  Reply 
10th Post
schford
UCM Pi Users
 

Joined: Wednesday Feb 25th, 2009
Location:  
Posts: 248
Status: 
Offline

  back to top

I have counters and lights working now - I too am keen to get in on any test for action tiles :-) that will fix above issues.


Cheers


Stuart



 Current time is 08:28 pm
Top




UltraBB 1.172 Copyright © 2007-2014 Data 1 Systems