Not Sure how to fix " no entity ids configured to track nor were we able to extract the entities to track from the value template(s)" Error in this Situation

Hi All,
Hoping you can help me :slight_smile:
I’m using Sparkydave’s Garden Irrigation Package with a few (Read Lots) of modifications…

Its generating the following in the logs :-

2019-02-01 19:41:26 WARNING (MainThread) [homeassistant.components.sensor.template] Template sensor retic_program1_watering_day has no entity ids configured to track nor were we able to extract the entities to track from the value template(s). This entity will only be able to be updated manually.
2019-02-01 19:41:26 WARNING (MainThread) [homeassistant.components.sensor.template] Template sensor retic_program2_watering_day has no entity ids configured to track nor were we able to extract the entities to track from the value template(s). This entity will only be able to be updated manually.

The pertinent bit of the Package is :

 - platform: template    # determine if today is selected as a watering day for program 1
    sensors:
      retic_program1_watering_day:
        value_template:  >
          {% set sensor_names = [ 'monday', 'tuesday', 'wednesday','thursday','friday','saturday','sunday'] %}
          {% set today_name = sensor_names[now().weekday()] %}
          {% set entity_id = 'input_boolean.retic_program1_'+today_name %}
          {{ is_state(entity_id, 'on') }}

      retic_program2_watering_day:
        value_template:  >
          {% set sensor_names = [ 'monday', 'tuesday', 'wednesday','thursday','friday','saturday','sunday'] %}
          {% set today_name = sensor_names[now().weekday()] %}
          {% set entity_id = 'input_boolean.retic_program2_'+today_name %}
          {{ is_state(entity_id, 'on') }} 

Looking at this, I’m guessing I need to specify the entity_id as HASS cant automatically work it out. Funnily enough, neither can I.

For the full config if anything needs clarification, have a look here :slight_smile:
https://github.com/knottyau75/Home-assistant

As the entity_id is part of the Jinga template, I’ve got no idea how to fix this?

Any Idea’s?? Or should I work out a different way to trigger the watering??

Thanks all!

platform: template    # determine if today is selected as a watering day for program 1
    sensors:
      retic_program1_watering_day:
        value_template:  >
          {% set sensor_names = [ 'monday', 'tuesday', 'wednesday','thursday','friday','saturday','sunday'] %}
          {% set today_name = sensor_names[now().weekday()] %}
          {% set entity_id = 'input_boolean.retic_program1_'+today_name %}
          {{ is_state(entity_id, 'on') }}
      entity_id:
        - input_boolean.retic_program1_monday
        - input_boolean.retic_program1_tuesday
        - input_boolean.retic_program1_wednesday
        - input_boolean.retic_program1_thrusday
        - input_boolean.retic_program1_friday
        - input_boolean.retic_program1_saturday
        - input_boolean.retic_program1_sunday

      retic_program2_watering_day:
        value_template:  >
          {% set sensor_names = [ 'monday', 'tuesday', 'wednesday','thursday','friday','saturday','sunday'] %}
          {% set today_name = sensor_names[now().weekday()] %}
          {% set entity_id = 'input_boolean.retic_program2_'+today_name %}
          {{ is_state(entity_id, 'on') }} 
      entity_id:
        - input_boolean.retic_program2_monday
        - input_boolean.retic_program2_tuesday
        - input_boolean.retic_program2_wednesday
        - input_boolean.retic_program2_thrusday
        - input_boolean.retic_program2_friday
        - input_boolean.retic_program2_saturday
        - input_boolean.retic_program2_sunday

You are using my old code. That section now looks like this:

sensor:
  - platform: template    # determine if today is selected as a watering day for program 1
    sensors:
      retic_program1_watering_day:
        entity_id: input_boolean.retic_program1_monday, input_boolean.retic_program1_tuesday, input_boolean.retic_program1_wednesday, input_boolean.retic_program1_thursday, input_boolean.retic_program1_friday, input_boolean.retic_program1_saturday, input_boolean.retic_program1_sunday
        value_template:  >
          {% set sensor_names = [ 'monday', 'tuesday', 'wednesday','thursday','friday','saturday','sunday'] %}
          {% set today_name = sensor_names[now().weekday()] %}
          {% set entity_id = 'input_boolean.retic_program1_'+today_name %}
          {{ is_state(entity_id, 'on') }}

      retic_program2_watering_day:
        entity_id: input_boolean.retic_program2_monday, input_boolean.retic_program2_tuesday, input_boolean.retic_program2_wednesday, input_boolean.retic_program2_thursday, input_boolean.retic_program2_friday, input_boolean.retic_program2_saturday, input_boolean.retic_program2_sunday
        value_template:  >
          {% set sensor_names = [ 'monday', 'tuesday', 'wednesday','thursday','friday','saturday','sunday'] %}
          {% set today_name = sensor_names[now().weekday()] %}
          {% set entity_id = 'input_boolean.retic_program2_'+today_name %}
          {{ is_state(entity_id, 'on') }}

I also now use some parameters to see if its likely to rain, or if it has already rained, and depending on sliders to adjust ‘acceptable rain’ values, the irrigation will not run that day. But it sounds like you have the rest sorted. Glad to see someone using some of my code :slight_smile:

1 Like

Thanks Mate,

Its working great. Much Appreciated.

Knotty