Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 103038

Addressing array index

$
0
0

I’m running across a scenario trying to access an array index, and something does not work as I need to.

I am wondering if someone can check my code and see what the problem is
TYA

{% set test_var = ['00','01','11','10'] %}
{{states('counter.aly_bed_swtich_count')}} / this outputs 1 correctly
{{test_var[2]}} //this outputs 11 correctly
{{test_var[states('counter.aly_bed_swtich_count')]}} // this outputs nothing, vs expected 01

2 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 103038

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>