Sensor step (from iPhone device)

Hi,

Is there a way to use sensor.iPhone_step as a “measurable value” to add to “statistics” or a graph?
In my experimentation, “step” appears as a string instead of an integer so I can not graph or build automation based on value.

Thanks,
D.

Hello Whoo,

It has to be a number as it states here.

exceeds 10 days, the data is taken from the long term statistics table. Long term statistics are saved for sensors with a state_class of measurement, total or total_increasing. The long term statistics data is sampled and averaged once per hour,

So of you create a template sensor where each state is represented by a number then you can LTS that…

Hi,

thanks for your answer, data are present in home assistant like state and not as a value. How could I convert string as value easily.

Thanks

Thks,

I used this in configuration.yaml
it works

template:
   - sensor:
       - name: ip14step
         unique_id: ip14stepcalc
         state: >
            {{ '%d'|int(states('sensor.ip14p_steps')) }}
         state_class: measurement      

1 Like

That’s a bug. It should be numeric (have a unit). You can report it here: GitHub · Where software is built

1 Like