#I'm not sure how to post a screenshot

1 messages · Page 1 of 1 (latest)

violet gull
#

Do you use Docker Desktop?

formal hazel
#

Yes on Docker for Desktop, let me check the extension.

#

Yes the Dev Containers extension is installed. I'll update it quick.

#

Same result.

violet gull
#

Try to copy last few lines of console output

formal hazel
violet gull
#

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

violet gull
#

On first you need to import openssl to container when you are creating one.

formal hazel
#

Sorry, just now seeing this message.

violet gull
formal hazel
#

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.

violet gull
#

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

formal hazel
formal hazel
violet gull
#

yes it is :dev docker image

formal hazel
#

Cool, I'll swap to that.

formal hazel
#

Thank you for your help, I appreciate it!

violet gull
#

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 :/

formal hazel
#

Oof......

violet gull
#

While bulding core component it is very strict to follow rules. Custom component is easy to write 🙂

formal hazel
#

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').

violet gull
#

But you can revert to core integration while you have your custom done.

formal hazel
#

Do I need to run it from a different location?

violet gull
#

I think you dont have to run translations while in custom component

formal hazel
#

Oh...

violet gull
#

HA will look for strings.json in components directory

formal hazel
#

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.
violet gull
#

you are trying on your running version of HA? Or did you clone new one?

formal hazel
#

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.

violet gull
#

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

#

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