That value_template doesn’t look right. I suggest dropping it for now. If the state of the sensor is formatted incorrectly, post it and we can take a look at fixing it.
Okay so first we cant put the code directly to the card but on the configuration.yaml and then restart the server.
Second I tried with the sensor.yaml and then do the include sensor.yaml on the configuration but didnt do the restart of the server.
One more question:
Is it possible somehow to generate an history average per week?
I have a powermonitor for example and I have two graphs 5days and 30days, but when I try to do the same with this it doesnt show me the sensor on the list.
If you mean long-term statistics (statistics graph card), you’ll need to add state_class: measurement to the sensor. Platform snmp does not support this directly, so you’ll need to use customize.yaml:
sensor.poseidon_temperature:
state_class: measurement
device_class: temperature
The click “location & customizations” under “YAML configuration reloading” in Sever controls.
It probably won’t be available immediately, you’ll need to wait for an hour or so.
Aha!
So to make sure I understand it correctly.
1- Create the customize.yaml file to the config folder of HA
2- paste the code you send
3- edit the configuration.yaml file and add the code customize: !include customize.yaml
4- restart again HA server
5- wait 2-3h for it to gather data
6- then go to dashboard and create a new card
type: statistics-graph
entities:
- sensor.poseidon_temperature
chart_type: line
stat_types:
- mean
title: Week
days_to_show: 7
I assume if I want to have clean code I can place the code of the sensor to the sensor.yaml file and do include in the configuration.yaml file correct?
Does this needs also to be under the umbrella of “homeassistant:”?