Utility_Meter --- invalid config in YAML but not with Helper

I am puzzled on this one.
I have 12 sensors I defined in config.yaml - everything is working fine.

The I tried to define a new sensor for the energy I am selling to the network.
It is coming also from Tasmota (same device providing the energy consumed and energy sold through 2 different mqtt values)

The “Check YAML” keeps warning that this is an invalid option…
→ I then tried to define the sensor using an helper… and its ok!

How can this be?

Accepted code in Config

  unique_id: "mt1681-weeky"
  source: sensor.bitshake_smartmeterreader_mt681_total_in
  name: From netz weekly
  cron: "0 0 * * 7"


  source: sensor.bitshake_smartmeterreader_mt681_total_out
  name: To netz weekly
  cron: "0 0 * * 7"
  unique_id: "mt1681-OutWeekly"

The sensor.bitshake_smartmeterreader_mt681_total_out is ok and I can access it as an entity

Any idea please

my apologies. The code is formatted correctly (it’s in an include file… but I copied and pasted and the spaces don’t show… but it is formatted ok).

The error is

The sensor is in a customise file and is defined as (again the spaces are ok… - I have now edited the post to show the formatting)

  unit_of_measurement: "kWh"
  device_class: energy
  state_class: total_increasing

  unit_of_measurement: "kWh"
  device_class: energy
  state_class: total_increasing

The main difference I can see is that in your invalid code - you have uppercase letters, which you should not.

damn!!! you are the MAN!
I didnt know about the uppercase!

Many thanks!!!

1 Like