I use the latest docker ( * Core 2025.4.0 * Frontend 20250401.0) but without network_mode: host, because homeassistant (http://homeassistant.dockerbox.local) and raspberrymatic (http://raspberrymatic.dockerbox.local/) run on the same host behind a traefic reverse proxy.
they are also in the same docker network.
If I connect to the homeassistant docker and run the rest call via curl (I have to escape & and ?) there it works, but not via the rest platform (even with escaping).
curl http://raspberrymatic.dockerbox.local/addons/xmlapi/state.cgi\?sid=my_token\&device_id=2679
<?xml version='1.0' encoding='ISO-8859-1' ?><state><device name='HM-ES-PMSw1-Pl-DN-R1 OEQ0572643' ise_id='2679' unreach='false' sticky_unreach='false' config_pending='false' ><channel name='HM-ES-PMSw1-Pl-DN-R1
the error is:
# container start
2025-04-04 21:09:28.161 DEBUG (MainThread) [homeassistant.components.rest.data] Updating from http://raspberrymatic.dockerbox.local/addons/xmlapi/state.cgi?sid=my_token&device_id=2679
2025-04-04 21:09:28.166 WARNING (MainThread) [homeassistant.components.sensor] Platform rest not ready yet: [Errno -2] Name does not resolve; Retrying in background in 30 seconds
2025-04-04 21:09:30.255 DEBUG (MainThread) [homeassistant.components.rest.data] Updating from http://raspberrymatic.dockerbox.local/addons/xmlapi/state.cgi?sid=my_token&device_id=2679
I don’t really understand why the name resolution works in the docker but not in the application in the docker.
my config is:
# Loads default set of integrations. Do not remove.
default_config:
# Load frontend themes from the themes folder
frontend:
themes: !include_dir_merge_named themes
homeassistant:
internal_url: "http://homeassistant.dockerbox.local"
external_url: "http://homeassistant.dockerbox.local"
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
logger:
default: warning
logs:
homeassistant.components.rest: debug
http:
use_x_forwarded_for: true
trusted_proxies:
- 172.18.0.0/16
sensor:
- platform: rest
name: "Smart Plug Power"
resource: 'http://raspberrymatic.dockerbox.local/addons/xmlapi/state.cgi?sid=my_token&device_id=2679'
scan_interval: 10
verify_ssl: false
value_template: >
{% for state in value_json.state | selectattr('name', 'equalto', 'POWER') %} {{ state.value | float }} {% endfor %}
unit_of_measurement: "W"