Custom images for devices

Posted on
Fri May 27, 2016 3:23 am
aderrington offline
Posts: 116
Joined: Feb 03, 2015

Custom images for devices

Hi

I'm hoping someone can help me. I'm trying to implement some dials in my control page, I've got them all made up and into Indigo. I've got them linked to the device sensor value (various temperature sensors - Fibaro mainly) These devices give a .1 degree of accuracy which is great but i'm finding that Indigo can't select the right images based on a .1 degree of accuracy.
I've tested it by linking to a variable and giving that a less accurate test temp value of 21 or 24 and that works perfectly.

Could Jay or Matt comment on the possibility of Indigo being able to cope with the higher accuracy sensors and images please?

Many thanks!
Andrew
Attachments
Dials.jpg
Dials.jpg (118.3 KiB) Viewed 2146 times

Posted on
Fri May 27, 2016 4:14 am
DaveL17 offline
User avatar
Posts: 6741
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Custom images for devices

I think that what you're seeing is the result of having a decimal value in the custom image name (which the Indigo image selection heuristics can't handle.) The workaround I use in the WUnderground plugin is to remove the decimal point and use the modified value as the display value. In other words, change 12.3 to 123 and then name the image file xxxxx+123.png instead of xxxxx+12.3.png.

Dave

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Fri May 27, 2016 4:43 am
aderrington offline
Posts: 116
Joined: Feb 03, 2015

Re: Custom images for devices

Thanks for that Dave, It makes sense.
How do you take the decimal point out? I'm guessing having a trigger that monitors any change to the device state performs a Python script to take the decimal point out and then store that in a variable for the image to use?

If thats the case, any idea on the script required to remove the decimal point?

Thanks!
Andrew

Posted on
Fri May 27, 2016 5:00 am
roussell offline
User avatar
Posts: 1108
Joined: Aug 18, 2008
Location: Alabama

Custom images for devices

Multiply your original value by 10 to remove the decimal point. 21.3x10=213

Terry


Sent from my iPhone using Tapatalk

Posted on
Fri May 27, 2016 5:18 am
DaveL17 offline
User avatar
Posts: 6741
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Custom images for devices

aderrington wrote:
Thanks for that Dave, It makes sense.
How do you take the decimal point out? I'm guessing having a trigger that monitors any change to the device state performs a Python script to take the decimal point out and then store that in a variable for the image to use?

If thats the case, any idea on the script required to remove the decimal point?

Thanks!
Andrew

I think that's probably the simplest approach. Use Terry's math (multiply by 10) and store the value in a variable. This should work for you:

Code: Select all
temperature = indigo.devices[DEVICE ID].states['sensorValue']
temperature *= 10
temperature = int(temperature)
indigo.variable.updateValue(VARIABLE ID, unicode(temperature))

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Fri May 27, 2016 7:49 am
aderrington offline
Posts: 116
Joined: Feb 03, 2015

Re: Custom images for devices

Thank you very much for your help.

I've managed to get it all working now.
I do love the indigo community!!

Thank you. I'm off to refine the filenames now.
Attachments
Dials working.jpg
Dials working.jpg (118.71 KiB) Viewed 2017 times

Posted on
Fri May 27, 2016 8:10 am
DaveL17 offline
User avatar
Posts: 6741
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Custom images for devices

aderrington wrote:
Thank you very much for your help.

I've managed to get it all working now.
I do love the indigo community!!

Thank you. I'm off to refine the filenames now.

Glad to hear it. Thanks for sharing your designs!

Dave

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 2 guests