[SOLVED] Device State icon problem

Posted on
Thu Jul 03, 2014 6:07 am
autolog offline
Posts: 3991
Joined: Sep 10, 2013
Location: West Sussex, UK [GMT aka UTC]

[SOLVED] Device State icon problem

For some reason when I display a device (my LIFX bulb) on a control page, it shows the bulb status correctly when viewed in 'Show in Web Browser' but incorrectly in Indigo Touch. :?

In Indigo touch it is shown as being permanently illuminated (yellow bulb) whereas in the web browser it is shown correctly as on (yellow bulb) or off (grey bulb). The Home pages devices also displays correctly on and off.

My device definition is:
Code: Select all
           <State id="lifxLampPower">
               <ValueType boolType="OnOff">Boolean</ValueType>
               <TriggerLabel>LIFX Lamp Power</TriggerLabel>
               <ControlPageLabel>LIFX Lamp Power</ControlPageLabel>
            </State>


My control page definition is:
controlPanelInconsistency.png
controlPanelInconsistency.png (27.77 KiB) Viewed 1541 times


Any ideas on why this and any work around I can apply :?:
Last edited by autolog on Thu Jul 03, 2014 9:39 am, edited 1 time in total.

Posted on
Thu Jul 03, 2014 8:28 am
jay (support) offline
Site Admin
User avatar
Posts: 18253
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Device State icon problem

I believe the problem is that Indigo Touch uses a case-sensitive match on device states and IWS doesn't. Make sure you're using all lower-case when you set the value of the state and I believe it will work correctly.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Thu Jul 03, 2014 9:44 am
autolog offline
Posts: 3991
Joined: Sep 10, 2013
Location: West Sussex, UK [GMT aka UTC]

Re: [SOLVED] Device State icon problem

I was actually setting the device state values to boolean 'True' and 'False' and using the uiValue to change that to 'on' and 'off'. I have now changed the code to update the device state to str('on') or str('off') and that works OK in both the web browser and Indigo Touch. So I guess I was a bit confused by the fact I am specifying the device state as boolean - I was thinking I should set it to True or False.

My mistake - it all makes sense now - Thanks :D

Posted on
Thu Jul 03, 2014 10:54 am
jay (support) offline
Site Admin
User avatar
Posts: 18253
Joined: Mar 19, 2008
Location: Austin, Texas

Re: [SOLVED] Device State icon problem

Right - booleans are set to the boolean type you select (though, truth be told, I suspect "true" and "false" would have worked). I'm pretty sure state data types are actually not strictly enforced for a variety of reasons but it's something that we're always thinking about. The whole strongly-typed vs weak typing argument... ;)

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 7 guests