Trying to use 'choose' based on the trigger

I have the following code, but it’s not working or working unpredictably. I basically just want to use the choose option to do one of two things (this will be one of 8 things, hence choose) based on which input_boolean entity turning on, triggered it.

  trigger:
    - platform: state
      entity_id: 
        - input_boolean.ib1
        - input_boolean.ib2
      from: "off"
      to: "on"      
  condition:
    condition: time  
    weekday:
      - sun
      - sat
      - fri
      - mon
  action:
    - choose:
        # IF 1
        - conditions:
            - condition: template
              value_template: "{{ trigger.to_state_object_id == ib1 }}"
          sequence:
            - service: notify.telegram_justin
              data:
                message: ib1
    - choose:
        # IF 2
        - conditions:
            - condition: template
              value_template: "{{ trigger.to_state_object_id == ib2 }}"
          sequence:
            - service: notify.telegram_justin
              data:
                message: ib2

You have a couple issues with your template:

  1. trigger.to_state_object_id is not valid.
  2. Without quotes, ib1 is interpreted as a variable with no defined value.

It should be as follows:

value_template: "{{ trigger.to_state.object_id == 'ib1' }}"

Full Automation
trigger:
    - platform: state
      entity_id: 
        - input_boolean.ib1
        - input_boolean.ib2
      from: "off"
      to: "on"      
  condition:
    condition: time  
    weekday:
      - sun
      - sat
      - fri
      - mon
  action:
    - choose:
        - conditions:
            - condition: template
              value_template: "{{ trigger.to_state.object_id == 'ib1' }}"
          sequence:
            - service: notify.telegram_justin
              data:
                message: ib1
        - conditions:
            - condition: template
              value_template: "{{ trigger.to_state.object_id == 'ib2' }}"
          sequence:
            - service: notify.telegram_justin
              data:
                message: ib2

Or, if that is all you’re trying to do, you don’t really need the Choose:

  action:
    - service: notify.telegram_justin
      data:
        message: "{{ trigger.to_state.object_id }}"

Brilliant spots, clearly been a long week, two typos in one template. Thanks very much, working as it should be now.