Could someone kindly explain what I a seeing/missing please? I have a standard history_stat sensor that records a zone’s irrigation time in hours. I then have a template sensor that (I’m trying) to convert the state value in hours to minutes with one decimal place of precision. I’m not getting the result I expect - even trying things in the template editor. Here’s the current value of the history_stat sensor and my template editor attempts to resolve this…
Line 1 displays the current state value of the object (I assume string?)
Line 2 is the template sensor function (via filtering). I expected 24.6 not 24.599999999999998!
Line 3 Using a constant I get the expected result.
Line 4 Expanding out further with all constants just for giggles. Unexpected result here too.
Obviously I am not understanding something about accessing the state value or type correctly and/or the template filtering logic. This is fundamental and I’d appreciate it greatly if someone could shed some light on this for me. Thank you and kudos to all those that are contributing to this wonderful HA ecosystem.