pbkhrv / rtl_433-hass-addons

Collection of Home Assistant add-ons that use rtl_433
217 stars 102 forks source link

rtl_433_mqtt_hass.py: error: argument -p/--port: invalid int value: 'null' #150

Closed M0LTE closed 8 months ago

M0LTE commented 1 year ago

The problem

I run Home Assistant and rtl_433 in Docker, and trying to run rtl_433_autodiscovery in another container. However something seems to be up with the parameters being passed to rtl_433_mqtt_hass.py:

rtl_433_autodiscovery    | [fix-attrs.d] applying ownership & permissions fixes...
rtl_433_autodiscovery    | [fix-attrs.d] done.
rtl_433_autodiscovery    | [cont-init.d] executing container initialization scripts...
rtl_433_autodiscovery    | [cont-init.d] done.
rtl_433_autodiscovery    | [services.d] starting services
rtl_433_autodiscovery    | [services.d] done.
rtl_433_autodiscovery    | Using an external mqtt broker.
rtl_433_autodiscovery    | curl: (6) Could not resolve host: supervisor
rtl_433_autodiscovery    | [18:47:56] ERROR: Something went wrong contacting the API
rtl_433_autodiscovery    | Starting rtl_433_mqtt_hass.py...
rtl_433_autodiscovery    | usage: rtl_433_mqtt_hass.py [-h] [-d] [-q] [-u USER] [-P PASSWORD] [-H HOST]
rtl_433_autodiscovery    |                             [-p PORT] [-r] [-f] [-R RTL_TOPIC]
rtl_433_autodiscovery    |                             [-D DISCOVERY_PREFIX] [-i DISCOVERY_INTERVAL]
rtl_433_autodiscovery    | rtl_433_mqtt_hass.py: error: argument -p/--port: invalid int value: 'null'
rtl_433_autodiscovery    | [cmd] /run.sh exited 2
rtl_433_autodiscovery    | [cont-finish.d] executing container finish scripts...
rtl_433_autodiscovery    | [cont-finish.d] done.
rtl_433_autodiscovery    | [s6-finish] waiting for services.
rtl_433_autodiscovery    | [s6-finish] sending all processes the TERM signal.
rtl_433_autodiscovery    | [s6-finish] sending all processes the KILL signal and exiting.
rtl_433_autodiscovery exited with code 2

My docker-compose.yml:

version: '3'
services:
  rtl_433_autodiscovery:
    container_name: rtl_433_autodiscovery
    image: ghcr.io/pbkhrv/rtl_433-hass-addons-rtl_433_mqtt_autodiscovery-aarch64
    environment:
      - MQTT_HOST=10.45.0.1
      - MQTT_PORT=1883

I have no supervisor in my setup, and I have my own standalone MQTT server, no auth. Is my setup supported?

What addon are you reporting the bug for?

rtl_433_mqtt_autodiscover

What is the addon version?

0.2.3

What type of MQTT Broker are you using?

Other (details in the bug description)

Addon log messages

No response

Additional information

No response

Sparticuz commented 1 year ago

I'm getting the same thing

varunsaravagi commented 1 year ago

I am getting the same thing

varunsaravagi commented 1 year ago

This is happening because the run.sh in the latest docker image doesn't contain the standalone docker code. The docker image needs to be updated to include the latest run.sh

deviantintegral commented 1 year ago

Is the addon version 0.2.3 above correct? That was a version for rtl_433, not the autodiscovery addon.

0.2.3 is now over a year old. Can you upgrade to the latest releases?

kristoficko commented 11 months ago

Same situation. Any ETA for a fix? Many thanks for the efforts!

Mike

deviantintegral commented 11 months ago

@kristoficko are you able to confirm the addon version? The original report is confusing that way.

I am hoping to look at this in the next week or two. Otherwise, help from others submitting and reviewing fixes is always appreciated!

kristoficko commented 11 months ago

I'm running HA as a docker container without Add-on support, so I'm also running autodiscovery directly as a container. Container repository: ghcr.io/pbkhrv/rtl_433-hass-addons-rtl_433_mqtt_autodiscovery-amd64 Tag: latest Image ID: 734fa2d3616f Image created: 19 months ago

Docker compose entry: `rtl_433_autodiscovery: container_name: rtl_433_autodiscovery image: ghcr.io/pbkhrv/rtl_433-hass-addons-rtl_433_mqtt_autodiscovery-amd64 environment:

Mike

deviantintegral commented 11 months ago

Ah! Can you instead set the image to run 0.6.0 with ghcr.io/pbkhrv/rtl_433-hass-addons-rtl_433_mqtt_autodiscovery-amd64:0.6.0. I think our automation isn't pushing latest images at all, which is why that date is 19 months old.

Sparticuz commented 11 months ago

looks like it's working!

kyle@bently 12:56:56 ~/docker on master [?] $ sudo docker logs docker-rtlha-1 -f
s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started
Running in stand-alone docker mode
Starting rtl_433_mqtt_hass.py...
WARNING:root:User or password is not set. Check credentials if subscriptions do not return messages.
INFO:root:Discovering all devices
INFO:root:MQTT connected: Connection Accepted.
INFO:root:Subscribing to: rtl_433/+/events
INFO:root:Published Ambientweather-F007TH/1/70: time, channel, battery_ok, temperature_F, humidity
INFO:root:Published Ambientweather-F007TH/3/58: time, channel, battery_ok, temperature_F, humidity
kristoficko commented 11 months ago

Issue resolved here as well when specifying docker image version as 0.6.0.

Many thanks!