The 'entity_id' option (with value 'sensor.time') is deprecated

Received this error:

The 'entity_id' option (with value 'sensor.time') is deprecated, please remove it from your configuration.

The only place I’m using it is:

      - platform: template
            value_template: '{{ is_state("cover.garage_door", "open") and (as_timestamp(now()) - as_timestamp(states.cover.garage_door.last_changed) > 15 * 60 ) }}'
            entity_id: sensor.time

I tried ‘sensor.time_date’, that did not help.

In my case it was in one of my Automations. Did you check there?

You can remove the entity_id from your template sensors, just like the warning says.

its telling you to remove the line: entity_id: sensor.time from your config.

I am getting the same error, I have it in a sensor aswell:

      entity_id: sensor.date__time
      value_template: '{{ (as_timestamp(states.calendar.abfallkalender.attributes.start_time) - as_timestamp(now()) ) }}'
      friendly_name: 'Alert Time'

The warning disappears when I take the “entity_id” out and the sensor still shows up, BUT it does not update anymore and is therefore useless for me. Any help is appreciated.

See my post here: How to replace entity_id in template sensors

Basically remove the now() and insert a date, that means the sensor will update whenever the date/time updates.

1 Like

Thank you, that seems to work according to the dev-templates. I will give it a shot, cheers!