Template result filter

Hi

I use this template to put any entity in this device in the template to back one specific entity binary_sensor.bluetooth_hub_connected to know the state of the device is connected or not.
but I can’t filter the result :upside_down_face:

{{ device_entities(device_id('sensor.bluetooth_hub_ip')) }} 

result is

[
  "button.bluetooth_hub_restart",
  "sensor.bluetooth_hub_wifi_dbm",
  "sensor.bluetooth_hub_wifi_channel",
  "sensor.bluetooth_hub_wifi_percentage",
  "sensor.bluetooth_hub_illuminance",
  "sensor.bluetooth_hub_uptime",
  "sensor.bluetooth_hub_ip",
  "sensor.bluetooth_hub_wifi_ssid",
  "light.bluetooth_hub_rgb",
  "binary_sensor.bluetooth_hub_connected",
  "binary_sensor.bluetooth_hub_button",
  "sensor.xiaomi_mi_scale_weight",
  "sensor.xiaomi_mi_scale_impedance"
]

I need to filter the list

Why not just do this?

{{ states('binary_sensor.bluetooth_hub_connected') }}

only show me this
binary_sensor.bluetooth_hub_connected

My template returns the state of the entity, not the entity id. That’s what you want isn’t it?

To know if it is connected or not?

I know this my goal extrct binary_sensor.bluetooth_hub_connected when I use Automation in the blueprint

blueprint:
  name: Motion-activated Light (multiple) for ESPHome
  description: Turn on a light when motion is detected.
  domain: automation
  input:
    motion_entity:
      name: Motion Sensor
      selector:
        entity:
          domain: binary_sensor
          device_class: motion
          multiple: true
          
    light_target:
      name: Light
      selector:
        target:
          entity:
            domain: light

    Node_Connected:
      name: Node Connected
      description: Wait for Node Connected before activated light.
      selector:
        entity:
          integration: esphome
          domain: binary_sensor
          device_class: connectivity
          
        
    no_motion_wait:
      name: Wait time
      description: Time to leave the light on after last motion is detected.
      default: 120
      selector:
        number:
          min: 0
          max: 1800
          unit_of_measurement: seconds


mode: restart
max_exceeded: silent



trigger:
  platform: state
  entity_id: !input motion_entity
  from: "off"
  to: "on"
  
action:
  - wait_template: "{{ is_state(!input Node_Connected, 'on') }}"
    continue_on_timeout: false    
  - service: light.turn_on
    target: !input light_target
  - wait_for_trigger:
      platform: state
      entity_id: !input motion_entity
      from: "on"
      to: "off"
  - delay: !input no_motion_wait
  - service: light.turn_off
    target: !input light_target

instead, use

    Node_Connected:
      name: Node Connected
      description: Wait for Node Connected before activated light.
      selector:
        entity:
          integration: esphome
          domain: binary_sensor
          device_class: connectivity

when I select light its pickup this entity because the light in the same node
all that because we have electricity issues some nodes need time to back online

variables:
  Node_Connected: !input light_target "{ after filter result }"


- wait_template: "{{ is_state(Node_Connected, 'on') }}"

and remove part off

Node_Connected:
      name: Node Connected
      description: Wait for Node Connected before activated light.
      selector:
        entity:
          integration: esphome
          domain: binary_sensor
          device_class: connectivity