cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

Style Definitions as a property or variables

gsee
1-Newbie

Style Definitions as a property or variables

Is it possible to set a style definition as a property of a Thing?

Alternatively, would a style be able to take number values from Thing properties to customize the colors automatically, rather than defining each thing individually?

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Aanjan
9-Granite
(To:gsee)

Hmmm I understand what you're trying to do, but I don't think this would work like you expect because state definitions are not bound by Things. For example, based on your location, you can have it display a certain image/ color. This is limited to the actual location's value regardless of the Thing. If the state definition has been set to all blue at -50 F for a location like South Pole, it would always abide by -50 F and not care if it the value comes from Thing1 or Thing2. Does this make sense?

View solution in original post

6 REPLIES 6
Aanjan
9-Granite
(To:gsee)

Gloria, Style Definitions are more like attributes for a Widget, rather than a Thing. If you want the colors to change automatically, they can be done on certain widgets like Radio Buttons, Shape widgets or even Grids, through the usage of State Definitions/ State-based formatting. With State Definitions you can choose what colors/ styles are displayed based on the range you set.

gsee
1-Newbie
(To:Aanjan)

Then is there a way to customize the state definitions for different things? I'd like to have high, middle, low values formatted the same way for multiple Things, but the values depend on each Thing.

Aanjan
9-Granite
(To:gsee)

Well, it depends on how you're implementing the said Things and binding them. Usually, the states go by values - for example you can set anything below 20 to be all red and anything above 80 to be all green.

gsee
1-Newbie
(To:Aanjan)

Thanks, I think I just have a weird situation.

Is there a way to set the state definitions in a script?

I'd like to use different range values for the state definitions based on location, and have all the locations change seasonally. I'm hoping to automate it, rather than having to change the state definitions for each Thing multiple times a year.

Appreciate all the feedback!

Aanjan
9-Granite
(To:gsee)

Hmmm I understand what you're trying to do, but I don't think this would work like you expect because state definitions are not bound by Things. For example, based on your location, you can have it display a certain image/ color. This is limited to the actual location's value regardless of the Thing. If the state definition has been set to all blue at -50 F for a location like South Pole, it would always abide by -50 F and not care if it the value comes from Thing1 or Thing2. Does this make sense?

gsee
1-Newbie
(To:Aanjan)

It's not what I was hoping for, but it does make sense. Thanks!

Top Tags