{"record":{"id":"83a9d9c697159840","repo":"AlexxIT/go2rtc","slug":"no-hass-config","errorCode":null,"errorMessage":"no hass config","messagePattern":"no hass config","errorType":"http","errorClass":null,"httpStatus":404,"severity":"warning","filePath":"internal/hass/hass.go","lineNumber":64,"sourceCode":"\t\t\t\treturn location + \"#\" + rawQuery, nil\n\t\t\t}\n\t\t\treturn location, nil\n\t\t}\n\n\t\treturn \"\", nil\n\t})\n\n\tstreams.HandleFunc(\"hass\", func(source string) (core.Producer, error) {\n\t\t// support hass://supervisor?entity_id=camera.driveway_doorbell\n\t\treturn hass.NewClient(source)\n\t})\n\n\t// load static entries from Hass config\n\tif err := importConfig(conf.Mod.Config); err != nil {\n\t\tlog.Trace().Msgf(\"[hass] can't import config: %s\", err)\n\n\t\tapi.HandleFunc(\"api/hass\", func(w http.ResponseWriter, _ *http.Request) {\n\t\t\thttp.Error(w, \"no hass config\", http.StatusNotFound)\n\t\t})\n\t\treturn\n\t}\n\n\tapi.HandleFunc(\"api/hass\", func(w http.ResponseWriter, _ *http.Request) {\n\t\tonce.Do(func() {\n\t\t\t// load WebRTC entities from Hass API, works only for add-on version\n\t\t\tif token := hass.SupervisorToken(); token != \"\" {\n\t\t\t\tif err := importWebRTC(token); err != nil {\n\t\t\t\t\tlog.Warn().Err(err).Caller().Send()\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\n\t\tvar items []*api.Source\n\t\tfor name, url := range entities {\n\t\t\titems = append(items, &api.Source{\n\t\t\t\tName: name, URL: \"hass:\" + name, Location: url,","sourceCodeStart":46,"sourceCodeEnd":82,"githubUrl":"https://github.com/AlexxIT/go2rtc/blob/c245815e75e2a5fd60b4290f12bfc04e55a984d3/internal/hass/hass.go#L46-L82","documentation":"When go2rtc runs inside Home Assistant OS, it imports camera entities from the Hass storage file .storage/core.config_entries. If importConfig fails (config path not set/incorrect, file missing, or invalid JSON), the api/hass endpoint is registered as a stub that always returns \"no hass config\" with 404, since no Hass entities can be listed.","triggerScenarios":"Requesting GET /api/hass when the hass: config section is missing from go2rtc.yaml, or its config path doesn't point to the Home Assistant config directory containing .storage/core.config_entries.","commonSituations":"Running go2rtc standalone (not as a Hass add-on) where /config/.storage doesn't exist; wrong hass: config: path; Home Assistant storage file corrupted or unreadable due to permissions; fresh install where no camera integrations exist yet.","solutions":["Set hass: config: in go2rtc.yaml to the directory containing Home Assistant's .storage/core.config_entries (e.g. /config)","Verify the file .storage/core.config_entries exists and is readable by go2rtc","Check the trace log line \"[hass] can't import config: ...\" for the underlying cause (file vs JSON error)","If running outside Hass OS, don't rely on /api/hass — define streams manually in go2rtc.yaml instead"],"exampleFix":"# before\ngo2rtc.yaml without hass section -> GET /api/hass 404 \"no hass config\"\n# after\nhass:\n  config: /config\n# -> GET /api/hass 200 with camera entities","handlingStrategy":"fallback","validationCode":"// check endpoint availability before using\nconst res = await fetch('/api/hass');\nif (res.status === 404) {\n  // \"no hass config\" — fall back to manual stream config\n}","typeGuard":null,"tryCatchPattern":"const res = await fetch('/api/hass');\nif (res.status === 404 && (await res.text()).includes('no hass config')) {\n  console.warn('go2rtc hass integration not configured; configure hass: config: path');\n}","preventionTips":["Set hass: config: in go2rtc.yaml to the HA config directory when running as an add-on","Verify .storage/core.config_entries exists and is readable","Don't rely on /api/hass in standalone go2rtc installs outside Hass OS","Check trace logs for \"can't import config\" to diagnose the import failure early"],"tags":["http","not-found","config","home-assistant"],"backgroundTag":"missing-required-config","analyzedSha":"c245815e75e2a5fd60b4290f12bfc04e55a984d3","analyzedAt":"2026-09-07T11:47:02.965Z","contentChangedAt":"2026-09-07T11:47:02.965Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}