Giter VIP home page Giter VIP logo

Comments (2)

BeFygo avatar BeFygo commented on July 23, 2024 1

Thank you for the help.

I tried your suggestions and in the end it was just the foward slash / at the end of the address :D

from emhass.

GeoDerp avatar GeoDerp commented on July 23, 2024

I don't know if this helps but I just tried:

Home Assistant

# modified version of: https://www.home-assistant.io/installation/linux#install-home-assistant-container
# /test being my temp config directory
docker run -d -p 8123:8123  --name homeassistant -e TZ="Europe/Paris" -v $(pwd)/test:/config ghcr.io/home-assistant/home-assistant:stable

EMHASS

# copied config_emhass.yaml and secrets_emhass.yaml (from secrets_emhass(copy).yaml) into /test2
docker run -it -p 5000:5000 --network=host --name emhass-container -v $(pwd)/test2/config_emhass.yaml:/app/config_emhass.yaml -v $(pwd)/test2/secrets_emhass.yaml:/app/secrets_emhass.yaml davidusb/emhass-docker-standalone:latest

These docker runs are just minimal, your volume mounts may be different.

It is my understanding that the EMHASS container would need to have --network=host in order to access localhost. (Which I believe your already doing in your Docker compose)
Its my understanding that, by default, Docker runs its networking in bridge mode. A alternative method would be to obtain the Home Assistant bridged ip address and pass that into the EMHASS container. (In theory bypassing the need for network=host)

An example:

# grab the ip address of the running homeassistant
docker exec -it homeassistant ip addr

In my case it was 172.17.0.3 with eth0@if23 network interface, then pass this ip address into the EMHASS secrets.
secrets_emhass.yaml

# Use this file to store secrets like usernames and passwords.
# Learn more at https://home-assistant.io/docs/configuration/secrets/
hass_url: http://172.17.0.3:8123/
long_lived_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiI2Y2FkYWQwMTM4MWY0ODM4YTVhYmU3ZGQ1YmUxMzE0YyIsImlhdCI6MTcxODI4MDMzMywiZXhwIjoyMDMzNjQwMzMzfQ.EvfjVXS7KX15KrfATvzlIm06e-U0mXjDdSF0lm7V5_0
time_zone: Europe/Paris
lat: 45.83
lon: 6.86
alt: 4807.8
solcast_api_key: yoursecretsolcastapikey
solcast_rooftop_id: yourrooftopid
solar_forecast_kwp: 5

Note: you may need a foward slash / at the end of your address: http://localhost:8123 to http://localhost:8123/

Other than maybe obtaining another Long-lived access tokens token, and testing a new, I am not quite sure whats going on.

from emhass.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.