Newbie help- Can't stop automation from running

I am a real newbie who is trying trying to use HA for simple tasks around the house. I have Broadlink remotes to switch RF and IR devices on and off and that works well. Recently with the increase in energy prices I purchased some UK tasmota smart plugs with power monitoring. I’ve installed mosquitto broker and tasmota admin and have integrated them with no problems. I then wanted to alter an existing automation that switches on my TV console to to include a condition that looks at the state of the tasmota switch and if already on stops it from running. I added the state and pressed the test button and I get the red x when the state is set to off. I assume this should stop the automation running. I also tested on and get the green tick. I reloaded the automations, then run the automation and it doesn’t seem to take any notice of the condition I set and runs the automation. I rebooted and it’s the same. I can’t understand what I am doing wrong, can anyone please take a look at my code and advise what I should be doing.

Thanks

Paul.

  • id: ‘1590078138746’
    alias: Console On
    description: Turn on Console Power, TV, Soundbar, Sky & change to channel 3
    trigger: []
    condition:
    • condition: state
      entity_id: switch.power_console
      state: ‘off’
      action:
    • service: switch.turn_on
      data: {}
      target:
      device_id: 5d3617f316f8e9ebd3319f06840c4691
    • delay:
      hours: 0
      minutes: 0
      seconds: 3
      milliseconds: 0
    • service: switch.turn_on
      data: {}
      target:
      entity_id: switch.curve
    • delay:
      hours: 0
      minutes: 2
      seconds: 30
      milliseconds: 0
    • service: switch.turn_on
      data: {}
      target:
      entity_id: switch.set_top_box
    • delay:
      hours: 0
      minutes: 0
      seconds: 3
      milliseconds: 0
    • service: switch.turn_on
      data: {}
      target:
      entity_id: switch.hdmi_1
    • delay:
      hours: 0
      minutes: 0
      seconds: 3
      milliseconds: 0
    • service: switch.turn_on
      data: {}
      target:
      entity_id: switch.back
    • delay:
      hours: 0
      minutes: 0
      seconds: 3
      milliseconds: 0
    • service: switch.turn_on
      data: {}
      target:
      entity_id: switch.3
    • delay:
      hours: 0
      minutes: 0
      seconds: 5
      milliseconds: 0
    • service: switch.turn_on
      data: {}
      target:
      entity_id: switch.sound

Please excuse my stupidity I replaced to entity with device and it worked. I have no idea why as I previously tried this and it didn’t work. I may have not reloaded the automation.