Trying to track down a log error

Running Hassio 0.105.5 on an I3 with Ubuntu 18.04.4 LTS and docker.

I have been trying to track down this error in my logs.

2020-02-27 19:43:57 ERROR (MainThread) [homeassistant.helpers.condition] Error during template condition: UndefinedError: 'None' has no attribute 'state'

I tried adding the following in logger:

logger:
  default: warning
  logs:
     homeassistant.helpers.condition: debug

But this does not seem to work as I do not see anything additional in the log. Suggestions please!

Thanks Matt

One of your automations has a template condition which contains an entity that was unavailable at the moment the error occured.
I assume you are using this notation in your templates states.sensor.temperature.state, instead of this states(‘sensor.temperature’). It is strongly advised to use the second notation, this should also remove errors like the one you got. Check the warning in the templating docs for more info.

So, it looks like my DarkSky MQTT publishers are at fault…

- id: "Broadcast Real Temp MQTT"
  alias: 'Broadcast Real Temp MQTT'
  trigger:
    - platform: time_pattern
      minutes: '/3'
#      seconds: '0'
  action:
    service: mqtt.publish
    data_template:
      payload_template: '{{ states.sensor.dark_sky_temperature.state }}'
      topic: 'Real'

So the proper way to fix this would be:

 payload_template: '{{ states ('sensor.dark_sky_temperature') }}'

Is that correct?

Almost, remove the space between states and the brackets and make the double quotes outside the curly brackets.

So, I have corrected all of the automations in the folder that were built this way. Upon reboot, I still get this error message. I have the alexa integration and am trying to get the nws custom component working and it appears that automations used in it are built this way as well. I am not sure that I want to try and fix that while trying to get them working. I tracked them down via grep state.sensor * in my automation directory.