Git Product home page Git Product logo

Comments (12)

Jasper-itsme avatar Jasper-itsme commented on September 6, 2024 1

Had a look but did not find anything odd in regards to the configuration code. Besides that, the error is stating that the sensor template received an incorrect input, ' unknown' . This seems to say that your sensor or input value generated by the code on your ESP is providing a bad value. Perhaps you can trace back the steps you did there?

Additionally: which ESP and sensor are you using?
I`m using the R503 sensor together with a Wemos d1 mini. Ended up with using a script from another author based on the EverythingSmartHome source code.

from fingerprint-mqtt.

Itayabram avatar Itayabram commented on September 6, 2024

hi i tried using your code, I keep getting an error in the logs
can you help? thanks

Logger: homeassistant.helpers.event
Source: helpers/template.py:425
First occurred: 14:01:59 (1 occurrences)
Last logged: 14:01:59

Error while processing template: Template("{% if states('sensor.fingerprint_id') | int >= 1 %} {%- set printid = states('sensor.fingerprint_id') | int -%} {%- set prints = states("input_text.fingerprint_data") | from_json if states("input_text.fingerprint_data") else [] -%} {%- set fingerprint = prints|selectattr('id', 'eq', states('sensor.fingerprint_id') | int) | first -%} {{fingerprint["name"]}} {% elif is_state('sensor.fingerprint', 'Waiting') %} Waiting {% elif is_state('sensor.fingerprint', 'Not matched') %} Not matched {% endif %}")
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 423, in async_render
render_result = _render_with_context(self.template, compiled, **kwargs)
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1942, in _render_with_context
return template.render(**kwargs)
File "/usr/local/lib/python3.10/site-packages/jinja2/environment.py", line 1301, in render
self.environment.handle_exception()
File "/usr/local/lib/python3.10/site-packages/jinja2/environment.py", line 936, in handle_exception
raise rewrite_traceback_stack(source=source)
File "", line 1, in top-level template code
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1729, in forgiving_int_filter
raise_no_default("int", value)
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1411, in raise_no_default
raise ValueError(
ValueError: Template error: int got invalid input 'unknown' when rendering template '{% if states('sensor.fingerprint_id') | int >= 1 %}
{%- set printid = states('sensor.fingerprint_id') | int -%}
{%- set prints = states("input_text.fingerprint_data") | from_json if states("input_text.fingerprint_data") else [] -%}
{%- set fingerprint = prints|selectattr('id', 'eq', states('sensor.fingerprint_id') | int) | first -%}
{{fingerprint["name"]}}
{% elif is_state('sensor.fingerprint', 'Waiting') %}
Waiting
{% elif is_state('sensor.fingerprint', 'Not matched') %}
Not matched
{% endif %}' but no default was specified

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 540, in async_render_to_info
render_info._result = self.async_render(variables, strict=strict, **kwargs)
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 425, in async_render
raise TemplateError(err) from err
homeassistant.exceptions.TemplateError: ValueError: Template error: int got invalid input 'unknown' when rendering template '{% if states('sensor.fingerprint_id') | int >= 1 %}
{%- set printid = states('sensor.fingerprint_id') | int -%}
{%- set prints = states("input_text.fingerprint_data") | from_json if states("input_text.fingerprint_data") else [] -%}
{%- set fingerprint = prints|selectattr('id', 'eq', states('sensor.fingerprint_id') | int) | first -%}
{{fingerprint["name"]}}
{% elif is_state('sensor.fingerprint', 'Waiting') %}
Waiting
{% elif is_state('sensor.fingerprint', 'Not matched') %}
Not matched
{% endif %}' but no default was specified

from fingerprint-mqtt.

Jasper-itsme avatar Jasper-itsme commented on September 6, 2024

from fingerprint-mqtt.

Itayabram avatar Itayabram commented on September 6, 2024

yes thank you, I just deleted tokens and passwords. uploaded it as txt file
configuration.txt

from fingerprint-mqtt.

Itayabram avatar Itayabram commented on September 6, 2024

I will try to trace back as you said.
I'm using wemos d1 mini + R503, exactly the same as you.
Which script did you use?
Thanks again

from fingerprint-mqtt.

Jasper-itsme avatar Jasper-itsme commented on September 6, 2024

This is what I have implemented and is working with the mentioned hardware:
Fingerprints-reader-R503---R502-esp8266-mqtt-Home-Assistant
I used the lovelace_standard view. Also please note that you also have to replace the mqtt part in configuration.yaml.
Remove:

  - platform: mqtt
    name: "Fingerprint"
    state_topic: "/fingerprint/mode/status"
    value_template: "{{value_json.state}}"
    json_attributes_topic: "/fingerprint/mode/status"
    json_attributes_template: "{{value_json | tojson}}"

Add:

#Fingerprint mqtt topic
mqtt:
  sensor:
    - name: "Fingerprint"
      state_topic: "/fingerprint/mode/status"
      value_template: "{{value_json.state}}"
      json_attributes_topic: "/fingerprint/mode/status"
      json_attributes_template: "{{value_json | tojson}}"

As said, the code is based on the EverythingSmartHome source code.

from fingerprint-mqtt.

Itayabram avatar Itayabram commented on September 6, 2024

ok im starting to make a progress here.
now when i go to the arduino ide and try to verify the file i get this error:

exit status 1
Compilation error: 'class Adafruit_Fingerprint' has no member named 'led_control'

at the original sketch i didn't get any errors.
can i just use the original sketch?

from fingerprint-mqtt.

Itayabram avatar Itayabram commented on September 6, 2024

oh just figured it out, the ide automatically updated the adafruit library.
disabled it and now it's ok!
thank a lot my friend

from fingerprint-mqtt.

Jasper-itsme avatar Jasper-itsme commented on September 6, 2024

You`re welcome. In case you are still wondering: the "lovelace_standard" code can be pasted in the yaml editor of the dashboard.

from fingerprint-mqtt.

unseemlycoder avatar unseemlycoder commented on September 6, 2024

Hey, do take a look at PR #20 on this repo if you're looking for a sketch with finger.LEDcontrol() for R503+ESP32.
I've added a set number of colored led blinks for different error messages and successful scans.

It's a strong community, thank you all!
Edit: Typo

from fingerprint-mqtt.

unseemlycoder avatar unseemlycoder commented on September 6, 2024

Opened PR #22 for consideration.

from fingerprint-mqtt.

unseemlycoder avatar unseemlycoder commented on September 6, 2024

Fix has been merged; can we move to close issue?

from fingerprint-mqtt.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.