Change sensor to v115

Hello,

I have the following sensors defined but I have no clue how to change it to the v115 without entity_id.

  - platform: template
    sensors:
      erik_last_location_update:
        friendly_name: "laatste update."
        entity_id:
          - sensor.erik_latitude
          - sensor.erik_longitude
        value_template: >
               {{now().strftime('%d-%h-%y - %H:%M:%S') }}

Can you point me in the right direction?

Thank you

Erik

I haven’t tried it but this should work I think:

  - platform: template
    sensors:
      erik_last_location_update:
        friendly_name: "laatste update."
        value_template: >
          {% set lat = states('sensor.erik_latitude') %}
          {% set lon = states('sensor.erik_longitude') %}
          {{now().strftime('%d-%h-%y - %H:%M:%S') }}
2 Likes

I’ll try that.Thanks

edit: It works, thx!!

Hello,
I have the same problem.

BinarySensorDevice is deprecated, modify LuxtronikBinarySensor to extend BinarySensorEntity

binary_sensor:
  - platform: template
    sensors:
      heating:
        value_template: "{{ is_state('luxtronik.id_web_wp_bz_akt', 'heating') }}"
        friendly_name: "Heizen"
  - platform: template
    sensors:
      hot_water:
        value_template: "{{ is_state('luxtronik.id_web_wp_bz_akt', 'hot water') }}"
        friendly_name: "Warmwasser"
  - platform: template
    sensors:
      solar_pumpe:
        value_template: "{{ is_state('luxtronik.id_web_slpout', 'on') }}"
        friendly_name: "Solarladepumpe"
  - platform: template
    sensors:
      evu_sperre:
        value_template: "{{ is_state('luxtronik.id_web_wp_bz_akt', 'evu') }}"
        friendly_name: "EVU"
  - platform: template
    sensors:
      verdichter:
        value_template: "{{ is_state('luxtronik.id_web_vd1out', 'on') }}"
        friendly_name: "Verdichter"        

That’s not the same issue, that’s an issue with that custom integration (luxtronik). Check if there’s an update for it.

Hi i’m having an issue trying to figure out how to change this automation, but keep coming up to a dead end, and i have several automation like this as well that need changing, any help would be much appreciated


#################################################################
## Automation Lights
#################################################################


  - alias: Motion Sensor Lights On
    trigger:
      platform: state
      entity_id: binary_sensor.presence_5
      to: 'on'
    condition:
      condition: numeric_state
      entity_id: sensor.lightlevel_2 
      below: 20
    action:
      service: homeassistant.turn_on
      entity_id: light.hallway_light
      data:
        transition: 2  


  - alias: Motion Sensor Lights Off
    trigger:
      - platform: state
        entity_id: binary_sensor.presence_5
        to: 'off'
        for:
          minutes: 3
    action:
      - service: homeassistant.turn_off
        entity_id: light.hallway_light
        data:
          transition: 5

I have this template

###########################################################################################
# SENSOR TEMPLATE
# https://www.home-assistant.io/integrations/template/
###########################################################################################
---
platform: template
sensors:
  github_milight_hub_version:
    entity_id: sensor.date
    value_template: "{{ (states.sensor.github_milight_hub.attributes['latest_release_tag']) }}"

  github_espeasy_version:
    entity_id: sensor.date
    value_template: "{{ (states.sensor.github_espeasy.attributes['latest_release_tag']) }}"

The entity is used when its 00:00:00 to new day then sensor will be updated.
If I remove it, how can I let update this sensor then?

by using a similar format to what I wrote above:

platform: template
sensors:
  github_espeasy_version:
    value_template: >
      {% set update = states('sensor.date') %}
      {{ (states.sensor.github_espeasy.attributes['latest_release_tag']) }}

But be aware that it should also update when the sensor.github_espeasy changes too.

1 Like

That doesn’t need to change. The errors in your log will point to a section, like ‘binary_sensor’, or ‘sensor’. entity_id is not deprecated in automations.

1 Like