Color changing temp tiles

i would of rather just had a virtual switch that both controlled the actual sprinkler zone and also reflected its status. but as I was writing the rules realized it would have gone in an endless loop. lol....
Is there a better way to do this?

I'm not sure you ever gave me a ticket on to your train of thought. What are we trying to do? What device are we working with?

If that is the goal, than make a virtual switch and tie it to you zone controller in Simple Automation Rules. When it's on it will be one color and off it will be another. Another example of why I think they should have a virtual 'valve' but what do I know :wink:

There are also community apps that make virtual devices for sprinkler zones.

If there is something I'm missing please detail what the objective is and I'd be happy to assist. But to be honest you'd be better served detailing your project in another thread where everyone could assist.

ya the controller ap for the sprinkler has switches 1 -16 that show zone#on or zone#off but the switch capability only shows one actual switch.. and that goes on or off based on a program running.
the others are only accessible through attributes switch1 - switch16

so if you want your virtual swiotch to actuall turn on the zone you use a rule.. no problem.
but if you want the reverse say when a zone turns on either manually at the controller or when a program is running you would do another rule to set the switch.. and then you would be in an endless loop. That is why I did a push button and just show the attribute value.

Do you have the RGB or HSL values for the ~50 colors in the temp range you posted? I'm asking because I'd love to use this logic with zigbee bulbs. I'd love to do the same with humidity, but your link in the first post to humidity is a bad link. Can you point the way? TIA....

sorry i dont have it but there are conversion programs out there but you dont want to use rbg at least for this as there is a limit on the number of characters and this format is shorter.
i dont think i have colors for humidity

