Automation not triggering with shelly

Hi everyone,
I need help with a simple automation I cannot solve.

I have connected a Shelly 2.5 to my washing machine so I can monitor the energy consumption.
Shelly is correctly configure and the related shelly sensor works and reads correctly the current power consumption (W).

The automation is this:
When power consumption goes from above 5 W to below 4 W do the following:

  • Notification to phone
  • Alexa TTS saying the washing machine has finished its cycle.

Pretty simple but it does not trigger automatically.

This is the related sensor, showing the washing cycles in W. That works.
img

This is the automation (made with UI):

alias: Washing machine alert
description: ""
trigger:
  - type: power
    platform: device
    device_id: cbb0286cfbea5d9ae841d27947b70094
    entity_id: 861bbf445f3bea05bd5831614a01ac23
    domain: sensor
    above: 5
    below: 4
condition: []
action:
  - service: notify.mobile_app_iphone
    data:
      message: Custom msg
      title: Custom title
  - service: notify.alexa_media
    data:
      message: Washing machine's cycle ended.
      target: media_player.alexa_kitchen
mode: single

I’ve also tried to trigger it by setting manual values on the sensor using DevTools on HomeAssistant, the entity goes to 6 (W) then I set it manually to 3 (W) but it does not trigger. What am I doing wrong?

Thanks in advance.

Your trigger options contradict each other - you will never have consumption above 5W AND below 4W. Remove above: condition and it should work. Note that triger fires when threshold is met and below or above defines direction of crossing the threshold. So below: 4 means trigerring automation when consumtion drops below 4W. Having above: 5 is not required, unless, for some reason, you want to exclude case when consumption drops from 4.5W to 3.5W :slight_smile: but then also syntax would be different…

Your entity must be the power of the washing machine. In the Shelly .2.5 you will have 2 of them, make sure you select the correct one.

861bbf445f3bea05bd5831614a01ac23 = must be the power entity.

The minutes is to stop false triggers when it start and finishes. You may need to adjust them.


alias: Washing machine alert
description: ""
trigger:
  - platform: numeric_state
    entity_id: 861bbf445f3bea05bd5831614a01ac23
    above: 5
    for:
      minutes: 1
condition: []
action:
  - wait_for_trigger:
    - platform: numeric_state
      entity_id: 861bbf445f3bea05bd5831614a01ac23
      below: 4
      for:
        minutes: 2
  - service: notify.mobile_app_iphone
    data:
      message: Custom msg
      title: Custom title
  - service: notify.alexa_media
    data:
      message: Washing machine's cycle ended.
      target: media_player.alexa_kitchen
mode: single

Blacky :smiley:

@mirekmal I feel so stupid right now. I think you just solved my problem. Thank you soooo much!!! :smiley:

@Blacky thanks for your feedback. It was the correct entity btw that’s why I posted the screenshot :wink: