It looks like it’s not possible to use datetime in pyhton scripts. I’m trying to run python_script from develeper tools but I’m getting KeyError: '__import__'
Are there any workaround for that? Or is something what I’m overlooking?
day = datetime.datetime.now().strftime("%A")
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/python_script/__init__.py", line 224, in execute
exec(compiled.code, restricted_globals)
File "hot_watter.py", line 1, in <module>
KeyError: '__import__'
I wanted to try write small script, but the first line is problem
File "hot_watter.py", line 1, in <module>
and I didn’t proceed in next steps. I tried some variants with that but without success. I have idea put the date as data if I call the service but that’s s*.