robmarkcole / HASS-plate-recognizer

Read number plates with https://platerecognizer.com/
128 stars 25 forks source link

Unable to configure to work with license plates starting with a number #35

Open mlhyyl opened 3 years ago

mlhyyl commented 3 years ago

Hi,

In Turkey, our license plates start with numbers.

Unfortunately, HA will protest when I feed in the code below and click Check configuration. 82ab123 causes the problem.

value_template: "{{ state_attr('image_processing.platerecognizer', 'watched_plates').82ab123 }}"

Is there a workaround to this situation?

robmarkcole commented 3 years ago

Not sure, sounds like a generic HA question, can you ask on the forums?

groues commented 3 years ago

Here is my workaround for the sensor: value_template: > {{ state_attr("image_processing.platerecognizer_door", "watched_plates")["82ab123"] }} This is because variables names cannot start with a number.

lowgoz commented 3 years ago

Here is my workaround for the sensor: value_template: > {{ state_attr("image_processing.platerecognizer_door", "watched_plates")["82ab123"] }} This is because variables names cannot start with a number.

this needs to be added to the readme - ill do it when i have a moment unless someone else has time?

shanem2004 commented 3 years ago

this needs to be added to the readme - ill do it when i have a moment unless someone else has time?

I just added it.