Condition not working

Hi I’m just getting started on HA and I’m getting some problems with my Automations.

I have an Automation that should only stop the media player if the light is on, and then turn off the light.

but it stops the media player even if the light is off?

can you see what I did wrong?

- id: '1557085226874'
  alias: Bad tryk 1 OFF
  trigger:
  - event_data: {}
    event_type: bad_tryk_1
    platform: event
  condition:
  - condition: state
    entity_id: light.fibaro_system_fgd212_dimmer_2_level_2
    state: 'on'
  action:
  - data:
      entity_id: media_player.gamerroom
    service: media_player.media_stop
  - data:
      entity_id: light.fibaro_system_fgd212_dimmer_2_level_2
    service: light.turn_off

The only possible things are

  • You’re using the wrong entity_id in the condition
  • You have another automation (or something outside of HA) that is turning off the media player

It works :slight_smile:

I was trying to trigger it from the Lovelace UI, and there it did not work, but when I did I via the trigger, it worked.

So when I trigger manual, it only fires the actions, and don’t look at the conditions, is that correct assumed?