The 'entity_id' option is deprecated, please remove it from your configuration

Did not find one in the states list, however I just looked at their wiki page and they show to correct the issue… Thanks again for the quick reply and for reference if anyone else sees this and is curious here is what it says

Home Assistant 115.x breaking changes - “remove entity_id option from your templates, as it is now deprecated.”
An easy fix is to create a group of your alexa devices and then use a template sensor to evaluate the group.

group:
  echos:
    name: Echomania
    entities:
      - media_player.this_echo
      - media_player.that_echo
      - media_player.his_echo_show
      - media_player.her_echo_show
- platform: template
  sensors:
    last_alexa:
      value_template: >
        {{ expand(states.group.echos) | selectattr('attributes.last_called','eq',True) | map(attribute='entity_id') | first }}

Then how would I have to adjust this best, thank you very much.


      washing_machine_status:
        entity_id:
          - input_select.washing_machine_status
        value_template: '{{ states.input_select.washing_machine_status.state}}'
        friendly_name: 'Waschmaschine'

like this:

      washing_machine_status:
        value_template: '{{ states.input_select.washing_machine_status.state}}'
        friendly_name: 'Waschmaschine'

Hi all, I also have this error in my logs and I have found which template sensor is causing the issue.

Please see below code (it’s a sensor to display all unavailable items). The sensor is still working, but it is still showing my blacklisted items since this error.

- platform: template
  sensors:
    unavailable_entities:
      entity_id: sensor.time
      friendly_name: Unavailable Entities
      unit_of_measurement: items
      icon_template: >
        {% if states('sensor.unavailable_entities')|int == 0 %} mdi:check-circle
        {% else %} mdi:alert-circle
        {% endif %}
      value_template: >
        {{states|selectattr('state', 'in', ['unavailable','unknown','none'])
          |reject('in', expand('group.entity_blacklist'))
          |reject('eq', states.group.entity_blacklist)
          |reject('eq', states.group.alexamailtts)
          |reject('eq', states.group.hsfangroup)
          |reject('eq', states.group.hslightgroup)
          |list|length}}
      attribute_templates:
        entities: >
          {{states|selectattr('state', 'in', ['unavailable','unknown','none'])
            |reject('in', expand('group.entity_blacklist'))
            |reject('eq' , states.group.entity_blacklist)
            |reject('eq' , states.group.alexamailtts)
            |reject('eq' , states.group.hsfangroup)
            |reject('eq' , states.group.hslightgroup)
            |map(attribute='entity_id')|list|join(', ')}}

If I remove entity_id, the sensor is not updated anymore. I tried to find the answer elsewhere, but couldn’t find it. Can anyone please help me with this one. Thanks!

That’s not true, that template will update once a minute at least.

Indeed. Although I use a similar sensor and once a minute isn’t good enough, so I use an automation that triggers on every state change in the system, with a condition that the state change was either from or to ‘unavailable’, ‘unknown’ or ‘none’ and an action that calls update_entity. Works well.

Well his template uses states which is throttled to at least once a minute. So if he has states that are changing all the time, it’ll pretty much update once a minute.

Yeah, I know, I’m just saying that you can make it update more frequently if desired by using an automation.

And that it probably is desired, because that’s the whole point of the sensor.

Well, he’s going from once a minute with sensor.time to at least once a minute without it. I was just trying to let him know that it will update.

Ha, I can’t help but think we’re talking cross purposes for some reason.

He’s saying that he wanted it to update every minute.

He then said that if he removed entity_id it wouldn’t, which is false.

You corrected him by saying that it will continue to update once a minute, which is true.

I was adding to both of you that this sensor actually should be updated every time the states change otherwise it’s not actually doing what it’s designed to do (ie - monitor entities that go unavailable) so to achieve that goal you need an automation.

If the sensor updates every minute, you could have entities going unavailable for 59 seconds at a time without it ever registering on the sensor.

1 Like

I’ve been meaning to make a super automation that creates groups for things but i’ve been too busy recently.

I’m having same issue, not looked into what is causing it yet … not sure if there’s an easy way to identify the issue?

image

that’s a bad first step :wink:

especially since it is spelled out for you. what more do you need to start searching your template sensors for the entity_id: field

2 Likes

Fully agree.
I’m still fairly new to HA. At the moment I’m just pulling in the entities what I need and everything appears to be working.

Eventually I’ll get around to clearing up the sensors

Really sorry for the late reply. I have been a bit busy with a newborn :joy:. So if I understand correctly, if I remove entity id it will still update when a state will change? Even if it does not use a sensor time? Thanks!

I’m getting:

Logger: homeassistant.components.template.binary_sensor
Source: helpers/config_validation.py:749
Integration: template (documentation, issues)
First occurred: 3:50:50 PM (4 occurrences)
Last logged: 4:03:31 PM

The 'entity_id' option is deprecated, please remove it from your configuration

…but I don’t have entity_id anywhere in my configuration.yaml file. The log references some template sensors. I have three (not four) and they each look like this:

sensor_status_thing:
        friendly_name: "Thing"
        entity_picture_template: local/thing.jpg
        unique_id: home_status_thing
        value_template: "{{ states('input_select.thing') }}"

Is entity_id referenced elsewhere, then?

The error message is for your template binary sensors.

Ah, so it is… well, I didn’t purposely define any of those anywhere. Where would they be? They’re not in configuration.yaml

Thank you for your concern.

It looks like the KeyMaster package may be defining entity_ids in its binary sensors. I’ll inquire with the developer about that…

Thanks for your help. I hope I haven’t troubled you too much.