bilan / connectlife-api-connector

Connectlife API proxy / MQTT Home Assistant integration
67 stars 17 forks source link

Argument #1 ($host) must be of type string, null given #30

Closed BlackBeltPanda closed 3 months ago

BlackBeltPanda commented 4 months ago

Attempting to run this via docker, I receive the following error: https://pastebin.com/raw/syqdx5fw.

I'm using Compose to run the docker container and the MQTT host in this case is another docker container on the same docker network, so I'm referencing it via its container name: http://mosquitto. I also tried the IP of the machine, as well as "127.0.0.1", and hit the same error.

bilan commented 4 months ago

Paste your docker-compose file please.

BlackBeltPanda commented 4 months ago

Paste your docker-compose file please.

services:
  ha-connectlife-addon:
    container_name: ha-connectlife-addon
    image: "ha-connectlife-addon"
    build: "https://github.com/bilan/connectlife-api-connector.git"
    command: /bin/ash -c 'php artisan app:mqtt-loop'
    environment:
      CONNECTLIFE_LOGIN: ${CONNECT_USER}
      CONNECTLIFE_PASSWORD: ${CONNECT_PASS}
      MQTT_HOST: "http://mosquitto"
      MQTT_USER: ${MQTT_USER}
      MQTT_PASSWORD: ${MQTT_PASS}
      MQTT_PORT: 1883
      MQTT_SSL: false
      DEVICES_CONFIG: '{"117":{"t_work_mode":["fan only","heat","cool","dry","auto"],"t_fan_speed":{"0":"auto","5":"super low","6":"low","7":"medium","8":"high","9":"super high"},"t_swing_direction":["straight","right","both sides","swing","left"],"t_swing_angle":{"0":"swing","2":"bottom 1\/6 ","3":"bottom 2\/6","4":"bottom 3\/6","5":"top 4\/6","6":"top 5\/6","7":"top 6\/6"}}}'
    restart: unless-stopped
    networks:
      - mqtt
networks:
  mqtt:
    external: true
bilan commented 4 months ago

"http://mosquitto" is not correct host name. It can be "mosquitto" but too less information to be sure.

BlackBeltPanda commented 3 months ago

"http://mosquitto" is not correct host name. It can be "mosquitto" but too less information to be sure.

I also tried "mosquitto", "localhost", "127.0.0.1", and "172.27.0.1". but received the same error each time.

Edit: Adding the environment variable LOG_LEVEL: info to the compose file yields the following error, instead:

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service base-addon-banner: starting
/usr/lib/bashio/log.sh: line 107: info: unbound variable
s6-rc: warning: unable to start service base-addon-banner: command exited 1
/run/s6/basedir/scripts/rc.init: warning: s6-rc failed to properly bring all the services up! Check your logs (in /run/uncaught-logs/current if you have in-container logging) for more information.
/run/s6/basedir/scripts/rc.init: fatal: stopping the container.
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped
BlackBeltPanda commented 3 months ago

Didn't notice I was an update behind. Updated to v2.1.11 and everything seems to be working now. =)