Missing something really obvious

I tied to use the UI to accomplish what I want, but I couldn’t figure it out, so I wrote it out in yaml, but it’s still not working properly…

Basically I have a ‘dumb’ blue ray player so I wanted to create a helper counter for my blue ray tray… When I call the ‘open’ script, it’s supposed to check if the counter is 0, which represents that it is closed, then if it is, send the open command and increment the counter by 1, setting up the close script that checks if the tray is open (1), calling the remote send command and then resetting the counter.

I have executed both scripts and they stop at the condition, so I am obviously doing it wrong.

Can anyone tell me what I’m missing?

sequence:
  - condition: template
    value_template: "{{ states('counter.cd_tray') == '0' }}"
  - metadata: {}
    data:
      num_repeats: 1
      delay_secs: 0.4
      hold_secs: 0
      device: blue_ray
      command: Open/Close
    target:
      device_id: 56fbb3973f1bc57afd62970558be557e
    action: remote.send_command
  - metadata: {}
    data: {}
    target:
      entity_id: counter.blue_ray_tray
    action: counter.increment
alias: open blue_ray tray
description: ""

What does {{ states('counter.cd_tray') }} tell you in “Developer tools → Template”?

2 different entities.

but why are you using a counter instead of a input_boolean?

1 Like