The dates after the decimal point

Hi, Can I change the decimal after the comma ? Sensor is a homewizard plug.
22

Greetings

Hi, did is what use. but still still 3 after the decimal point
sensor:

  • platform: template
    sensors:
    energysocket_3c39e72c391e_active_power:
    friendly_name: “cv active power”
    unit_of_measurement: ‘W’
    value_template: “{{ (states(‘sensor.energysocket_3c39e72c391e_active_power’)) | round(1)}}”

22

I think you should rename the sensor to something else (like energysocket_3c39e72c391e_active_power_rounded. Then pick that one.

Hi, have this error ?

sensor:

  • platform: template
    sensors:
    energysocket_3c39e72c391e_energysocket_active_power_rounded:
    friendly_name: “active power rounded”
    unit_of_measurement: W
    value_template: >
    “{{ (states_attr(‘energysocket_3c39e72c391e_active_power_rounded’)) | round(1) }}”

Greetings

Add a field unique_id with something random in your config.

sensor:

  • platform: template
    sensors:
    energysocket_3c39e72c391e_active_power:
    unique_id: 3c39e72c391e
    unit_of_measurement: W
    friendly_name: smytangel
    value_template: >
    “{{ (states_attr(‘sensor.energysocket_3c39e72c391e_active_power’)) | round(1) }}”

It seems you have removed that “_rounded” thing

sensor:

  • platform: template
    sensors:
    energysocket_3c39e72c391e_active_power_rounded:
    unique_id: 3c39e72c391e
    unit_of_measurement: W
    friendly_name: smytangel
    value_template: >
    “{{ (states_attr(‘sensor.energysocket_3c39e72c391e_active_power_rounded’)) | round(1) }}”

is this right ?


platform: template
sensors:
energysocket_3c39e72c391e_active_power_rounded:
unique_id: 3c39e72c391e
unit_of_measurement: W
friendly_name: smytangel
value_template: >
“{{ (states_attr(‘sensor.energysocket_3c39e72c391e_active_power’)) | round(1) }}”

after restart

Read the error message :wink:. I am not your debugger :upside_down_face:

Hi Unsigus, but thanks for all the help so far. :+1:

Found this in the log

Removed the S in line 17 and now no error.

Still red

Removed _attr row 25 red dot is gone



Hi Unsigus,

Found the right code, thanks again for your support :+1:

1 Like