Servus,
… i am lost, i spent hours on why the hell the template does not work.
I work on a Card Template with Statistics Card which supports offset ( like -1 ) .
The Problem is that the "offset: " Attribute is strict numeric. And i have found no way to input a numeric Value from a counter or number template (-0 to -12 ) .
All Templates i do for the Number Value seems to have only a state attribute which when retrieved seems to be strict string in any case .
the Number templates to turn a + into a - are numbers - i return strictly float() .
The retrieve of state seems to be the point.
I think somethink stupid why i am lost
This is the Code
type: custom:config-template-card
variables:
test: -2
test1: states['number.monthly_offset_value_card'].state
card:
type: statistic
entity: sensor.daily_imported_energy
name: ${test1}
period:
calendar:
period: month
offset: ${test}
stat_type: change
entities:
- counter.monthly_offset_value
offset: $test works
offset: $test1 does not work because it returns ‘-2.0’ instead of -2.0
This is the Error:
expected int for dictionary value @ data[‘calendar’][‘offset’]. Got ‘-2.0’
Would help a lot.
thx, Dietmar