Getting Error Message in Log, Not sure where to go to from here? v0.85.1

Hi All,

I’ve started getting the Following in the event log.

Log Details (ERROR)
Tue Jan 22 2019 21:21:58 GMT+1000 (Australian Eastern Standard Time)

Error doing job: Exception in callback <function EventBus.async_listen_once.<locals>.onetime_listener at 0x7f35abf6e400>
Traceback (most recent call last):
  File "uvloop/cbhandles.pyx", line 64, in uvloop.loop.Handle._run
  File "/usr/local/lib/python3.6/site-packages/homeassistant/core.py", line 620, in onetime_listener
    self._hass.async_run_job(listener, event)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/core.py", line 327, in async_run_job
    target(*args)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/binary_sensor/template.py", line 152, in template_bsensor_startup
    self.async_check_state()
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/binary_sensor/template.py", line 228, in async_check_state
    state = self._async_render()
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/binary_sensor/template.py", line 192, in _async_render
    state = (self._template.async_render().lower() == 'true')
  File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/template.py", line 138, in async_render
    return self._compiled.render(kwargs).strip()
  File "/usr/local/lib/python3.6/site-packages/jinja2/asyncsupport.py", line 76, in render
    return original_render(self, *args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/jinja2/environment.py", line 1008, in render
    return self.environment.handle_exception(exc_info, True)
  File "/usr/local/lib/python3.6/site-packages/jinja2/environment.py", line 780, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python3.6/site-packages/jinja2/_compat.py", line 37, in reraise
    raise value.with_traceback(tb)
  File "<template>", line 1, in top-level template code
TypeError: must be str, not int

This was just after trying to setup the Google Calender Component. I have since removed it but this has not cleared the error. I havent found what is not working, but I’m not even sure how to track this down :frowning:

Unfortunately my config is pretty big :slight_smile:

Any idea’s as to how to progress to rectify this one?

Thanks

Looks like a binary template sensor is causing it. What binary template sensors do you have?

Only one

  - platform: template
    sensors:
      gas_bottle_empty:
        friendly_name: "Gas Bottle Status"
        device_class: gas
        delay_off:
          minutes: 5
        value_template: >-
          {{ states('sensor.gas_monitor_red_channel')|float > (states('sensor.gas_monitor_green_channel')+1)|float }}

There’s your problem. You have the second float filter in the wrong place. Try this:

        value_template: >-
          {{ states('sensor.gas_monitor_red_channel')|float > states('sensor.gas_monitor_green_channel')|float+1 }}

That was it!

Thanks a Million. what in that error message pointed towards a binary sensor template issue so I can stop annoying people here (although, I havent found such a group of helpful people on a forum in over 20 years in the IT industry)

Thanks again

1 Like

File “/usr/local/lib/python3.6/site-packages/homeassistant/components/binary_sensor/template.py”, line 152, in template_bsensor_startup
self.async_check_state()
File “/usr/local/lib/python3.6/site-packages/homeassistant/components/binary_sensor/template.py”, line 228, in async_check_state
state = self._async_render()
File “/usr/local/lib/python3.6/site-packages/homeassistant/components/binary_sensor/template.py”, line 192, in _async_render
state = (self._template.async_render().lower() == ‘true’)

:slight_smile:

Doh!!!

Thanks :slight_smile:

1 Like