#Moving a cronjob to hass
1 messages · Page 1 of 1 (latest)
Depending on what your script is doing, an automation using a time trigger or time pattern trigger sounds like it could be a good match.
it's scraping a website and using those imports: bs4, requests, pprint, re, urllib3, urllib.parse, logging, sys
the time pattern trigger could work. So I put the script somewhere on the hass filesystem and then use the shell integration?
can I create a venv and install modules?
Yeah the shell command integration could be an option.
There are also some python specific integrations that might be worth looking into. The python scripts integration doesn't support imports, but it points at pyscript (a HACS custom integration) as an alternative which does.
I haven't used it myself, but it looks like it might do what you're looking for (minus use of venv). The docs have details on how to install additional packages.