Binary Sensor not showing up in web server

I have a binary_sensor.


  - name: "Right bank selected" # Changeover switch on control panel
    id: right_bank_selected
    platform: gpio # homeassistant #gpio
    # entity_id: input_boolean.test_right_bank_selected # Change to pin: after comissioning
    pin: ${right_bank_selected_pin}
    on_press:
      then:
        - binary_sensor.template.publish:
            id: left_bank_selected
            state: OFF

When platform is template, it doesn’t show up in the web server.

When platform is gpio, it shows up.

Is this by design?

Post your yaml for the template sensor as well. Did you give it a name?

Here’s the two together:

  - name: "Right bank in use" # From reed switch in changeover valve. Change to gpio platform after commisioninig
    id: right_bank_in_use_from_changeover_valve
    platform: homeassistant # gpio
    # pin: ${left_bank_in_use_pin}
    entity_id: input_boolean.test_right_bank_in_use_from_changeover_valve
    on_press:
      then:
        lambda: |-
          id(left_bank_in_use_from_changeover_valve).publish_state(false);


  - name: "Left bank in use" # From reed switch in changeover valve. Change to gpio platform after commisioninig
    id: left_bank_in_use_from_changeover_valve
    platform: homeassistant # gpio
    # pin: ${left_bank_in_use_pin}
    entity_id: input_boolean.test_left_bank_in_use_from_changeover_valve
    on_press:
      then:
        lambda: |-
          id(right_bank_in_use_from_changeover_valve).publish_state(false);

I have the same issue with this pair:

  - name: "Right bank selected" # Changeover switch on control panel
    id: right_bank_selected
    platform: homeassistant #gpio
    entity_id: input_boolean.test_right_bank_selected # Change to pin: after comissionin
    # pin: ${right_bank_selected_pin}
    on_press:
      then:
        lambda: |-
          id(left_bank_selected).publish_state(false);


  - name: "Left bank selected" # Changeover switch on control panel
    id: left_bank_selected
    platform: homeassistant #gpio
    entity_id: input_boolean.test_left_bank_selected # Change to pin: after comissioning
    # pin: ${left_bank_selected_pin}
    on_press:
      then:
        lambda: |-
          id(right_bank_selected).publish_state(false);

They are not template sensors but homeassistant sensors. (or maybe homeassistant binary sensors, who knows, you don’t show it).
Read the last note here:

What are you trying to accomplish?

Thank you. I appreciate your time.

The internal: false fixed it.

I am using HA dashboard entities to test out the ESPHome config without having to connect hardware.

Configuring it the way I have I don’t need to rewrite so much once the hardware is available.