Closed RodneyCapron closed 4 years ago
I have similar errors message and looking at the MQTT Sensor documentation again, it seems like you (we) may not need the template entry. It is optional and it's used to extract or modify the value retrieved from the topic using a template. The value_json part tells it to extract the status key from a json payload.
Using an MQTT snooping app, I see that the value devstatOK is directly posted to the state topic and it's not in json format. You could try changing value_json.status to just value.status. Or, I think it can be removed altogether. I will have to try that myself.
There are several json_attributes configuration entries so this template entry may be a holdover from when the status was written as a json payload directly to the topic.
Yes, I confirmed that removing value_template: "{{ value_json.status }}" from my configuration does not does not affect the operation of my door sensors. I also see no more errors related to value_json.
Hello @digitalcraig,
Awesome! Thank you so much for the quick response and the easy fix. :) Everything is working perfectly now.
Thanks again and I hope you and your family are safe and healthy.
All the best, Rodney
Good Morning Haruny,
I have been using this ADT Pulse component for close to a year now and it has been working flawlessly (for Arming and Disarming the system through HomeKit), thank you for that! :)
I recently decided to add in my sensors (door, window and motion) to Home Assistant and HomeKit. Everything is working as expected but it seems to be throwing thousands (around 10k per day) of errors and filling up the error logs. Please see below for an example of what I am seeing:
9:03:33 AM – helpers/template.py (ERROR) - message first occurred at 7:38:14 AM and shows up 7536 times
2020-03-29 11:56:45 ERROR (MainThread) [homeassistant.helpers.template] Error parsing value: 'value_json' is undefined (value: devStatOK, template: {{ value_json.status }}) 2020-03-29 11:56:50 ERROR (MainThread) [homeassistant.helpers.template] Error parsing value: 'value_json' is undefined (value: devStatMotion, template: {{ value_json.status }})
Below is a copy of my configuration (running Home Assistant 0.107.7):
Enable ADT System Sensors
binary_sensor:
platform: mqtt name: "Garage Exterior Door" state_topic: "adt/zone/Back Garage Door/state" payload_on: "devStatOpen" payload_off: "devStatOK" device_class: "door" value_template: "{{ value_json.status }}"
platform: mqtt name: "Kitchen Door & Window Sensors" state_topic: "adt/zone/Interior Garage Door/state" payload_on: "devStatOpen" payload_off: "devStatOK" device_class: "door" value_template: "{{ value_json.status }}"
platform: mqtt name: "Living Room Door & Window Sensors" state_topic: "adt/zone/Living Door Window/state" payload_on: "devStatOpen" payload_off: "devStatOK" device_class: "door" value_template: "{{ value_json.status }}"
platform: mqtt name: "Perimeter Door & Window Sensors" state_topic: "adt/zone/Kitchen Door Window/state" payload_on: "devStatOpen" payload_off: "devStatOK" device_class: "door" value_template: "{{ value_json.status }}"
platform: mqtt name: "Sunroom Window Sensors" state_topic: "adt/zone/Exterior Patio Door/state" payload_on: "devStatOpen" payload_off: "devStatOK" device_class: "window" value_template: "{{ value_json.status }}"
platform: mqtt name: "Hall Motion Sensor" state_topic: "adt/zone/Upstairs Motion 1/state" payload_on: "devStatMotion" payload_off: "devStatOK" device_class: "motion" value_template: "{{ value_json.status }}"
platform: mqtt name: "Garage Motion Sensor" state_topic: "adt/zone/Garage Motion/state" payload_on: "devStatMotion" payload_off: "devStatOK" device_class: "motion" value_template: "{{ value_json.status }}"
platform: mqtt name: "Living Room Motion Sensors" state_topic: "adt/zone/Family Room Motion/state" payload_on: "devStatMotion" payload_off: "devStatOK" device_class: "motion" value_template: "{{ value_json.status }}"
Any ideas on what might be causing this? I have replaced single quotes with double quotes, etc, etc. with no luck. I figure that I must have done something incorrectly with my configuration.
Thanks again for all your hard work on this, I really appreciate it! :)
All the best, Rodney