Entity is non-numeric for inactive solar panels

Hi,

I know this sort of thing has cropped up before, but I’ve been through all the other occurences and cannot find what I’m doing wrong.

I’m trying to get readings from solar panels by querying the inverter using MQTT

This works during the day, but as soon as they stop generating I get them showing up in the dashboard as “Entity is non-numeric”

If I look up the entitiy value in the developer tools it says “unknown”

I’ve tried all sorts so far and found the simplest looking one was to just format things as a float (this’d be fine). As you can see before, I’ve tried three different sensors three different ways but cannot get it to read zero when the value is “unknown”

sensor Solar:
  - platform: mqtt
    state_topic: "sbfspot_12345"
    name: "Inverter Instant Power"
    unique_id: "currentTotalPower"
    #value_template: "{{ value_json.PACTot | int }}"
    value_template: "{{ states(value_json.PACTot) | float }}"
    unit_of_measurement: 'W'
    device_class: power
    icon: mdi:solar-power
    
  - platform: mqtt
    unique_id: "rearArrayPower"
    state_topic: "sbfspot_12345"
    name: "DC Power String Rear"
    #value_template: "{{ value_json.PDC1 }}"
    value_template: "{{ states('value_json.PDC1') | float }}"
    unit_of_measurement: 'W'
    device_class: power
    icon: mdi:solar-power
    
  - platform: mqtt
    unique_id: "frontArrayPower"
    state_topic: "sbfspot_12345"
    name: "DC Power String Front"
    #value_template: "{{ value_json.PDC2 }}"
    value_template: "{{ value_json.PDC2 | float }}"
    unit_of_measurement: 'W'
    device_class: power
    icon: mdi:solar-power

Can anyone help please?

This will return 0 when the value can’t be converted to a number:
| float(0)

Thanks for the reply.

I’ve added float(0) to each entry. None of them work, they still give the “Entry is non-numeric” message in overview.

  - platform: mqtt
    state_topic: "sbfspot_14719"
    name: "Inverter Instant Power"
    unique_id: "currentTotalPower"
    #value_template: "{{ value_json.PACTot | int | default}}"
    value_template: "{{ states(value_json.PACTot) | float(0) }}"
    unit_of_measurement: 'W'
    device_class: power
    icon: mdi:solar-power
    
  - platform: mqtt
    unique_id: "rearArrayPower"
    state_topic: "sbfspot_14719"
    name: "DC Power String Rear"
    #value_template: "{{ value_json.PDC1 }}"
    value_template: "{{ states('value_json.PDC1') | float(0) }}"
    unit_of_measurement: 'W'
    device_class: power
    icon: mdi:solar-power
    
  - platform: mqtt
    unique_id: "frontArrayPower"
    state_topic: "sbfspot_14719"
    name: "DC Power String Front"
    #value_template: "{{ float(value_json.PDC2,0) }}"
    value_template: "{{ value_json.PDC1 | float(0) }}"
    unit_of_measurement: 'W'
    device_class: power
    icon: mdi:solar-power

Ok the client device might be using LWT messaging. Try disabling that.

1 Like

Thank you so much! That seems to have worked!

For the record I added the following to configuration.yaml

mqtt:
    will_message: {}

It would have been better if you could disable it on the one client device, rather than for everything.

please can you send the comeplete code of that am geeting some issues


Screenshot 2023-02-01 164316