AppDaemon - V4.3.0 CloudFlare+Reveres proxy

it was working perfectly (almost),
the issue must be relate to change i done is which changing the domain and setup with cloudflare + traefilk as reverse proxy(all http redirect to https).
so no longer accessing with local ip but domain name.

token confirm.

see before change:

  plugins:
    HASS:
      type: hass
      namespace: appdaemon-hass
      token: !secret appdaemon_token
      ha_url: http://192.168.1.112:8123
    MQTT:
      type: mqtt
      namespace: default
      client_host: !secret mqtt_broker

and now i update it to:

      ha_url: http://mydomain.com

AD keep throwing

2020-04-13 01:32:18.203939 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds

dashboard is accessible via localhost:5050 with no issue

If both AppDaemon and HomeAssistant are running locally, you should still be able to access Home Assistant using the Internal URL. You don’t want AppDaemon <–> HASS Traffic to go out to the internet and back again. That will slow your AppDaemon automation response times considerably.

Thanks Danial ,

I’m little confused ,
When i do inspect on the HA docker i get:
http://172.29.4.5:8123

And i can’t access it using the browser only by http://mydomain.com or https://mydomain.com,
AppDameond is not able to access both as they external to the server?
I changed the ha_url to use http://172.29.4.5:8123 instead and it does working fine,
but i have some concerns:

1.My router configure as 192.168.1.0/24 ,
The internal IP i see in HA (172.29.4.5) set by Docker ?
How can i define it permanently to specify IP so next reboot it wont change?
2.Is there an option to configure some internal DNS name to internal ip which are not belong to external network ?

as WA , till i find suitable solution from Traefik.
I assign static IP for HA by adding:

    networks:
      default:
        ipv4_address: 172.29.4.6

Does HA run on the same machine as AppDaemon? If so, did you try to put http://127.0.0.1:8123? If not, what is your config for the dashboard in appdaemon.yaml? Can you access the web interface from the machine running AppDaemon over http://192.168.1.112:8123?

Hi ,

I tried that - it didn’t work ,
The odd thing is when i enter to appdaemon docker and ping all working:

/usr/src/app # ping 127.0.0.1:8123
PING 127.0.0.1:8123 (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: seq=0 ttl=64 time=0.086 ms
64 bytes from 127.0.0.1: seq=1 ttl=64 time=0.122 ms

## this is HA docker ip
/usr/src/app # ping 172.29.4.6:8123
PING 172.29.4.6:8123 (172.29.4.6): 56 data bytes
64 bytes from 172.29.4.6: seq=0 ttl=64 time=0.257 ms
64 bytes from 172.29.4.6: seq=1 ttl=64 time=0.160 ms
64 bytes from 172.29.4.6: seq=2 ttl=64 time=0.123 ms
^C

from some reason it not able to connect with 127.0.0.1:8123 only with 172.29.4.6:8123

Do you run Home Assistant and AppDaemon in the same docker stack? Do you use docker-compose? If so, can you please post your docker-compose file?

Thanks
yes ,both on same stack ,
i also verify on same network

            },
       "7e2e28af81763a02a747c0000494ed2111111f9d0d07fa6d216b8206557": {
                "Name": "appdaemon_4",
                "EndpointID": "238538d4764b5365c04fb04b911111ba74644521ea64c083b98810",
                "MacAddress": "02:42:ac:1d:04:07",
                "IPv4Address": "172.29.4.7/22",
                "IPv6Address": ""
            },

            "ddeb91b86b0f57ed1b7e6cbfd2b8918a7704d33ff3a4fbdfd52a15e96276c138": {
                "Name": "HA",
                "EndpointID": "a94445c7909e604060bae8a2eb075666666666d3af280d29545aa7d1470",
                "MacAddress": "02:42:ac:1d:04:06",
                "IPv4Address": "172.29.4.6/22",
                "IPv6Address": ""

docker -compose:


 homeassistant:
    container_name: HA
    image: homeassistant/home-assistant:latest
    volumes:
      - /share/Avi/HA/:/config
      - /etc/localtime:/etc/localtime:ro
    restart: always
    ports:
      - 8123:8123    
    networks:
      default:
        ipv4_address: 172.29.4.6
    depends_on:
        - mosquitto
    labels:
      traefik.enable: true
      traefik.http.routers.hasss.rule: Host(`ha.${DOMAINNAME}`)
      traefik.http.routers.hasss.entrypoints: websecure
      traefik.http.services.hasss.loadbalancer.server.port: 8123

  

  appdaemon:
    build: 
      context: ./appdaemon4
      dockerfile: Dockerfile
    container_name: appdaemon_4
   # command: supervisord -n
    ports:
      - 5050:5050
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - ${PWD}/appdaemon4/config:/conf
    depends_on:
      - homeassistant
    restart: always

Hmm, from my limited knowledge I assume you can only do it like you did, with specifying a fixed IP for the HA container. I don’t know a anything about Traefik (I use NGINX), can you access HA through the IP of the host from any other device on your network?