Timer Bar Card duration based on a timer

Hello,

My switch turns off automatically based on a timer.

The problem is that I cannot determine a timer entity as duration duration.

I get the message: Error: Could not convert duration: timer.doeswork.here is not of format 0:10:00. If you are passing in a number, specify the units property

type: custom:timer-bar-card
entities:
  - switch.double_switch_2_2_2
duration:
  fixed: timer.doeswork.here
tap_action:
  action: toggle

You haven’t provided us enough information about how you have structured the relationship between the switch and timer for a 100% accurate answer, but here’s a educated guess based on Timer Bar Card: Configuring Time Properties:

type: custom:timer-bar-card
entities:
  - switch.double_switch_2_2_2
duration:
  entity: timer.example
  attribute: duration
tap_action:
  action: toggle