Change colour of text using variables or expressions

Posted on
Mon Dec 05, 2016 12:10 pm
trevorsmith offline
Posts: 73
Joined: Oct 08, 2016

Change colour of text using variables or expressions

I wish to display some temperture data in a text field on my CP. I wish it to be red if another variable is set to say, "true" or green if false. Is this possible?

Posted on
Mon Dec 05, 2016 1:10 pm
jay (support) offline
Site Admin
User avatar
Posts: 13269
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Change colour of text using variables or expressions

No, you can only change the image represented for an element based on the value of that element.

With a lot of work, you could create a set of green images and a set of blue images and then adjust the data that's being represented to be explicit about which to use. Lots of images I'd guess though. Another option would be to display the temp value on top of another page element that shows a red/green background based on your other variable. That would be much easier.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Mon Dec 05, 2016 1:40 pm
trevorsmith offline
Posts: 73
Joined: Oct 08, 2016

Re: Change colour of text using variables or expressions

thanks.

Posted on
Mon Dec 05, 2016 1:58 pm
Colorado4Wheeler offline
User avatar
Posts: 1130
Joined: Jul 20, 2009
Location: Colorado

Re: Change colour of text using variables or expressions

How about something like this but with your temperature in the lower middle (like a lot of digital/analog gauges) and you can change the face color from green to red? It would make for a really cool effect! This is just a screen shot from my own control page, yours might be less "retro" :)
Attachments
Screen Shot 2016-12-05 at 12.56.59 PM.png
Screen Shot 2016-12-05 at 12.56.59 PM.png (148.54 KiB) Viewed 631 times

My Modest Contributions to Indigo:

Homebridge Buddy | Room-O-Matic | Smart Dimmer | Scene Toggle | Mac Commander | Security Manager | Device Extensions | LCD Creator | Control Page Keypad | Powermiser

Check Them Out Here

Posted on
Mon Dec 05, 2016 2:25 pm
DaveL17 offline
User avatar
Posts: 3403
Joined: Aug 20, 2013

Re: Change colour of text using variables or expressions

There might also be elements (or at least ideas) that you can take from the WUnderground Gauge Pack.

Posted on
Tue Dec 06, 2016 6:54 am
mat offline
Posts: 530
Joined: Nov 25, 2010
Location: Cambridgeshire - UK

Re: Change colour of text using variables or expressions

Have a look at this thread. This shows a number of approaches from memory.

http://forums.indigodomo.com/viewtopic.php?f=84&t=11576

mini 10.11.6 and indigo 7.02

Posted on
Tue Dec 06, 2016 8:21 am
Different Computers offline
User avatar
Posts: 1329
Joined: Jan 02, 2016
Location: East Coast

Re: Change colour of text using variables or expressions

I can also imagine doing this in Automator for the Mac using two different workflows that include the Create Banner Image from Text action. Set up two different workflows with that action to output two different graphic text files with different characteristics. Trigger them with Indigo based on whatever variable you want to use. link the output in your control page. Done.

Refugee from SmartThings and so happy to be on Indigo now.
Sierra on an i5 running Harmony Hub, Hue, Security Camera, DomoPad, EPS Device Extensions EPS Smart Dimmer, MatplotLib, Plex, Scale Adapters, uniFiAP, Wunderground.

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 2 guests