Hello guys, im new.
Sorry if i don’t post it in the right topic.
I have a question about if this is possible?
Can i use variables to call a file in the YAML config?
like this :
camera:
- platform: local_file
file_path: "{{ states('sensor.ai_front_image') }}"
- sensor.ai_front_image contains the location of the image received from mqtt (/local/images/Front.jpg)
this was to test if i can use this variable to show the picture, but did not work.
What i would like to achieve is this:
- ('sensor.ai_front_name') contains the name like: Front
- ('sensor.ai_front_date') contains date like: 9-8-2021
- ('sensor.ai_front_time') contains time like: 12:01
The image that i put in the folder by detecting a person used by a different server with the AI plugin of blueiris.
it saves the image in /local/images directory of HASS, like this : Front-TIME-DATE.jpg
How can i let it read the file everytime it changes the filename?
camera:
- platform: local_file
file_path: "{{ states('sensor.ai_front_name') }}{{ states('sensor.ai_front_time') }}{{ states('sensor.ai_front_date') }}"
If i copy the filepath into the template tester it prints out perfectly…
Regards and many thanks.