Statistic Sensor Expected number or binary state, but received '“0.7” from MQTT Sensor?

Hi,

i would like to track the max Wind within 24 hrs from a Bresser 433 RTL, so far, HA is receiving the value, but if i try, to figure out the max value on a day it fails with expected title failure message. Here is my YAML;

mqtt:
- name: "windmax_outside_bresser61"
    state_topic: rtl_433/bresser61/wind_max_m_s
    value_template: “{{ value | round(2) | float }}”
    icon: mdi:windsock
    unit_of_measurement: "ms"


- platform: statistics
  name: "max wind over last 24 hours"
  entity_id: sensor.windmax_outside_bresser61
  state_characteristic: value_max
  max_age:
    hours: 24
  sampling_size: 500
  precision: 1

Thank you

Why are you putting the statistics sensor under the mqtt integration?

The other item you have under mqtt is not correct either.

it should be something like this:

in configuration.yaml:

mqtt:
  sensor:
    - name: "windmax_outside_bresser61"
      state_topic: rtl_433/bresser61/wind_max_m_s
      value_template: “{{ value | round(2) | float }}”
      icon: mdi:windsock
      unit_of_measurement: "ms"

sensor:  
  - platform: statistics
    name: "max wind over last 24 hours"
    entity_id: sensor.windmax_outside_bresser61
    state_characteristic: value_max
    max_age:
      hours: 24
    sampling_size: 500
    precision: 1

If you already have something like this in your configuration.yaml file:

sensor: !include sensors.yaml

Then put the statistics sensor in there instead.

sensors.yaml

- platform: statistics
  name: "max wind over last 24 hours"
  entity_id: sensor.windmax_outside_bresser61
  state_characteristic: value_max
  max_age:
    hours: 24
  sampling_size: 500
  precision: 1

hi, it is still separated in files, but merged for the topic

How were we supposed to know that?

thats not relevant for the syntax or problem, if the declaration is in one conf.yaml or not. thx

It very much is relevant. If you post invalid config the first thing someone is going to do is waste their time correcting it for you. Like I did.