Skip to content

C-Gate Command Error 401: (Object Not Found or Unauthorized) #9

@MtSamsonite

Description

@MtSamsonite

Clarification request: Managed mode label import from .cbz succeeds, but C-Gate project/network may not be loaded for TreeXML discovery

Summary

Firstly, thank you for the work on this add-on. It is a very useful project, and the managed-mode approach is especially helpful for Home Assistant users who want a more self-contained C-Bus integration.

I am running into an issue in Home Assistant add-on managed mode where importing a Toolkit .cbz file through the C-Gate Web UI appears to successfully parse the project file and save the labels, but the managed C-Gate instance does not appear to have the actual project loaded into its C-Gate project database afterwards.

The bridge starts successfully, connects to the locally managed C-Gate process, connects to MQTT, and loads the imported labels. However, network discovery / TreeXML for network 254 repeatedly fails with C-Gate 401 Bad object or device ID. As a result, Home Assistant discovery does not populate the expected devices from the imported project.

I may be misunderstanding the intended managed-mode workflow, but it looks like there may be a distinction between:

  • importing labels from .cbz / .xml, and
  • loading or staging the actual Toolkit project into the managed C-Gate runtime.

If that distinction is intentional, some documentation or UI clarification would be very helpful.

Environment

  • Home Assistant add-on: C-Gate Web Bridge
  • Add-on version: 1.8.9
  • C-Gate version started by add-on: Schneider Electric C-Gate(TM) v3.3.2 (build 1855)
  • Mode: managed
  • cgate_host: 127.0.0.1
  • cgate_project: BURSWOOD
  • getall_networks: [254]
  • ha_discovery_networks: [254]
  • ha_discovery_enabled: true
  • MQTT broker: Home Assistant Mosquitto add-on 7.1.0

Steps to reproduce

  1. Install and start the Home Assistant add-on in managed mode.
  2. Configure the project name as BURSWOOD, host as 127.0.0.1, and network as 254.
  3. Open the add-on Web UI.
  4. Import a valid Toolkit .cbz file.
  5. Confirm that the import completes and labels are saved.
  6. Restart or start the add-on and allow managed C-Gate and the bridge to finish startup.
  7. Observe the bridge logs during HA discovery / TreeXML discovery.

Expected behaviour

In managed mode, after importing a valid Toolkit .cbz / project file, I expected one of the following outcomes:

  • the add-on loads, stages, or starts the imported project inside the managed C-Gate instance so that TreeXML / discovery can query it successfully; or
  • the UI/documentation clearly explains that .cbz / .xml import is label-only, and that the C-Gate project must be loaded separately, including the supported process for doing that in managed mode; or
  • if the project needs to be placed somewhere manually, the documentation clearly identifies the correct location and workflow — for example, whether it should be placed under /share, /share/cgate, /config, or another add-on-accessible path, and whether a restart/reload is then required.

Actual behaviour

The import appears to succeed as a label import, but managed C-Gate appears to start with a fresh configuration and discovery cannot query network 254.

Relevant startup/discovery log excerpt:

Schneider Electric C-Gate(TM) v3.3.2 (build 1855)
Config file not found.
Created new configuration file: C-GateConfig.txt
C-Gate is running.
...
INFO  [ConfigLoader] Using default label file path: /config/cgateweb-labels.json (will be created on first save)
INFO  [LabelLoader] Label file not found: /config/cgateweb-labels.json (will be created on first save)
INFO  [CgateConnectionPool-command] Initializing connection pool: 3 connections to 127.0.0.1:20023
INFO  [MqttManager] CONNECTED TO MQTT BROKER: core-mosquitto:1883
INFO  [connection-manager] ALL CONNECTED
INFO  [BridgeInitializationService] Network auto-discovery: C-Gate 401 Bad object or device ID.; using configured networks
INFO  [BridgeInitializationService] Network auto-discovery returned no networks; falling back to configured values
INFO  [HaDiscovery] HA Discovery enabled, querying network trees...
INFO  [HaDiscovery] Requesting TreeXML for network 254...
WARN  [bridge] C-Gate Command Error 401: (Object Not Found or Unauthorized) - Bad object or device ID.
WARN  [HaDiscovery] HA Discovery: TreeXML for network 254 failed (no response within timeout). Retrying in 2s (attempt 1/8).
...
WARN  [HaDiscovery] HA Discovery: TreeXML for network 254 failed (no response within timeout). Retrying in 60s (attempt 8/8).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions