#I'm not sure how to post a screenshot
1 messages · Page 1 of 1 (latest)
Do you use Docker Desktop?
Install Docker Desktop. Make sure you have installed this extension in VS Code: https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers
Yes on Docker for Desktop, let me check the extension.
Yes the Dev Containers extension is installed. I'll update it quick.
Same result.
Try to copy last few lines of console output
Maybe this is easier? I pasted the whole log into a gist. https://gist.github.com/TonyBrobston/dabbfb73d9716cd2114be201f64cee5e
1.008 WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1002)'))': /simple/github3-py/
this is the error.
also 9.253 Could not fetch URL https://pypi.org/simple/github3-py/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/github3-py/ (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1002)'))) - skipping
It seems like the docker have no access to internet? That is strange behavior
On first you need to import openssl to container when you are creating one.
Sorry, just now seeing this message.
I'll try to investigate. I guess I'll read the errors more closely next time; I agree it seems like it can't fetch https://pypi.org/simple/github3-py/.
Yes, I it seems that problem will be in SSL certificate. So there is no openssl library in the container?
So one thing I hadn't thought of, this is my work machine. I spoke with a coworker and he mentioned having similar problems. They use a tool called zscaler. I'm not sure exactly what it does, but it definitely causes us pain often. I doubt there is a way around it, short of trying to run an OS from a thumb drive or something. Is it feasible to run a regular docker container and volume mount the integration I'm developing in? I played around with that for awhile last night and it seems the biggest pain is in running these home assistant (or hass?) scripts. If I have the integration in /config/custom_integrations these scripts are not available. But if I have my integration in /usr/src/homeassistant/homeassistant/components and run a script from /usr/src/homeassistant the script is available. Though, if I try to scaffold an integration, it complains that /usr/src/homeassistant/tests is not a directory; I assume this is because I'm running a "production" version of home assistant and maybe I need a different docker image? https://github.com/TonyBrobston/hvac_zoning_integration
If my intergration is in /config/custom_integrations, I can find it under + Add Integration, but if it is in /usr/src/homeassistant/homeassistant/components, I cannot find it in + Add Integration. I'm pretty confused as to why that is.
Though it looks like if I volume mount my integration into both /config/custom_integrations and /usr/src/homeassistant/homeassistant/components, I can get both the integration to show up in + Add Integration as well as execute scripts from /usr/src/homeassistant. Feels hacky, but is the best workflow I can find so far. Dev Containers and VS Code seem great, but the extra layer of abstraction (running the container and it not being clear how to manage that container and how to separate my integration to push to a github repo) is causing me more confusion/harm than it is adding value.
as you have version: in your manifest.json that singals you have to use config/custom_components. If you dont have version: xxxx in mainfest - that menas it is intended for core componetnt in /usr/src/homeassistant/components
If you have Dev Container, you are runnig HA in the venv. So, in Container you will run translations build, then ha server.
Also in containters scripts works fine without any configuration.
And if you are developing integration for your self, you want to develop under /config/custom_integration
Oh ok, I didn't realize that, but that makes sense. When I scaffolded my integration from /usr/src/homeassistant the manifest.json did not have a version; I manually added it.
When you say Dev Container, is that homeassistant/home-assistant:dev docker image?
yes it is :dev docker image
Cool, I'll swap to that.
The hope is to eventually have this in the regular components, non-custom. But, we are a long ways from that point; so it seems a custom component makes sense at least for now.
Thank you for your help, I appreciate it!
I tyried to make core compenent, but there was so much chanlanges, that I revert to custom component. In core component, I was waiting 3 month to just get PR checked :/
Oof......
While bulding core component it is very strict to follow rules. Custom component is easy to write 🙂
I spun up the homeassistant/home-assistant:dev container and tried to run python3 -m script.translations develop from /config and I get /usr/local/bin/python3: Error while finding module specification for 'script.translations' (ModuleNotFoundError: No module named 'script').
But you can revert to core integration while you have your custom done.
Do I need to run it from a different location?
I think you dont have to run translations while in custom component
Oh...
HA will look for strings.json in components directory
Any idea how you scaffold a custom component?
I tried python3 -m script.scaffold integration from /config and get essentially the same result.
Some of this stuff is just odd. When I try to scaffold from the /usr/src/homeassistant directory, I get an error saying that test/components does not exist; if I manully create that path, it creates the component, but also has some errors at the end:
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "/usr/src/homeassistant/script/scaffold/__main__.py", line 117, in <module>
sys.exit(main())
^^^^^^
File "/usr/src/homeassistant/script/scaffold/__main__.py", line 70, in main
subprocess.run(["python", "-m", "script.hassfest"], **pipe_null, check=True)
File "/usr/local/lib/python3.12/subprocess.py", line 571, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['python', '-m', 'script.hassfest']' returned non-zero exit status 1.
you are trying on your running version of HA? Or did you clone new one?
I am running the homeassistant/home-assistant:dev on this M1. It is just the docker-compose running that is in the github that I linked above.
and this is run in venv?
Ok I will tell you, how I would do this from the beginig if you do not want to use containter.
make some directory for new homeassistant instance.
mkdir ~/HA.dev
cd ~/HA.dev
fork core repository of HA on git hub: https://github.com/home-assistant/core
then on your terminal git clone https://github.com/yourNameOnGit/yourForkNameOfHaDev.git
cd core
git remote add upstream https://github.com/home-assistant/core.git
then you have to install requirements scritp/setup
after you have all requirements installed, you can acvivat your virtual environment: source venv/activate
now you are in viratual environment for Home Assistant dev
you can try to run home assistant: hass -c config
and you can now run python3 -m script.scaffold