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

Ok thanks all kindly!!!

AND … you did it again !

Most useless warning message I’ve ever seen. No pointer to the config line that caused this, which template sensor, nothing.

2020-09-24 20:32:38 WARNING (MainThread) [homeassistant.components.template.binary_sensor] The 'entity_id' option is deprecated, please remove it from your configuration

I guess I’ve learned my lesson by now: never upgrade HA. :frowning:

3 Likes

How difficult is it to search your configuration for template binary sensors and remove the entity_id key from them?

Answer: It’s not difficult at all.

2 Likes

I did search my configuration for any occurrence of entity_id. I found 17 of them. But I was only getting 7 warnings. There was no indication as to which 7.

Through the process of elimination, and trial-and-error, I did find the offending entries. None of them had the word “binary” anywhere in them. It was pure guesswork, and then restarting to see if the errors had gone away.

You ask how difficult it was. It didn’t ruin my life. But it sure ruined half of my day. I’d consider that a real embarrassment if I’d forced one of my users to go through that. Especially after following the documented examples exactly when setting up the offending templates.

3 Likes

You must be ignoring the brackets. They always tell you what component the error is in. See below.

Yes there is, in the error.

[homeassistant.components.template.binary_sensor] The 'entity_id' ...
                             \           /
                              \         /
                               \       /
            Tells you the integration and domain.

And before you say “but which 7”. The answer is: all of them in binary_sensor templates.

2 Likes

Hey, how your answer help OP?0

multiplying bu number of people who must cope with this… it’s very expensive. magnitudes more comparing to development work needed for providing complete, easily readable messages.

There is WTH request about that. There are deffinitively even less usable log messages than this one. Hope devs will nail it soon. the better application feedback the less work for them.

1 Like

Also as a side note, I had to check the error out inside the UI to verify it had the information and it does as well:

To clarify, this is an error in the template sensor integration, not the template binary_sensor integration.

EDIT: It’s actually in your original post too:

                                      |        |
                                      V        V  

A - It told him/her where to look
B - It told him/her not to over dramatise a small thing
C - It enabled him/her to carry A and B forward in to any further problems he/she encounters

So, pretty helpful all in all. 04X

I posted the whole warning message right here in the OP, asking what it meant. I don’t see that as “ignoring” it.

Now that you’ve explained it, I was able to confirm that, indeed, I had exactly 7 instances of entity_id under sensors: in the platform: template section of configuration.yaml. Thank you.

But I’m not sure how I would have known that, without someone taking pity on me and pointing me in the right direction. And I will point out that it took 45 posts to get to that point.

I really don’t see why there’s disagreement with the suggestion to construct warning messages to indicate exactly which entry they refer to. I’d think everyone could agree that’s a good idea.

For the record, it wasn’t this thread which got me to a solution. It took hours of guessing and trying to find 7 similar entries out of the 17 entity_ids I found in my configuration. Sure, I got there eventually, but I still didn’t connect the warning message to those specific entries.

Now I understand, and I appreciate the efforts. I just think more could have been done to explain it in the log entry, and we could all have avoided this long thread.

I’m thinking a short digression on your part to learn how to understand the error messages would have served you better than spending ‘hours’ searching when you didn’t know what you were looking for.

All’s well that ends well.

Also ‘for the record’, you were not the person that my post was a reply to.

I think this community has major issues. Instead of actually fixing issues that are clearly affecting people, you guys just become defensive and blame it on the user. HA error messages suck, to put it mildly.

How about this one, tell me how do I go about figuring out where to even start?

2020-09-26 10:11:12 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/template/template_entity.py", line 265, in _async_template_startup
    self.hass, template_var_tups, self._handle_results
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/event.py", line 792, in async_track_template_result
    tracker.async_setup()
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/event.py", line 518, in async_setup
    self._info[template] = template.async_render_to_info(variables)
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/template.py", line 306, in async_render_to_info
    render_info._result = self.async_render(variables, **kwargs)
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/template.py", line 285, in async_render
    return compiled.render(kwargs).strip()
  File "/srv/homeassistant/lib/python3.7/site-packages/jinja2/environment.py", line 1090, in render
    self.environment.handle_exception()
  File "/srv/homeassistant/lib/python3.7/site-packages/jinja2/environment.py", line 832, in handle_exception
    reraise(*rewrite_traceback_stack(source=source))
  File "/srv/homeassistant/lib/python3.7/site-packages/jinja2/_compat.py", line 28, in reraise
    raise value.with_traceback(tb)
  File "<template>", line 1, in top-level template code
ZeroDivisionError: 0.0 cannot be raised to a negative power

So many wasted hours in debugging random problems…

2 Likes

You have a template that is dividing by zero. Read the last line.

It’s telling you that your powering something to zero, which is like dividing by zero. So look for templates where you use ** as the multiplier.

2 Likes

As a side note, it’s impossible to catch all exceptions that users can produce when making templates because users can do anything.

1 Like

You’re also confusing the community with the developers. The majority of the people who give their time to help people on these forums aren’t developers and can’t do anything about the contents of the error messages.

1 Like

Ok, developers, which don’t seem to be reading these forums.

Sure, I understand what it means, but which template, which entity, which file, which line number from the 89 occurrences??

grep -R template *yaml | wc
     89     326    4138

I understand your point, and appreciate the desire to help, and this if how I found it eventually, but this does not mean that the error messages cannot (and definitely should) be more self-explanatory.

It was just an example.

I’m a developer too, and I can tell you that ignoring your user’s complaints is most certainly not the way to grow a product.

2 Likes

And what you’re not understanding is that the errors that I and others were referring to in this thread are related to the original complaint. You coming in here like a bull in a china shop doesn’t help because your error is 100% unrelated to the argument at hand which is: entity_id is deprecated error message tells you all the information you need.

I don’t know where you were, but the month of WTH was an entire month where users could complain and things would get fixed. Complaining now about no one listening when it ended a week ago just makes you look like a complainer.

2 Likes

Like the original poster, I spent considerable time trying to figure out what entities I needed to remove. I just gave an example of how errors are in general in HA (unhelpful). This, combined with the release breaking several things, does not help. Sorry for hijacking this thread. Going to shut up now, it doesn’t help to change attitude anyway.

1 Like

I have a couple of trend based (binary-)sensors for managing Air Conditioners with BroadLink IRs. Since BroadLink IR’s work in one-way communication only the Temperature-Trend-Sensors are needed to sense the state of the AC-units because they are also managed by the original remote controls in parallel.

I am seeing the same error messages like the other posters here.

How can I just remove the entity_id’s here? Scratching my head because it seems impossible to just comment them …

    binary_sensor:
      - platform: trend
        sensors:
          master_bedroom_temperature_increasing:
            entity_id: sensor.broadlink_rm4_1_master_bedroom_temperature
            friendly_name: Master Bedroom Temperature Increase          
            min_gradient: 0.00166666666
            sample_duration: 300
            max_samples: 30
            device_class: heat
          
        master_bedroom_temperature_decreasing:
          entity_id: sensor.broadlink_rm4_1_master_bedroom_temperature
          friendly_name: Master Bedroom Temperature Decrease
          min_gradient: -0.00166666666
          sample_duration: 300
          max_samples: 30
          invert: true          
          device_class: cold

I’m not sure it is related to these. Are you sure you have no other entity_Ids that are using a (value) template? The reason it can be removed there is because the entity is already present in the template and thus entity_id is not needed anymore.

2 Likes