{
"template": "temperature",
"bgColor": "#c8e3f9a6",
"state": "-20"
},
{
"template": "temperature",
"bgColor": "#c8e3f9a6",
"state": "-19"
},
{
"template": "temperature",
"bgColor": "#c8e3f9a6",
"state": "-18"
},
{
"template": "temperature",
"bgColor": "#c8e3f9a6",
"state": "-17"
},
{
"template": "temperature",
"bgColor": "#c8e3f9a6",
"state": "-16"
},
{
"template": "temperature",
"bgColor": "#c8e3f9a6",
"state": "-15"
},
{
"template": "temperature",
"bgColor": "#c8e3f9a6",
"state": "-14"
},
{
"template": "temperature",
"bgColor": "#c8e3f9a6",
"state": "-13"
},
{
"template": "temperature",
"bgColor": "#c8e3f9a6",
"state": "-12"
},
{
"template": "temperature",
"bgColor": "#c8e3f9a6",
"state": "-11"
},
{
"template": "temperature",
"bgColor": "#c8e3f9a6",
"state": "-10"
},
{
"template": "temperature",
"bgColor": "#c8e3f9a6",
"state": "-9"
},
{
"template": "temperature",
"bgColor": "#c8e3f9a6",
"state": "-8"
},
{
"template": "temperature",
"bgColor": "#c8e3f9a6",
"state": "-7"
},
{
"template": "temperature",
"bgColor": "#c8e3f9a6",
"state": "-6"
},
{
"template": "temperature",
"bgColor": "#c8e3f9a6",
"state": "-5"
},
{
"template": "temperature",
"bgColor": "c8e3f9a6",
"state": "-4"
},
{
"template": "temperature",
"bgColor": "#c8e3f9a6",
"state": "-3"
},
{
"template": "temperature",
"bgColor": "#c8e3f9a6",
"state": "-2"
},
{
"template": "temperature",
"bgColor": "#c8e3f9a6",
"state": "-1"
},
{
"template": "temperature",
"bgColor": "#c8e3f9a6",
"state": "0"
},
{
"template": "temperature",
"bgColor": "#dbdee2a6",
"state": "1"
},
{
"template": "temperature",
"bgColor": "#dbdee2a6",
"state": "2"
},
{
"template": "temperature",
"bgColor": "#dbdee2a6",
"state": "3"
},
{
"template": "temperature",
"bgColor": "#dbdee2a6",
"state": "4"
},
{
"template": "temperature",
"bgColor": "#dbdee2a6",
"state": "5"
},
{
"template": "temperature",
"bgColor": "#dbdee2a6",
"state": "6"
},
{
"template": "temperature",
"bgColor": "#dbdee2a6",
"state": "7"
},
{
"template": "temperature",
"bgColor": "#dbdee2a6",
"state": "8"
},
{
"template": "temperature",
"bgColor": "#dbdee2a6",
"state": "9"
},
{
"template": "temperature",
"bgColor": "#dbdee2a6",
"state": "10"
},
{
"template": "temperature",
"bgColor": "#c0d2e4a6",
"state": "11"
},
{
"template": "temperature",
"bgColor": "#c0d2e4a6",
"state": "12"
},
{
"template": "temperature",
"bgColor": "#c0d2e4a6",
"state": "13"
},
{
"template": "temperature",
"bgColor": "#c0d2e4a6",
"state": "14"
},
{
"template": "temperature",
"bgColor": "#c0d2e4a6",
"state": "15"
},
{
"template": "temperature",
"bgColor": "#c0d2e4a6",
"state": "16"
},
{
"template": "temperature",
"bgColor": "#c0d2e4a6",
"state": "17"
},
{
"template": "temperature",
"bgColor": "#c0d2e4a6",
"state": "18"
},
{
"template": "temperature",
"bgColor": "#c0d2e4a6",
"state": "19"
},
{
"template": "temperature",
"bgColor": "#c0d2e4a6",
"state": "20"
},
{
"template": "temperature",
"bgColor": "#153591a6",
"state": "21"
},
{
"template": "temperature",
"bgColor": "#153591a6",
"state": "22"
},
{
"template": "temperature",
"bgColor": "#153591a6",
"state": "23"
},
{
"template": "temperature",
"bgColor": "#153591a6",
"state": "24"
},
{
"template": "temperature",
"bgColor": "#153591a6",
"state": "25"
},
{
"template": "temperature",
"bgColor": "#153591a6",
"state": "26"
},
{
"template": "temperature",
"bgColor": "#153591a6",
"state": "27"
},
{
"template": "temperature",
"bgColor": "#153591a6",
"state": "28"
},
{
"template": "temperature",
"bgColor": "#153591a6",
"state": "29"
},
{
"template": "temperature",
"bgColor": "#153591a6",
"state": "30"
},
{
"template": "temperature",
"bgColor": "#153591a6",
"state": "31"
},
{
"template": "temperature",
"bgColor": "#153591a6",
"state": "32"
},
{
"template": "temperature",
"bgColor": "#1e9cbba6",
"state": "33"
},
{
"template": "temperature",
"bgColor": "#1e9cbba6",
"state": "34"
},
{
"template": "temperature",
"bgColor": "#1e9cbba6",
"state": "35"
},
{
"template": "temperature",
"bgColor": "#1e9cbba6",
"state": "36"
},
{
"template": "temperature",
"bgColor": "#1e9cbba6",
"state": "37"
},
{
"template": "temperature",
"bgColor": "#1e9cbba6",
"state": "38"
},
{
"template": "temperature",
"bgColor": "#1e9cbba6",
"state": "39"
},
{
"template": "temperature",
"bgColor": "#1e9cbba6",
"state": "40"
},
{
"template": "temperature",
"bgColor": "#1e9cbba6",
"state": "41"
},
{
"template": "temperature",
"bgColor": "#1e9cbba6",
"state": "42"
},
{
"template": "temperature",
"bgColor": "#1e9cbba6",
"state": "43"
},
{
"template": "temperature",
"bgColor": "#1e9cbba6",
"state": "44"
},
{
"template": "temperature",
"bgColor": "#90d2a7a6",
"state": "45"
},
{
"template": "temperature",
"bgColor": "#90d2a7a6",
"state": "46"
},
{
"template": "temperature",
"bgColor": "#90d2a7a6",
"state": "47"
},
{
"template": "temperature",
"bgColor": "#90d2a7a6",
"state": "48"
},
{
"template": "temperature",
"bgColor": "#90d2a7a6",
"state": "49"
},
{
"template": "temperature",
"bgColor": "#90d2a7a6",
"state": "50"
},
{
"template": "temperature",
"bgColor": "#90d2a7a6",
"state": "51"
},
{
"template": "temperature",
"bgColor": "#90d2a7a6",
"state": "52"
},
{
"template": "temperature",
"bgColor": "#90d2a7a6",
"state": "53"
},
{
"template": "temperature",
"bgColor": "#90d2a7a6",
"state": "54"
},
{
"template": "temperature",
"bgColor": "#90d2a7a6",
"state": "55"
},
{
"template": "temperature",
"bgColor": "#90d2a7a6",
"state": "56"
},
{
"template": "temperature",
"bgColor": "#90d2a7a6",
"state": "57"
},
{
"template": "temperature",
"bgColor": "#90d2a7a6",
"state": "58"
},
{
"template": "temperature",
"bgColor": "#90d2a7a6",
"state": "59"
},
{
"template": "temperature",
"bgColor": "#44b621a6",
"state": "60"
},
{
"template": "temperature",
"bgColor": "#44b621a6",
"state": "61"
},
{
"template": "temperature",
"bgColor": "#44b621a6",
"state": "62"
},
{
"template": "temperature",
"bgColor": "#44b621a6",
"state": "63"
},
{
"template": "temperature",
"bgColor": "#44b621a6",
"state": "64"
},
{
"template": "temperature",
"bgColor": "#44b621a6",
"state": "65"
},
{
"template": "temperature",
"bgColor": "#44b621a6",
"state": "66"
},
{
"template": "temperature",
"bgColor": "#44b621a6",
"state": "67"
},
{
"template": "temperature",
"bgColor": "#44b621a6",
"state": "68"
},
{
"template": "temperature",
"bgColor": "#44b621a6",
"state": "69"
},
{
"template": "temperature",
"bgColor": "#44b621a6",
"state": "70"
},
{
"template": "temperature",
"bgColor": "#44b621a6",
"state": "71"
},
{
"template": "temperature",
"bgColor": "#44b621a6",
"state": "72"
},
{
"template": "temperature",
"bgColor": "#44b621a6",
"state": "73"
},
{
"template": "temperature",
"bgColor": "#44b621a6",
"state": "74"
},
{
"template": "temperature",
"bgColor": "#f1d801a6",
"state": "75"
},
{
"template": "temperature",
"bgColor": "#f1d801a6",
"state": "76"
},
{
"template": "temperature",
"bgColor": "#f1d801a6",
"state": "77"
},
{
"template": "temperature",
"bgColor": "#f1d801a6",
"state": "78"
},
{
"template": "temperature",
"bgColor": "#f1d801a6",
"state": "79"
},
{
"template": "temperature",
"bgColor": "#f1d801a6",
"state": "80"
},
{
"template": "temperature",
"bgColor": "#f1d801a6",
"state": "81"
},
{
"template": "temperature",
"bgColor": "#f1d801a6",
"state": "82"
},
{
"template": "temperature",
"bgColor": "#f1d801a6",
"state": "83"
},
{
"template": "temperature",
"bgColor": "#f1d801a6",
"state": "84"
},
{
"template": "temperature",
"bgColor": "#a6",
"state": "85"
},
{
"template": "temperature",
"bgColor": "#bc2323a6",
"state": "86"
},
{
"template": "temperature",
"bgColor": "#bc2323a6",
"state": "87"
},
{
"template": "temperature",
"bgColor": "#bc2323a6",
"state": "88"
},
{
"template": "temperature",
"bgColor": "#bc2323a6",
"state": "89"
},
{
"template": "temperature",
"bgColor": "#bc2323a6",
"state": "90"
},
{
"template": "temperature",
"bgColor": "#bc2323a6",
"state": "91"
},
{
"template": "temperature",
"bgColor": "#bc2323a6",
"state": "92"
},
{
"template": "temperature",
"bgColor": "#bc2323a6",
"state": "93"
},
{
"template": "temperature",
"bgColor": "#bc2323a6",
"state": "94"
},
{
"template": "temperature",
"bgColor": "#bc2323a6",
"state": "95"
},
{
"template": "temperature",
"bgColor": "#bc2323a6",
"state": "96"
},
{
"template": "temperature",
"bgColor": "#bc2323a6",
"state": "97"
},
{
"template": "temperature",
"bgColor": "#bs2323a6",
"state": "98"
},
{
"template": "temperature",
"bgColor": "#bc2323a6",
"state": "99"
},
{
"template": "temperature",
"bgColor": "#bc2323a6",
"state": "100"
},
{
"template": "temperature",
"bgColor": "rgba(86,58,171,0.65)",
"iconColor": "rgb(255,255,255)",
"state": "default"
},

I wrote an application for changing light colors based on temperature. For a groovy app a big lookup chart of temperatures isn't a good way to do it. I just set the color I want at a few temperatures then my code generates the in-between colors automatically.

1 Like

Cool. Open to sharing?

@TechMedX, do you have the RGB or HSL values for the colors-for-Fahrenheit in your OP?

Sure, you just need to delete the "parent" line (line 11) before you save it since you probably don't want the parent app I use.

There are some preset color schemes but you can modify them or add your own pretty easily.

https://raw.githubusercontent.com/pfmiller0/Hubitat/main/Weather%20Light.groovy

I'm interested to know how would you update the driver to include this tag?

Let's say this is what I have at the moment, where do you think I should add this data-value information?

def updateTileWithVals(vals) {
        sendEvent(name: "tile", value: """
        ${vals.currentTemp}""", isStateChange: true)
}

Thanks