I would like one of my cells containing alarm info in my ultra status page be either red or green, depending upon the alarm state. Can this be done?
Announcement
Collapse
No announcement yet.
How do I color a cell red in Ultra status?
Collapse
X
-
beachTags: None
-
Do an If/Then to check the alarm state. Something like...
<pre class="ip-ubbcode-code-pre">AlarmState = hs.DeviceStatus("a1")
If AlarmState = "On" Then
AlarmColor = "green"
Else
AlarmColor = "red"
End If</pre>
Then, in the table definition set the cell color to equal the value you got above.
<pre class="ip-ubbcode-code-pre"><td bgcolor=""" & AlarmColor & """></pre>
You can get more efficient and setup the colors in a style in STYLE.CSS and just apply that style to the <td>. This will allow easy changes if you decide on a different solor scheme in the future.
Comment