But this are so simple only if entities is temperature sensor.
Other entities have no so simple structure.
As example, climate entity are store many attributes, include current and target temperature.
Unfortunately, now the sensor only works with temperature data. If you try to use it somehow differently, it will throw errors, because It will not fade to convert the obtained values to temperature.
In the near future I will try to find the time and fix the sensor so that it understands other input data. Or, you can do it yourself and send a pull request.
Thank you!
I just installed it and compared with SQL query, your average sensor is more accurate because it takes time in account.
My SQL sensor reading - 19.57
- platform: sql
queries:
- name: 'Pm 2.5 24 hour avg'
query: >
SELECT ROUND(AVG(state),2) 'value'
FROM states
WHERE entity_id = 'sensor.bedroom_dust_2_5um'
AND state != 'unknown'
AND state != ''
AND created > datetime('now', '-24 hours')
GROUP BY DATE(entity_id);
column: 'value'
New average sensor reading - 18.27
- platform: average
name: 'Pm 2.5 day avg'
duration:
days: 1
entities:
- sensor.bedroom_dust_2_5um
I will use it from now on.
Thank you again.
I wanted to support you via PayPal but it shows an error “This recipient is currently unable to receive money.”
Noticed one thing about performance.
I have really a lot of values, update time is approx. 1 second and i can’t extend it.
When I switched to the Average component - my raspberry processor use jumped from 4% to 27%.
Overall system started to work slowly.
So I had to move back to sql sensor.
I know about it.
This is due to the strange policies of my state. Now PayPal requires me a lot of pieces of paper, which I’m not sure I want to give them.
I think what to do with it …
thanks for that custom component!
I just added some sensors for testing and wonder if i have to add all the custom sensors to my recoder include when using the history graph card?