Shelly4Hass current_consumption state 'W' cannot be processed as a number

Hi,

I tried to set a few automations with current_consumption as a trigger or a condition and I am getting current_consumption state ‘W’ cannot be processed as a number error. How should I get this to work?

You have probably specified the attribute unit_of_measurement in your trigger or condition. Dont.

Not that I can see?

- id: '1659465509286'
  alias: 'Drying machine - done '
  description: ''
  trigger:
  - platform: numeric_state
    entity_id: sensor.shelly_shplg2_1_db29b9_current_consumption
    for:
      hours: 0
      minutes: 5
      seconds: 0
    above: '200'
  condition:
  - condition: numeric_state
    entity_id: sensor.shelly_shplg2_1_db29b9_current_consumption
    below: '5'
  action:
  - service: persistent_notification.create
    data:
      title: Drying machine
      message: Done
  - service: notify.mobile_app_lya_l29
    data:
      title: Drying machine
      message: Done
  mode: single

What does this return in Developer Tools → Templates:

{{ states('sensor.shelly_shplg2_1_db29b9_current_consumption') }}

And how have you added this sensor, Shelly integration, mqtt, other?

I use ShellyforHass integration

Result type: number

0

This template listens for the following state changed events:

  • Entity: sensor.shelly_shplg2_1_db29b9_current_consumption

As this is not a core integration you could ask the developer of that third party integration if no one else has any suggestions.

Is there any reason you are not using the core Shelly integration?

It works very well once Gen 1 devices are set up to use unicast (Not needed for Gen 2 devices).

I had some problems with core integration at the time I bought my first shelly, can’t really remember what it was. If I swap to core integration, will the entities remain or will they get renamed and force me to reconfigure everything?

Note down what the entities are now. You can change the new ones to match if needed.

1 Like

Tried the stock integration again and I remembered what the problem was the first time; I couldn’t add shellys. I’ll try with your guide, I don’t think it was available at the time.