Time trigger correct format

Hi,
I’m a total newb making my first automation and have no experience with YAML.
“sensor.bedste_3_timer_i_dag” contains only the hour and time trigger expect at least HH:MM, what’s the normal/easiest way to add the “:00”

alias: Opvaskemaskine start ved billig strøm
description: ""
trigger:
  - platform: time
    at: sensor.bedste_3_timer_i_dag
condition:
  - condition: and
    conditions:
      - type: is_on
        condition: device
        device_id: b12c69c35cee6f3d260ca600a358ae0e
        entity_id: >-
          binary_sensor.gaggenau_df270160f_68a40e0c737b_bsh_common_status_remotecontrolstartallowed
        domain: binary_sensor
      - type: is_not_open
        condition: device
        device_id: b12c69c35cee6f3d260ca600a358ae0e
        entity_id: >-
          binary_sensor.gaggenau_df270160f_68a40e0c737b_bsh_common_status_doorstate
        domain: binary_sensor
action:
  - condition: device
    device_id: b12c69c35cee6f3d260ca600a358ae0e
    domain: select
    entity_id: select.gaggenau_df270160f_68a40e0c737b_programs
    type: selected_option
    option: Dishcare.Dishwasher.Program.Eco50
  - device_id: b12c69c35cee6f3d260ca600a358ae0e
    domain: button
    entity_id: button.gaggenau_df270160f_68a40e0c737b_start_pause
    type: press
mode: single

As long as your sensor has the timestamp device class, you should not need to do anything. The “HH:MM” format is accepted by Time triggers.

FWIW, there’s no reason to use an “And” condition the way you have in your condition block.

It is not a timestamp device class. It’s an int that only contains the hour - etc. 3 or 21.

Sorry, I mis-read the original post… AFAIK, Time triggers do not accept templating, so you just need to use a template trigger.

alias: Opvaskemaskine start ved billig strøm
description: ""
trigger:
  - platform: template
    value_template: >
      {% set x = states('sensor.bedste_3_timer_i_dag') %}
      {{ now() >= today_at(x~":00")}}
condition:
  - type: is_on
    condition: device
    device_id: b12c69c35cee6f3d260ca600a358ae0e
    entity_id: binary_sensor.gaggenau_df270160f_68a40e0c737b_bsh_common_status_remotecontrolstartallowed
    domain: binary_sensor
  - type: is_not_open
    condition: device
    device_id: b12c69c35cee6f3d260ca600a358ae0e
    entity_id: binary_sensor.gaggenau_df270160f_68a40e0c737b_bsh_common_status_doorstate
    domain: binary_sensor
action:
  - condition: device
    device_id: b12c69c35cee6f3d260ca600a358ae0e
    domain: select
    entity_id: select.gaggenau_df270160f_68a40e0c737b_programs
    type: selected_option
    option: Dishcare.Dishwasher.Program.Eco50
  - device_id: b12c69c35cee6f3d260ca600a358ae0e
    domain: button
    entity_id: button.gaggenau_df270160f_68a40e0c737b_start_pause
    type: press
mode: single

Thanks ill give it a try and know if it works after 2 am :slight_smile:
And thanks for also cleaning up the “condition: and”