Tomi<p><strong>Home Assistant gauge card – manually defined colours</strong></p><p>This post fits to <a rel="nofollow noopener" class="hashtag u-tag u-category" href="https://blog.rozman.info/tag/til/" target="_blank">#TIL</a> (Today I learned) category.</p><p>The ‘normal’ way to define colours in a ‘gauge’ card is by <em>defining severity</em> from UI gauge settings. There are only 4 colours available <em>in a sequence</em>: blue, green, yellow, red:</p><p>Standard colours are defined using UI by turning on ‘<em>define severity</em>‘ and then entering thresholds for green, yellow, red:</p><p>But what if I want to define my own colours (e. g. green-yellow-orange-red)? Sometimes these colours doesn’t visually well represent the sensor value.</p><p>Firstly I wanted to define <em>themes</em> but because it didn’t work in a first try, I gave up.</p><p>Then I found out that <a href="https://www.home-assistant.io/dashboards/gauge/" rel="nofollow noopener" target="_blank">Home Assistant gauge card help </a>offers definining manual ‘segments’ for gauge card. So I switched to manual editing of a gauge and defined <strong>segments</strong>:</p><pre><code>cards: - type: gauge entity: sensor.ikea_vindstyrka_airquality_01_voc_index needle: true max: 500 name: VOC index - organske spojine <strong>segments: - from: 0 color: green - from: 150 color: yellow - from: 250 color: orange - from: 400 color: red</strong></code></pre><p>For me it was easier than defining and editing ‘themes.yaml’. Maybe I’ll use frontend themes next time.</p><p>Tags: <a rel="nofollow noopener" class="hashtag u-tag u-category" href="https://blog.rozman.info/tag/homeassistant/" target="_blank">#homeassistant</a> <a rel="nofollow noopener" class="hashtag u-tag u-category" href="https://blog.rozman.info/tag/lovelace/" target="_blank">#lovelace</a> <a rel="nofollow noopener" class="hashtag u-tag u-category" href="https://blog.rozman.info/tag/gauge/" target="_blank">#gauge</a> <a rel="nofollow noopener" class="hashtag u-tag u-category" href="https://blog.rozman.info/tag/colours/" target="_blank">#colours</a></p><p>If you’re reading this on fediverse and the layout (embedded pics) is off, <a href="https://blog.rozman.info/home-assistant-gauge-card-manually-defined-colours/" rel="nofollow noopener" target="_blank">here’s the link to the original blog post</a>.</p><p><a href="https://blog.rozman.info/home-assistant-gauge-card-manually-defined-colours/" class="" rel="nofollow noopener" target="_blank">https://blog.rozman.info/home-assistant-gauge-card-manually-defined-colours/</a></p><p><a rel="nofollow noopener" class="hashtag u-tag u-category" href="https://blog.rozman.info/tag/colours/" target="_blank">#colours</a> <a rel="nofollow noopener" class="hashtag u-tag u-category" href="https://blog.rozman.info/tag/gauge/" target="_blank">#gauge</a> <a rel="nofollow noopener" class="hashtag u-tag u-category" href="https://blog.rozman.info/tag/homeassistant/" target="_blank">#homeassistant</a> <a rel="nofollow noopener" class="hashtag u-tag u-category" href="https://blog.rozman.info/tag/lovelace/" target="_blank">#lovelace</a> <a rel="nofollow noopener" class="hashtag u-tag u-category" href="https://blog.rozman.info/tag/til/" target="_blank">#til</a></p>