…to run a BeautifulSoup-based python script on the Win10 machine. This spits out JSON which subsequently gets parsed into a few sensors and works a treat.
… the only difference being that this web scrape is based on Selenium (also spits out JSON).
I can post the python code if necessary, but am curious what I’m overlooking. Both scripts run fine from the Windows 10 command line, so it doesn’t appear to be a library, path, or access issue for Selenium. However, when run from HA, the first script comes back with all its data just fine, while the second just comes back with “unknown” as the sensor value and no attributes to speak of.
Seems like inconsistent behavior to me, but this is WAY above my pay grade , and clearly I’m missing something. Any help much appreciated!
Logger: homeassistant.components.command_line.sensor
Source: components/command_line/sensor.py:122
Integration: command_line (documentation, issues)
First occurred: 1:22:54 PM (1 occurrences)
Last logged: 1:22:54 PM
Empty reply found when expecting JSON data
Wish I could be of more help. Clearly the python script isn’t running properly, and I don’t (yet) have the expertise to troubleshoot. It does remain bizarre to me, however, that I can run it manually without problem (like several of my other working scripts) but have it fail so spectacularly with the command line platform.
Keep in mind HA is running in a docker container inside a VM.
Obviously, the environment is not the same as running you script directly under windows…
Unfortunately, HAOS is very closed, so your debugging options are extremely limited.
Ideally, you’d docker exec -it <container> /bin/bash inside the HA container and run the script from there for more deatiled error messages…
Thanks again for the help – this is definitely an area I’ll need to dig into a bit more.
For now, I’ve just implemented an ugly workaround – the windows task scheduler running the python script that dumps a JSON file where HA can access it. Will revisit again when I’ve a bit more confidence working around the lower levels of HA.