I have (I think) created an MQTT sensor to return the direction of car travel along a driveway:
mqtt:
sensor:
- name: driveway_car_direction
state_topic: "frigate/events"
value_template: >-
{% if (states(payload_json["before"]["current_zones"] == "right") AND (states(payload_json["before"]["entered_zones"]) == "middle") %}
arriving
{% if (states(payload_json["before"]["current_zones"] == "left") AND (states(payload_json["before"]["entered_zones"]) == "middle") %}
leaving
{% else %}
false
{% endif %}
Three zones are defined for the camera:
- right
- middle
- left
However, the sensor doesn’t show up in dev tools and I’m stuck as to why. It passes config check OK.
Any ideas?
I should add that I’m a bit of a novice with templating!