Automation doesn't fire action but trigger and action work themself

Hi guys,

I have a “Shelly Plug S” which i want to automate in Home Assistent.
First at all I configured that Plug via a Sensor and a Command Line Switch in my configuration.yaml because my Home Assistant Instance isn’t running in my home network and so i can’t use the Shelly Integration.
This way is working just fine and i get the output of the plug as well i can switch it on and off.

Now there comes the tricky part:
I build an automation which should switch the plug off if the output is above XY Watts.

- id: '....'
  alias: Test Switch
  description: ''
  trigger:
  - platform: numeric_state
    entity_id: sensor.fahrrad
    above: '5'
  condition: []
  action:
  - service: switch.turn_off
    data: {}
    target:
      entity_id:
      - switch.fahrradswitch
  mode: single

This action just works perfectly if i press the “Execute” button.
My trigger is also working perfectly because i tested it with other devices (Homematic IP Plugs).

I can also see in the Logfile that the command_off statement is fired but still nothing happens…
Is there a tiny difference how actions in automations are executed automatically and manually?

I’m totally confused…

Thanks and best regards
Manu

The automation will only trigger when the entity crosses over 5. It will not trigger if it goes from 6 to 7.

I know this. And the automation triggered also my other devices. But not the switch which nevertheless works perfectly if i press “Execute”.

Check the automation’s trace.

Troubleshooting Automations

It tells me that the Service is called:

But the Plug doesn’t react. And how I said if I press “Execute Action” (don’t know how it is called in English) it works like a charm.

Is there maybe a problem with automations and command line switches?

When you press the Execute Action button it will execute the automation’s action which consists of a single service call: switch.turn_off. That’s the same service call executed when the automation is triggered by its Numeric State Trigger. Execution of the service call is identical whether its initiated by the automation’s trigger or via the button.

If you wish, you can try an additional way to test the service call. Use Developer Tools > Services to execute the following:

service: switch.turn_off
target:
   entity_id: switch.fahrradswitch

Ultimately, if the service call doesn’t behave consistently, it’s highly unlikely it is due to how the service call is initiated and far more likely due to its underlying integration.

I have the same problem. Did you manage to find a solution?

Same here. Complete new automation, traces show that it was executed but it wasn’t. Action and trigger work fine, logs show that everything is in order, but automation (one particular light.toggle automation) just simply ignores actual execution