Comments (12)
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.
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.
from fingerprint-mqtt.
yes thank you, I just deleted tokens and passwords. uploaded it as txt file
configuration.txt
from fingerprint-mqtt.
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.
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.
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.
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.
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.
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.
Opened PR #22 for consideration.
from fingerprint-mqtt.
Fix has been merged; can we move to close issue?
from fingerprint-mqtt.
Related Issues (17)
- unknown error HOT 2
- relay HOT 1
- Not getting it to work with Oled HOT 7
- Connecting a relay to work with solenoid HOT 3
- ESP01 not booting with his code. HOT 2
- Fingerprint matched but unavailable name HOT 9
- Support for R503 FPS and watchdog HOT 4
- Communication error HOT 3
- R503 fingerprint - working script for esp HOT 2
- Reboot regulary HOT 3
- (oled)automations.yaml dosent work
- Home assistant and the name of id HOT 4
- esp_task_wdt.h no such file or directory HOT 4
- 2nd Sensor
- No createModel in class Adafruit_Fingerprint HOT 1
- MQTT - learning HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fingerprint-mqtt.