3.3 KiB
Editing HA Integration Config Entries Directly
When a HA integration's configuration (host, port, credentials) needs updating but the UI is unavailable or the integration was auto-discovered (zeroconf/ssdp), you can edit the config entry storage file directly.
File Location
/mnt/data/supervisor/homeassistant/.storage/core.config_entries
Accessed via Proxmox guest agent (HA is VM 106 on proxmox1):
ssh -i ~/.ssh/id_ed25519_proxmox root@10.0.20.10 \
"qm guest exec 106 --timeout 30 -- bash -c 'cat /mnt/data/supervisor/homeassistant/.storage/core.config_entries'"
Format
JSON array of config entry objects. Each entry has:
{
"entry_id": "5e1d2138...",
"domain": "nut",
"title": "192.168.100.27:3493",
"data": {
"host": "192.168.100.27",
"port": 3493
},
"source": "zeroconf",
"disabled_by": null,
...
}
Editing Procedure
-
Backup first:
cp .../core.config_entries .../core.config_entries.bak -
Find the entry — grep for the domain or old IP:
grep -A20 '"domain":"nut"' core.config_entries | head -25 -
Replace the value (sed):
sed -i 's/"host":"192.168.100.27"/"host":"10.0.30.100"/g' core.config_entries -
Verify the change:
grep '"host":"10.0.30.100"' core.config_entries -
Restart HA — changes to
.storage/files only take effect after restart:curl -s -X POST "$HA_URL/api/services/homeassistant/restart" \ -H "Authorization: Bearer $HA_TOKEN" \ -H "Content-Type: application/json" -d '{}' -
Verify after restart — poll
GET /api/configuntilstate: RUNNING, then check entity states for the affected integration.
NUT/UPS Walkthrough (June 2026)
Problem
NUT integration entities all unavailable. Config entry pointed to old IP
192.168.100.27:3493 after network migration to 10.0.30.x.
Root Causes (3 separate issues!)
- NUT server
MODE=nonein/etc/nut/nut.conf→ upsd wouldn't start- Fix:
sed -i 's/^MODE=none/MODE=netserver/' /etc/nut/nut.conf
- Fix:
- upsd.conf bound to old IP —
LISTEN 192.168.100.27 3493- Fix:
echo 'LISTEN 0.0.0.0 3493' > /etc/nut/upsd.conf
- Fix:
- Duplicate
[monitor]section inupsd.users(two entries, conflicting)- Fix: Rewrite with single merged
[monitor]section
- Fix: Rewrite with single merged
- HA config entry pointed to old IP
- Fix:
sed -i 's/"host":"192.168.100.27"/"host":"10.0.30.100"/g' core.config_entries
- Fix:
Verification
# On NUT host:
upsc apc@localhost # Should return UPS variables
# From HA/remote:
python3 -c "import socket; s=socket.socket(); s.settimeout(3); s.connect(('10.0.30.100', 3493)); print('OK')"
# In HA after restart:
curl -s "$HA_URL/api/states" -H "Authorization: Bearer $HA_TOKEN" | \
python3 -c "import sys,json; [print(f'{e[\"entity_id\"]}: {e[\"state\"]}') for e in json.load(sys.stdin) if 'apc' in e['entity_id'].lower()]"
Key Entities After Fix
sensor.apc_akku_ladung: 100 (battery charge %)sensor.apc_batteriespannung: 13.6 (battery voltage)sensor.apc_eingangsspannung: 244.0 (input voltage)sensor.apc_status: Online, Low Batterysensor.apc_last: 75 (load %)
⚠️ "Low Battery" at 100% charge with 60s runtime = aging battery (mfg date 2019/10). Consider replacement.