{"openapi":"3.1.0","info":{"title":"HomeInsight by flm9.net","version":"0.1.0"},"paths":{"/api/auth/status":{"get":{"tags":["auth"],"summary":"Status","operationId":"status_api_auth_status_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Status Api Auth Status Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/login":{"post":{"tags":["auth"],"summary":"Login","operationId":"login_api_auth_login_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Login Api Auth Login Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/setup":{"post":{"tags":["auth"],"summary":"Setup","description":"First run: create the administrator account and sign it in.\n\nOnly answers in \"setup\" mode — no password, no accounts, no open-mode\nopt-in — and 409s from the moment any credential exists, so it can never\nmint a second admin. The check and the write happen under the config lock,\nso two racing first-run requests can't both succeed. Cross-site callers are\nrefused before this runs (``app.security``): an unauthenticated endpoint\nthat hands out an admin session is exactly what a foreign page would want.\n\nThe account is a named admin (users mode), the same shape as the first\naccount created on the Users page.","operationId":"setup_api_auth_setup_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetupIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Setup Api Auth Setup Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/devices":{"get":{"tags":["devices"],"summary":"List Devices","operationId":"list_devices_api_devices_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response List Devices Api Devices Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/devices/groups":{"get":{"tags":["devices"],"summary":"Groups","operationId":"groups_api_devices_groups_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Groups Api Devices Groups Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/devices/rooms":{"get":{"tags":["devices"],"summary":"Rooms","operationId":"rooms_api_devices_rooms_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Rooms Api Devices Rooms Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/devices/tags":{"get":{"tags":["devices"],"summary":"Tags","operationId":"tags_api_devices_tags_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"string"},"title":"Response Tags Api Devices Tags Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/devices/connectivity":{"get":{"tags":["devices"],"summary":"Connectivity","operationId":"connectivity_api_devices_connectivity_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response Connectivity Api Devices Connectivity Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/devices/{device_id}":{"get":{"tags":["devices"],"summary":"Get Device","operationId":"get_device_api_devices__device_id__get","parameters":[{"name":"device_id","in":"path","required":true,"schema":{"type":"string","title":"Device Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Device Api Devices  Device Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/devices/{device_id}/automation":{"get":{"tags":["devices"],"summary":"Device Automation","description":"What Load control and Keep devices on have to do with THIS relay, for the\nline under its on/off control.\n\nThe site-wide endpoints (``/load-shedding``, ``/watchdog``) answer only to a\nwhole-location grant: they carry the site load, every device, the logs and\nthe recipients. A person granted just this device (with CONTROL) can still\nswitch it, and must be told what that does to the automations, so this\nanswers to ``can_see`` on the device alone — and therefore carries nothing\nbut this device's own entries, read from the controllers' status helpers.\n\nSite-level settings that are not about this device (the shed threshold,\nthe restore load, which reveals the target) are included only for a\nwhole-location viewer (``scope: \"location\"``); a device-scoped viewer gets\nnull and the page words the line without the number. The watchdog's\n\"switched off in HomeInsight by <user>\" hold names another account, so a\ndevice-scoped viewer gets it without the name.","operationId":"device_automation_api_devices__device_id__automation_get","parameters":[{"name":"device_id","in":"path","required":true,"schema":{"type":"string","title":"Device Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Device Automation Api Devices  Device Id  Automation Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/devices/{device_id}/raw":{"get":{"tags":["devices"],"summary":"Device Raw","description":"The device's last raw DP frame plus the effective alarm limits and where\neach came from (manual override / fetched from the device / built-in default).\nLets the user see what a device actually reports — including protection\nsetpoints — and confirm a limit is being read from the hardware.","operationId":"device_raw_api_devices__device_id__raw_get","parameters":[{"name":"device_id","in":"path","required":true,"schema":{"type":"string","title":"Device Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Device Raw Api Devices  Device Id  Raw Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/devices/{device_id}/test":{"post":{"tags":["devices"],"summary":"Test Device","description":"Read an already-configured device once, right now, and report what came back.\n\nThe onboarding ``/test`` endpoints can't do this: they take a ``local_key`` in\nthe body, and the stored key never leaves the server. Here the backend is\nbuilt from the device's own configuration — same vendor, same transport, same\ncredentials the poller uses — so the answer reflects what polling actually\ndoes, for every vendor and in every mode.","operationId":"test_device_api_devices__device_id__test_post","parameters":[{"name":"device_id","in":"path","required":true,"schema":{"type":"string","title":"Device Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Test Device Api Devices  Device Id  Test Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/devices/{device_id}/debug":{"get":{"tags":["devices"],"summary":"Device Debug","description":"Everything needed to work out what a device's data points mean.\n\nThe mapping panel answers \"what does this device report and what does it map\nto\". That is not enough to onboard hardware nobody has documented, because the\nquestions that actually block you are about BEHAVIOUR over time:\n\n  * does this value move? A measurement does; a rating, a setpoint or a limit\n    doesn't. Getting this backwards is how a 2000 W over-power setting gets\n    mapped as a 200 V mains voltage.\n  * is this data point always there? A Tuya device omits a data point it has\n    nothing to say about, so an intermittent one is usually the reading you are\n    hunting — a per-phase power that appears the moment the circuit draws.\n  * is anything mapped to something it cannot be? A relay state of 660 or a\n    frequency of 0.01 Hz is stored and charted as fact, and nothing else in the\n    UI says so.\n  * what does the profile map that this device never sends? That is the\n    signature of the wrong profile, or of a cloud status code while polling\n    over the LAN.\n\nSo this answers all four per data point, over the poller's recent frames, plus\nthe derived metrics (which belong to no data point and confuse everyone the\nfirst time). Read-only, and no secrets: the same visibility as\n``/devices/{id}/raw``.","operationId":"device_debug_api_devices__device_id__debug_get","parameters":[{"name":"device_id","in":"path","required":true,"schema":{"type":"string","title":"Device Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Device Debug Api Devices  Device Id  Debug Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/devices/{device_id}/cloud-inspect":{"post":{"tags":["devices"],"summary":"Cloud Inspect","description":"Ask Tuya what its own data points mean, and compare the two transports.\n\nThe LAN protocol is anonymous: `{\"125\": 220}` and no more. Everything hard\nabout onboarding a Tuya device follows from that, and reconstructing the\nmeaning from value ranges is guessing — which is how a 2000 W over-power\nsetpoint came to be offered as a 200 V mains voltage.\n\nThe cloud is not anonymous. Two things it can tell us, and this does both:\n\n  * `/v1.1/devices/{id}/specifications` pairs each **numeric dp_id with the\n    cloud's status code** and gives its type, unit, scale and range. That turns\n    \"what is DP 125\" into a lookup — and it covers data points a frame can\n    never show, because the per-phase power of an idle circuit is absent from\n    the reading but present in the definition.\n  * a cloud READ of the same device, whose keys are those codes. Set beside the\n    LAN frame it pairs the two by value even when the specification is\n    unavailable (Tuya declines it for some devices).\n\nFrom the unit and scale, a mapping is *derived* rather than guessed. It is\nstill returned as a suggestion with its evidence attached — vendor metadata\ncan be wrong or ambiguous too, and a `raw` phase blob has a byte layout the\nspecification says nothing about. Nothing is written.","operationId":"cloud_inspect_api_devices__device_id__cloud_inspect_post","parameters":[{"name":"device_id","in":"path","required":true,"schema":{"type":"string","title":"Device Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Cloud Inspect Api Devices  Device Id  Cloud Inspect Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/devices/{device_id}/detect":{"post":{"tags":["devices"],"summary":"Detect Device","description":"Work out what this device is and what its data points mean, on demand.\n\nReads it a few times, scores every built-in profile against what came back,\nflags mappings that produce impossible values, and proposes scales for the\ndata points nothing maps. Nothing is written: the answer goes into the\neditor's draft, where the user applies what they agree with. See\napp/normalize/detect.py for why it never decides on its own.","operationId":"detect_device_api_devices__device_id__detect_post","parameters":[{"name":"device_id","in":"path","required":true,"schema":{"type":"string","title":"Device Id"}},{"name":"samples","in":"query","required":false,"schema":{"type":"integer","default":2,"title":"Samples"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Detect Device Api Devices  Device Id  Detect Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/series":{"get":{"tags":["readings"],"summary":"Series","operationId":"series_api_series_get","parameters":[{"name":"device","in":"query","required":true,"schema":{"type":"string","title":"Device"}},{"name":"metric","in":"query","required":true,"schema":{"type":"string","title":"Metric"}},{"name":"start","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Start"}},{"name":"end","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"End"}},{"name":"max_points","in":"query","required":false,"schema":{"type":"integer","maximum":6000,"minimum":50,"default":2000,"title":"Max Points"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Series Api Series Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/events":{"get":{"tags":["readings"],"summary":"Events","description":"Device events (fault + threshold callouts) overlapping the window, scoped\nto the caller's visible devices. Accepts a single ``device`` or a comma\n``devices`` list; non-visible ids are silently dropped.","operationId":"events_api_events_get","parameters":[{"name":"device","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Device"}},{"name":"devices","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Devices"}},{"name":"start","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Start"}},{"name":"end","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"End"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Events Api Events Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/events/reconcile":{"post":{"tags":["readings"],"summary":"Reconcile Events","description":"Retroactively drop stored *threshold-derived* callouts for the conditions a\ndevice now reports itself (a fault map is assigned). Live detection already\nsuppresses these; this cleans up ones recorded before the device was trusted —\ne.g. the guessed over-power alerts on a breaker before its fault map was set.\nNever touches device-reported ('fault') events, nor codes a device doesn't\nself-report, nor ones kept on via a manual event_thresholds override.","operationId":"reconcile_events_api_events_reconcile_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Reconcile Events Api Events Reconcile Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/audit/pinned-readings":{"get":{"tags":["readings"],"summary":"Pinned Readings","description":"Every device, every stored metric: which ones have never once moved.\n\nThe fleet-wide version of the mapping check on a device page. That one reads\nthe configuration and catches a threshold pointed at a measurement it can\nrecognise; this one reads the DATA and catches the same defect wherever the\nconfiguration looks innocent — a hand-written override, an unrecognised vendor\ncode, a `dp_overrides` line edited into config.yaml years ago.\n\nThe signal is a measurement that has not varied by a single count across the\nwindow. A real voltage moves; a trip point does not. It is reported rather than\nacted on, because a genuinely dead sensor looks identical from here and only\nthe person with the hardware can tell them apart.\n\nOne exception: a current or power pinned at (near) ZERO on a device whose own\nraw power, or relay state, shows it idle or off for the whole window. An idle\nplug's current never moves, and that is correct; a trip point is never zero.\nSee `_idle_throughout`.\n\nRead from RAW rows via `raw_extremes`, not from `stats`: that picks a rollup\ntier by span and reads its `avg` column, so a metric alternating 199.9/200.1\naverages to 200.0 in every bucket and would be reported as pinned. It would\nalso see nothing at all until the rollup job had run. Each finding carries the\nsample count it was judged on, because raw retention bounds how far back a long\nwindow can actually see.\n\nAlso carries each device's configuration findings, so one call answers \"what\nelse looks like this?\" instead of one request per device.\n\n``device`` narrows the same audit to one device, so a device's own health\ncard and data-point page show exactly the findings the fleet view lists for\nit — same reader, same exclusions, no second opinion. An unknown or unseen\nid answers with no devices rather than 404, as the fleet view would.","operationId":"pinned_readings_api_audit_pinned_readings_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":7,"title":"Days"}},{"name":"device","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Device"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Pinned Readings Api Audit Pinned Readings Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/devices/{device_id}/history-size":{"get":{"tags":["readings"],"summary":"History Size","description":"How much is stored for this device, per metric, plus its event count.\n\nQuoted before a purge rather than after it. Deleting readings is the one\naction here with no undo — there is no bin and no journal to replay from — so\nthe number has to be on screen before the button is pressed, not in a\nconfirmation afterwards.","operationId":"history_size_api_devices__device_id__history_size_get","parameters":[{"name":"device_id","in":"path","required":true,"schema":{"type":"string","title":"Device Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response History Size Api Devices  Device Id  History Size Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/devices/{device_id}/purge-history":{"post":{"tags":["readings"],"summary":"Purge History","description":"Erase stored readings for a device — everything, or named metrics.\n\nThe JSON body is REQUIRED (``{\"metrics\": null}`` for everything): a bodiless\nPOST is a 422. \"No body means erase it all\" was the shape of a request any\nweb page can send cross-site without a preflight.\n\nWhy this exists: a mapping that charted a protection trip point as a live\nmeasurement wrote real rows for as long as it was wrong. Clearing the override\nstops new ones, but the old ones are indistinguishable from readings once\nstored, so they keep a flat 200 V line in every chart of that period and keep\n`latest` answering with it.\n\n``metrics`` (required): null purges every metric; a list purges exactly\nthose. An empty list purges nothing, deliberately — the same rule the\nrepository uses, so a UI bug that sends `[]` cannot mean \"everything\".\n\n``events``: also delete this device's stored events. Off by default, and\nseparate, because the false over-voltage callouts a bad mapping fired are\nevents rather than readings and a user may want one without the other.","operationId":"purge_history_api_devices__device_id__purge_history_post","parameters":[{"name":"device_id","in":"path","required":true,"schema":{"type":"string","title":"Device Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Purge History Api Devices  Device Id  Purge History Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/compare":{"get":{"tags":["readings"],"summary":"Compare","operationId":"compare_api_compare_get","parameters":[{"name":"devices","in":"query","required":true,"schema":{"type":"string","title":"Devices"}},{"name":"metric","in":"query","required":true,"schema":{"type":"string","title":"Metric"}},{"name":"start","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Start"}},{"name":"end","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"End"}},{"name":"max_points","in":"query","required":false,"schema":{"type":"integer","maximum":6000,"minimum":50,"default":2000,"title":"Max Points"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Compare Api Compare Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/energy":{"get":{"tags":["readings"],"summary":"Energy","operationId":"energy_api_energy_get","parameters":[{"name":"devices","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Devices"}},{"name":"start","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Start"}},{"name":"end","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"End"}},{"name":"bucket","in":"query","required":false,"schema":{"type":"integer","minimum":60,"default":3600,"title":"Bucket"}},{"name":"bucketed","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Bucketed"}},{"name":"device","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Device"}},{"name":"location","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Location"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Energy Api Energy Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/devices/{device_id}/missing-history":{"get":{"tags":["history"],"summary":"History Repairs","operationId":"history_repairs_api_devices__device_id__missing_history_get","parameters":[{"name":"device_id","in":"path","required":true,"schema":{"type":"string","title":"Device Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/devices/{device_id}/missing-history/preview":{"post":{"tags":["history"],"summary":"Preview History","operationId":"preview_history_api_devices__device_id__missing_history_preview_post","parameters":[{"name":"device_id","in":"path","required":true,"schema":{"type":"string","title":"Device Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HistoryRepair"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/devices/{device_id}/missing-history/{marker_id}":{"put":{"tags":["history"],"summary":"Save History","operationId":"save_history_api_devices__device_id__missing_history__marker_id__put","parameters":[{"name":"device_id","in":"path","required":true,"schema":{"type":"string","title":"Device Id"}},{"name":"marker_id","in":"path","required":true,"schema":{"type":"string","title":"Marker Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HistoryRepair"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["history"],"summary":"Remove History","operationId":"remove_history_api_devices__device_id__missing_history__marker_id__delete","parameters":[{"name":"device_id","in":"path","required":true,"schema":{"type":"string","title":"Device Id"}},{"name":"marker_id","in":"path","required":true,"schema":{"type":"string","title":"Marker Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stats/metrics":{"get":{"tags":["stats"],"summary":"Metric Registry","operationId":"metric_registry_api_stats_metrics_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response Metric Registry Api Stats Metrics Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stats/overview":{"get":{"tags":["stats"],"summary":"Overview","operationId":"overview_api_stats_overview_get","parameters":[{"name":"start","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Start"}},{"name":"end","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"End"}},{"name":"location","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Location"}},{"name":"tz_offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Tz Offset"}},{"name":"tz","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tz"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Overview Api Stats Overview Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stats/breakdown":{"get":{"tags":["stats"],"summary":"Breakdown","operationId":"breakdown_api_stats_breakdown_get","parameters":[{"name":"by","in":"query","required":false,"schema":{"type":"string","pattern":"^(group|device|room)$","default":"group","title":"By"}},{"name":"start","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Start"}},{"name":"end","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"End"}},{"name":"location","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Location"}},{"name":"tz_offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Tz Offset"}},{"name":"tz","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tz"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Breakdown Api Stats Breakdown Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stats/usage-split":{"get":{"tags":["stats"],"summary":"Usage Split","description":"Home vs external (vs combined) energy for a mobile location over a range.\n\nReturns ``is_mobile: false`` (with the whole window reported as home/combined)\nfor a location that isn't marked mobile, so the frontend can call it\nuniformly.","operationId":"usage_split_api_stats_usage_split_get","parameters":[{"name":"location","in":"query","required":true,"schema":{"type":"string","title":"Location"}},{"name":"start","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Start"}},{"name":"end","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"End"}},{"name":"tz_offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Tz Offset"}},{"name":"tz","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tz"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Usage Split Api Stats Usage Split Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stats/grid-tariff":{"get":{"tags":["stats"],"summary":"Grid Tariff Analysis","description":"Quarter-hour view of a location's load against the Austrian SNE-G-V\nnetwork tariff: monthly 15-minute peaks (the Leistungspreis basis), energy in\nthe Sommer-/Winter-Nieder-Arbeitspreis windows, and what each costs.\n\nRead on the tariff's own clock (``grid.timezone``), not the viewer's. Peaks\nand window shares are reported even when the location's tariff has no grid\nprices yet, so the page is useful before anyone configures them.","operationId":"grid_tariff_analysis_api_stats_grid_tariff_get","parameters":[{"name":"location","in":"query","required":true,"schema":{"type":"string","title":"Location"}},{"name":"start","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Start"}},{"name":"end","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"End"}},{"name":"period","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^(month|last-month|12m)$"},{"type":"null"}],"title":"Period"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Grid Tariff Analysis Api Stats Grid Tariff Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stats/data-coverage":{"get":{"tags":["stats"],"summary":"Data Coverage","description":"Time windows in which the location's counted devices actually reported\ndata over the range — so the usage calendar can show when the meter was live\n(e.g. plugged in at a berth) versus off-grid gaps, and prefill periods from it.\n\nA ``bucket`` is \"covered\" when any counted device has a stored energy row\noverlapping it; contiguous covered buckets are coalesced into ``[start, end)``\nwindows. Past minute retention a row is an hour (or a day) wide and covers\nevery bucket in its span — the resolution history is kept at.\n\n``per_device`` adds ``first``: each counted device's first covered moment\n(None when it reported nothing). The union alone cannot show that ONE root\nbegan partway through: an older one covers the window's start for it.","operationId":"data_coverage_api_stats_data_coverage_get","parameters":[{"name":"location","in":"query","required":true,"schema":{"type":"string","title":"Location"}},{"name":"start","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Start"}},{"name":"end","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"End"}},{"name":"bucket","in":"query","required":false,"schema":{"type":"integer","maximum":86400,"minimum":60,"default":900,"title":"Bucket"}},{"name":"per_device","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Per Device"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Data Coverage Api Stats Data Coverage Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stats/device/{device_id}":{"get":{"tags":["stats"],"summary":"Device Stats","operationId":"device_stats_api_stats_device__device_id__get","parameters":[{"name":"device_id","in":"path","required":true,"schema":{"type":"string","title":"Device Id"}},{"name":"metric","in":"query","required":true,"schema":{"type":"string","title":"Metric"}},{"name":"start","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Start"}},{"name":"end","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"End"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Device Stats Api Stats Device  Device Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stats/distribution":{"get":{"tags":["stats"],"summary":"Distribution","operationId":"distribution_api_stats_distribution_get","parameters":[{"name":"device","in":"query","required":true,"schema":{"type":"string","title":"Device"}},{"name":"metric","in":"query","required":true,"schema":{"type":"string","title":"Metric"}},{"name":"start","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Start"}},{"name":"end","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"End"}},{"name":"bins","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":4,"default":24,"title":"Bins"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Distribution Api Stats Distribution Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stats/power-quality/{device_id}":{"get":{"tags":["stats"],"summary":"Power Quality","operationId":"power_quality_api_stats_power_quality__device_id__get","parameters":[{"name":"device_id","in":"path","required":true,"schema":{"type":"string","title":"Device Id"}},{"name":"start","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Start"}},{"name":"end","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"End"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Power Quality Api Stats Power Quality  Device Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stats/heatmap":{"get":{"tags":["stats"],"summary":"Heatmap","description":"Hour-of-day x day-of-week average power matrix.\n\n``tz`` is the client's IANA zone and ``tz_offset`` its\n``Date.getTimezoneOffset()`` (minutes, UTC minus local), the fallback when\n``tz`` is absent or unknown (see ``resolve_zone``), so cells align to the\nuser's local schedule — on both sides of a DST change — rather than the\nserver's timezone (usually UTC in Docker).","operationId":"heatmap_api_stats_heatmap_get","parameters":[{"name":"device","in":"query","required":true,"schema":{"type":"string","title":"Device"}},{"name":"start","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Start"}},{"name":"end","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"End"}},{"name":"tz_offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Tz Offset"}},{"name":"tz","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tz"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Heatmap Api Stats Heatmap Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/export/json":{"get":{"tags":["export"],"summary":"Export Json","operationId":"export_json_api_export_json_get","parameters":[{"name":"start","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Start"}},{"name":"end","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"End"}},{"name":"location","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Location"}},{"name":"device","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Device"}},{"name":"tz_offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Tz Offset"}},{"name":"tz","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tz"}},{"name":"summary","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Summary"}},{"name":"devices","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Devices"}},{"name":"metric","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Metric"}},{"name":"by","in":"query","required":false,"schema":{"type":"string","default":"group","title":"By"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/export/excel":{"get":{"tags":["export"],"summary":"Export Excel","operationId":"export_excel_api_export_excel_get","parameters":[{"name":"start","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Start"}},{"name":"end","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"End"}},{"name":"location","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Location"}},{"name":"device","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Device"}},{"name":"tz_offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Tz Offset"}},{"name":"tz","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tz"}},{"name":"summary","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Summary"}},{"name":"devices","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Devices"}},{"name":"metric","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Metric"}},{"name":"by","in":"query","required":false,"schema":{"type":"string","default":"group","title":"By"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/export/pdf":{"get":{"tags":["export"],"summary":"Export Pdf","description":"The PDF report. ``summary`` (the default) is the short one — totals, cost,\nthe breakdown and one chart; ``summary=false`` adds the per-device\nstatistics and heatmaps. Neither prints per-sample rows, so the raw series\nare never read. A Compare export (``devices`` + ``metric``) draws the\ndevices' series of that metric overlaid, read BOUNDED: each is the span's\nrollup tier regrouped to ``CHART_MAX_POINTS`` points, as the Compare page\nreads it, never the full-resolution export series.","operationId":"export_pdf_api_export_pdf_get","parameters":[{"name":"start","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Start"}},{"name":"end","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"End"}},{"name":"location","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Location"}},{"name":"device","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Device"}},{"name":"tz_offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Tz Offset"}},{"name":"tz","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tz"}},{"name":"summary","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Summary"}},{"name":"devices","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Devices"}},{"name":"metric","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Metric"}},{"name":"by","in":"query","required":false,"schema":{"type":"string","default":"group","title":"By"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/config":{"get":{"tags":["config"],"summary":"Get Config","operationId":"get_config_api_config_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Config Api Config Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/config/mode":{"put":{"tags":["config"],"summary":"Set Mode","description":"Switch the data source. Leaving the Simulator may remove the demo fleet\n(``remove_demo``) and erase what the simulator invented meanwhile\n(``erase_simulated``), in ONE request. The demo devices go first, so a\nrefusal part-way (load control could not restore one, say) leaves the\ndata source unchanged, and repeating the request carries on with the demo\ndevices that are left.\n\nThe erase is saved as an obligation in the same edit as the switch and\ncarried out after it (``app.sim_erase``); one left owed by a failure is\nretried here on every call, and at startup.","operationId":"set_mode_api_config_mode_put","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModeIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Set Mode Api Config Mode Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/config/demo/remove":{"post":{"tags":["config"],"summary":"Remove Demo Devices","description":"Delete the demo devices still configured, and their stored history,\nwhatever the data source — for someone who kept them when switching.","operationId":"remove_demo_devices_api_config_demo_remove_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DemoRemoveIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Remove Demo Devices Api Config Demo Remove Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/config/actions":{"get":{"tags":["config"],"summary":"Get Actions","description":"The gate, and what turning it on would arm: each location whose\nautomations would start switching relays, by the same test the PUT judges\na scoped caller by (so the confirmation lists exactly what it refuses on).\nA location the caller does not manage is counted, never named.","operationId":"get_actions_api_config_actions_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Actions Api Config Actions Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["config"],"summary":"Set Actions Enabled","description":"Flip the global device-actions kill-switch. This is the admin gate that\nmust be on before any on/off control works, on top of the per-user `control`\ncapability. It never touches the poll loop, so no poller restart.","operationId":"set_actions_enabled_api_config_actions_put","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActionsEnabledIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Set Actions Enabled Api Config Actions Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/config/cloud":{"put":{"tags":["config"],"summary":"Set Cloud","description":"Persist Tuya Cloud credentials so Cloud mode can poll. Restarts the\npoller only when currently in cloud mode (it doesn't affect local polling).","operationId":"set_cloud_api_config_cloud_put","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloudCreds"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Set Cloud Api Config Cloud Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/config/ai":{"put":{"tags":["config"],"summary":"Set Ai","description":"Persist the Claude-assisted-proposals settings.\n\nNo poller restart: nothing here touches polling. A blank or redacted key\nmeans \"keep the stored one\", like every other secret here; `clear_key`\ndeletes it outright.","operationId":"set_ai_api_config_ai_put","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Set Ai Api Config Ai Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/config/meross":{"put":{"tags":["config"],"summary":"Set Meross","description":"Persist the Meross account (region/email/password + the fetched key) so the\ndurable key survives reloads and never needs re-fetching (Meross rate-limits\nrepeat logins). Meross always polls locally, so no poller restart.","operationId":"set_meross_api_config_meross_put","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MerossCreds"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Set Meross Api Config Meross Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/config/meross/fallback":{"put":{"tags":["config"],"summary":"Set Meross Fallback","operationId":"set_meross_fallback_api_config_meross_fallback_put","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MerossFallbackSettings"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Set Meross Fallback Api Config Meross Fallback Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/config/scanner":{"put":{"tags":["config"],"summary":"Set Scanner","description":"Persist the remote LAN-scan agent's url/token so the onboarding scan can\nbe proxied to a machine on the device subnet. Doesn't touch polling.","operationId":"set_scanner_api_config_scanner_put","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScannerConfig"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Set Scanner Api Config Scanner Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/config/recovery":{"put":{"tags":["config"],"summary":"Set Recovery","description":"Persist downtime-recovery settings (auto-backfill toggle, gap threshold,\nmax backfill days). Doesn't affect polling, so no poller restart.","operationId":"set_recovery_api_config_recovery_put","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecoveryConfig"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Set Recovery Api Config Recovery Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/config/smtp":{"put":{"tags":["config"],"summary":"Set Smtp","description":"Persist the outgoing-mail server used for scheduled email reports. A blank\nor redacted password means \"keep the stored one\" (the UI sends \"***\"),\nmirroring set_cloud/set_scanner. Doesn't touch polling.","operationId":"set_smtp_api_config_smtp_put","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SmtpConfig"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Set Smtp Api Config Smtp Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/config/smtp/test":{"post":{"tags":["config"],"summary":"Test Smtp","description":"Send one plain test message through the SAVED mail settings. Success\nmarks them verified, which is what lets the default ``localhost:25`` count\nas set up. A failure answers 200 with the reason in plain words\n(``message``) and the server's own text (``error``).","operationId":"test_smtp_api_config_smtp_test_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SmtpTestIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Test Smtp Api Config Smtp Test Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/config/reports":{"get":{"tags":["config"],"summary":"List Reports","description":"Report subscriptions whose scope the caller can see, each merged with its\ndurable last-send state. Scoped like the other report endpoints: a\ndevice-restricted settings user doesn't see full-account subscriptions or\nones covering devices outside their access.\n\nSeeing is not managing: a location-scoped subscription is visible to anyone\nwho can see that location's data, but editing, deleting or test-sending it\nneeds a grant on the location itself (``_authorize_report_scope``). Each row\nsays which via ``manageable``, so the UI offers only controls that work.","operationId":"list_reports_api_config_reports_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response List Reports Api Config Reports Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["config"],"summary":"Add Report","operationId":"add_report_api_config_reports_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportSubscription"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Add Report Api Config Reports Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/config/reports/{sub_id}":{"put":{"tags":["config"],"summary":"Update Report","operationId":"update_report_api_config_reports__sub_id__put","parameters":[{"name":"sub_id","in":"path","required":true,"schema":{"type":"string","title":"Sub Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Patch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Update Report Api Config Reports  Sub Id  Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["config"],"summary":"Delete Report","operationId":"delete_report_api_config_reports__sub_id__delete","parameters":[{"name":"sub_id","in":"path","required":true,"schema":{"type":"string","title":"Sub Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Delete Report Api Config Reports  Sub Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/config/reports/{sub_id}/test":{"post":{"tags":["config"],"summary":"Test Report","description":"Send a subscription immediately, ignoring its schedule.","operationId":"test_report_api_config_reports__sub_id__test_post","parameters":[{"name":"sub_id","in":"path","required":true,"schema":{"type":"string","title":"Sub Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Test Report Api Config Reports  Sub Id  Test Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/config/reports/{sub_id}/download":{"get":{"tags":["config"],"summary":"Download Report","description":"One attachment of a subscription, built now and handed to the browser\ninstead of mailed: the same builder, scope and window as a send at this\nmoment (``reports.build_reports``). Gated like \"Send test\" — the report is\nbuilt with the subscription's own scope, so the caller must be allowed to\nmanage that scope. Touches no send state, and needs no mail server.\n``fmt`` picks one of the subscription's formats (default: its first).","operationId":"download_report_api_config_reports__sub_id__download_get","parameters":[{"name":"sub_id","in":"path","required":true,"schema":{"type":"string","title":"Sub Id"}},{"name":"fmt","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fmt"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/config/profiles":{"get":{"tags":["config"],"summary":"List Profiles","description":"The built-in data-point profiles a device can be assigned, plus the\ntype/vendor fallbacks that decide the default.\n\nEach profile's DP map comes along so the mapping editor can show what a\nprofile does before it's picked, and tell a profile-provided mapping apart\nfrom a per-device override. Nothing here is user data or a secret.","operationId":"list_profiles_api_config_profiles_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Profiles Api Config Profiles Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/config/fault-maps":{"get":{"tags":["config"],"summary":"List Fault Maps","description":"User-defined maps (editable) + built-ins (read-only), and the canonical\nalarm codes a map may target — everything the assignment UI needs.","operationId":"list_fault_maps_api_config_fault_maps_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Fault Maps Api Config Fault Maps Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["config"],"summary":"Add Fault Map","operationId":"add_fault_map_api_config_fault_maps_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NamedFaultMap"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Add Fault Map Api Config Fault Maps Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/config/fault-maps/{name}":{"put":{"tags":["config"],"summary":"Update Fault Map","operationId":"update_fault_map_api_config_fault_maps__name__put","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Patch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Update Fault Map Api Config Fault Maps  Name  Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["config"],"summary":"Delete Fault Map","operationId":"delete_fault_map_api_config_fault_maps__name__delete","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Delete Fault Map Api Config Fault Maps  Name  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/config/password":{"put":{"tags":["config"],"summary":"Set Password","description":"Set or clear the login password (stored as a PBKDF2 hash). Doesn't affect\npolling, so no poller restart.","operationId":"set_password_api_config_password_put","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasswordIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Set Password Api Config Password Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/config/tariff":{"put":{"tags":["config"],"summary":"Set Tariff","operationId":"set_tariff_api_config_tariff_put","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tariff"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Set Tariff Api Config Tariff Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/config/devices":{"post":{"tags":["config"],"summary":"Add Device","operationId":"add_device_api_config_devices_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceConfig"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Add Device Api Config Devices Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/config/devices/{device_id}":{"put":{"tags":["config"],"summary":"Update Device","operationId":"update_device_api_config_devices__device_id__put","parameters":[{"name":"device_id","in":"path","required":true,"schema":{"type":"string","title":"Device Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Patch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Update Device Api Config Devices  Device Id  Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["config"],"summary":"Delete Device","operationId":"delete_device_api_config_devices__device_id__delete","parameters":[{"name":"device_id","in":"path","required":true,"schema":{"type":"string","title":"Device Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Delete Device Api Config Devices  Device Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/config/devices/{device_id}/ai-propose":{"post":{"tags":["config"],"summary":"Ai Propose","description":"Ask Claude what this device's unmapped data points probably are.\n\nWRITES NOTHING. It returns proposals for the caller to stage into the same\n``dp_overrides`` draft a hand edit goes through, behind the same save bar.\nThat is the whole design, not caution for its own sake: the failure mode this\nproject keeps hitting is a confidently wrong claim about a data point, and a\nmismapped threshold silences a real over-current alarm.\n\nThe payload is the diagnostic report the CALLER already has on screen — sent\nup rather than rebuilt here, so what reaches Claude is exactly the text the\nuser can read for themselves first. It is credential-free by construction.\n\nEvery proposal is then applied to the frames the poller holds and run through\nthe invariant checks; one whose arithmetic this device's own numbers\ncontradict is dropped before it is ever shown, and said so in `rejected`.","operationId":"ai_propose_api_config_devices__device_id__ai_propose_post","parameters":[{"name":"device_id","in":"path","required":true,"schema":{"type":"string","title":"Device Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Ai Propose Api Config Devices  Device Id  Ai Propose Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/config/devices/{device_id}/clear-suspect-mappings":{"post":{"tags":["config"],"summary":"Clear Suspect Mappings","description":"Delete the per-device overrides that chart a protection limit as a reading.\n\nOnly the `limit_as_reading` findings, and only where the override is what\ncreates them — the case where the built-in profile already says the data point\nis a threshold and an override points it at the measurement it guards. Those\nare unambiguous: there is nothing to weigh up, the configuration contradicts\nitself and deleting the override restores what the profile always said.\n\nA `duplicate_metric` finding is deliberately NOT cleared. Two data points\nracing for one metric means one of them is wrong, and which one is a judgment\nabout the device — so it is reported and left alone. In practice this is moot\non the case that motivated it: clearing the five limit overrides on a TOQCB2\nalso settled both races, because DP 115/116 go back to over/under_voltage_set\n(never charted) and DP 119 back to over_power_set, leaving DP 139 the sole\nowner of `power_w`.\n\nReturns what it removed, so the caller can say so rather than just refetching\nand hoping. Nothing is deleted from history here: a reading that was stored is\nstill stored, and purging it is a separate, explicit choice.","operationId":"clear_suspect_mappings_api_config_devices__device_id__clear_suspect_mappings_post","parameters":[{"name":"device_id","in":"path","required":true,"schema":{"type":"string","title":"Device Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Clear Suspect Mappings Api Config Devices  Device Id  Clear Suspect Mappings Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/onboarding/installer-token":{"post":{"tags":["onboarding"],"summary":"Installer Token","description":"Mint a short-lived token for the self-hosted scan-agent installer link\n(GET /install.sh?token=...). The whole onboarding router already requires\nmanage_devices (see api/__init__.py), so no extra capability check here.","operationId":"installer_token_api_onboarding_installer_token_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Installer Token Api Onboarding Installer Token Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/onboarding/scan":{"post":{"tags":["onboarding"],"summary":"Lan Scan","description":"Discover Tuya devices broadcasting on the local network (UDP).\n\nIf a remote scan agent is configured (Settings → scanner) or supplied in the\nrequest, the sweep runs on that machine's subnet instead — necessary when the\nserver sits on a different network than the devices, since Tuya discovery is\nbroadcast and doesn't route.","operationId":"lan_scan_api_onboarding_scan_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScanIn","default":{"timeout":18}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Lan Scan Api Onboarding Scan Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/onboarding/locate":{"post":{"tags":["onboarding"],"summary":"Locate","description":"Find configured devices by address sweep, for LANs a broadcast can't reach.\n\nTuya discovery is a UDP broadcast, so it dies at the first router: a device\non another subnet — behind a VPN, on a site link — is invisible to /scan even\nthough it is perfectly reachable. Without discovery, a device whose address\nchanged just fails, and the failure looks like a bad key because the poller\nreaches whatever took the old address instead.\n\nThis sweeps addresses directly: TCP 6668 to find who is listening, then a\nreal status read per candidate to prove which device it is. Everything it\nreturns is a device we hold a key for, matched by that key.","operationId":"locate_api_onboarding_locate_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LocateIn","default":{"timeout":1.5}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Locate Api Onboarding Locate Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/onboarding/cloud-keys":{"post":{"tags":["onboarding"],"summary":"Cloud Keys","description":"Fetch the device list (incl. local keys) from a Tuya IoT cloud project.","operationId":"cloud_keys_api_onboarding_cloud_keys_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloudFetchIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Cloud Keys Api Onboarding Cloud Keys Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/onboarding/refresh-keys":{"post":{"tags":["onboarding"],"summary":"Refresh Keys","description":"Re-fetch local keys from the cloud and update devices already added.\n\nPairing a device again in the Smart Life / Tuya app — after a power cut, a\nfactory reset, a Wi-Fi change — issues it a **new local key**, and the old\none stops decrypting: the device answers on the LAN but its replies come back\nas \"Unexpected Payload from Device\". The keys are all in the cloud project;\nthis pulls them and writes the changed ones back, so recovering a re-paired\nfleet doesn't mean re-importing devices by hand.\n\nOnly the key moves. The cloud's ``ip`` is the network's public address, not\nthe device's LAN address, so overwriting a working ip with it would break\nexactly the local access we're repairing.","operationId":"refresh_keys_api_onboarding_refresh_keys_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefreshKeysIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Refresh Keys Api Onboarding Refresh Keys Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/onboarding/test":{"post":{"tags":["onboarding"],"summary":"Test Connection","description":"Verify a live local read for a single device before saving it.\n\nProbes the candidate protocol versions (configured one first) so a device\nthat actually speaks 3.4/3.5 still verifies instead of failing with tinytuya's\n\"Unexpected Payload from Device\". Returns the version that worked so the caller\ncan persist the right one.\n\nOnly ``ok`` says the device was reached, because only a reply that DECODED\nproves the thing at that address is this device. The failure messages say\n\"something answered\", never \"reached the device\": an undecodable frame may\nwell come from a different device at that address.","operationId":"test_connection_api_onboarding_test_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Test Connection Api Onboarding Test Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/onboarding/meross/cloud-devices":{"get":{"tags":["onboarding"],"summary":"Cloud Devices","description":"Cached directory; router registration requires fleet management access.","operationId":"cloud_devices_api_onboarding_meross_cloud_devices_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Cloud Devices Api Onboarding Meross Cloud Devices Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/onboarding/meross/cloud-devices/refresh":{"post":{"tags":["onboarding"],"summary":"Refresh Cloud Devices","operationId":"refresh_cloud_devices_api_onboarding_meross_cloud_devices_refresh_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Refresh Cloud Devices Api Onboarding Meross Cloud Devices Refresh Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/onboarding/meross/scan":{"post":{"tags":["onboarding"],"summary":"Meross Scan","description":"Sweep a subnet for Meross devices with keyless HTTP probes — locally, or\nvia the remote scan agent when one is configured (needed when the devices\nlive on another subnet, since the sweep only reaches its own network by\ndefault).","operationId":"meross_scan_api_onboarding_meross_scan_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MerossScanIn","default":{"timeout":2.0}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Meross Scan Api Onboarding Meross Scan Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/onboarding/meross/key":{"post":{"tags":["onboarding"],"summary":"Meross Key","description":"One-time key fetch from the Meross account API. The returned key is handed\nto the wizard (and auto-saved to the account config for reuse).","operationId":"meross_key_api_onboarding_meross_key_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MerossKeyIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Meross Key Api Onboarding Meross Key Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/onboarding/meross/test":{"post":{"tags":["onboarding"],"summary":"Meross Test","description":"Verify a live local read for a single device before saving it.\n\nHandles both local protocols. For the legacy envelope the client\ntransparently switches to the encrypted (ECDHE+AES) transport when the device\ndemands it, so the ``encrypted`` flag is read from the client's actual state —\ntrue whether the read succeeded or a wrong key was rejected during the\nencrypted handshake — rather than assumed.\n\nUnder ``protocol=\"auto\"`` the JSON-RPC read is tried first and a failure falls\nthrough to the legacy path, so the wizard needs no protocol picker; the\nresponse always names the ``protocol`` that actually answered.","operationId":"meross_test_api_onboarding_meross_test_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MerossTestIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Meross Test Api Onboarding Meross Test Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/onboarding/tasmota/scan":{"post":{"tags":["onboarding"],"summary":"Tasmota Scan","description":"Sweep a subnet for Tasmota devices — locally, or via the remote scan agent\nwhen one is configured (needed when the devices live on another subnet).","operationId":"tasmota_scan_api_onboarding_tasmota_scan_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TasmotaScanIn","default":{"timeout":2.0}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Tasmota Scan Api Onboarding Tasmota Scan Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/onboarding/tasmota/test":{"post":{"tags":["onboarding"],"summary":"Tasmota Test","description":"Verify a live local read for a single device before saving it.\n\nReports which of the device's own keys the built-in profile maps, because\nthose names are defined by the SML script rather than by us.","operationId":"tasmota_test_api_onboarding_tasmota_test_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TasmotaTestIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Tasmota Test Api Onboarding Tasmota Test Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/system/poller":{"get":{"tags":["system"],"summary":"Poller Status","operationId":"poller_status_api_system_poller_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Poller Status Api System Poller Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/system/logs":{"get":{"tags":["system"],"summary":"Logs","operationId":"logs_api_system_logs_get","parameters":[{"name":"before","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Before"}},{"name":"start","in":"query","required":false,"schema":{"type":"number","default":0,"title":"Start"}},{"name":"end","in":"query","required":false,"schema":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"End"}},{"name":"level","in":"query","required":false,"schema":{"type":"string","default":"","title":"Level"}},{"name":"component","in":"query","required":false,"schema":{"type":"string","default":"","title":"Component"}},{"name":"device","in":"query","required":false,"schema":{"type":"string","default":"","title":"Device"}},{"name":"search","in":"query","required":false,"schema":{"type":"string","maxLength":256,"default":"","title":"Search"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"default":200,"title":"Limit"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Logs Api System Logs Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/users":{"get":{"tags":["users"],"summary":"List Users","operationId":"list_users_api_users_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response List Users Api Users Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["users"],"summary":"Create User","operationId":"create_user_api_users_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Create User Api Users Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/users/{username}":{"put":{"tags":["users"],"summary":"Update User","operationId":"update_user_api_users__username__put","parameters":[{"name":"username","in":"path","required":true,"schema":{"type":"string","title":"Username"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserPatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Update User Api Users  Username  Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["users"],"summary":"Delete User","operationId":"delete_user_api_users__username__delete","parameters":[{"name":"username","in":"path","required":true,"schema":{"type":"string","title":"Username"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Delete User Api Users  Username  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/locations":{"get":{"tags":["locations"],"summary":"List Locations","operationId":"list_locations_api_locations_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response List Locations Api Locations Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["locations"],"summary":"Create Location","operationId":"create_location_api_locations_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LocationIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Create Location Api Locations Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/locations/order":{"put":{"tags":["locations"],"summary":"Reorder Locations","operationId":"reorder_locations_api_locations_order_put","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LocationOrder"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response Reorder Locations Api Locations Order Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/locations/{location_id}":{"put":{"tags":["locations"],"summary":"Update Location","operationId":"update_location_api_locations__location_id__put","parameters":[{"name":"location_id","in":"path","required":true,"schema":{"type":"string","title":"Location Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LocationPatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Update Location Api Locations  Location Id  Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["locations"],"summary":"Delete Location","operationId":"delete_location_api_locations__location_id__delete","parameters":[{"name":"location_id","in":"path","required":true,"schema":{"type":"string","title":"Location Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Delete Location Api Locations  Location Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/locations/{location_id}/tariff/history":{"get":{"tags":["locations"],"summary":"Get Tariff History","description":"The location's earlier prices, oldest first, each with the local day\nit began (derived from the entry before) and the day it ended (exclusive).","operationId":"get_tariff_history_api_locations__location_id__tariff_history_get","parameters":[{"name":"location_id","in":"path","required":true,"schema":{"type":"string","title":"Location Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Tariff History Api Locations  Location Id  Tariff History Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/locations/{location_id}/tariff/history/{valid_until}":{"put":{"tags":["locations"],"summary":"Update Tariff Period","description":"Edit the earlier price that ended on ``valid_until``: its prices and/or\nits end date (which must stay between its neighbours').","operationId":"update_tariff_period_api_locations__location_id__tariff_history__valid_until__put","parameters":[{"name":"location_id","in":"path","required":true,"schema":{"type":"string","title":"Location Id"}},{"name":"valid_until","in":"path","required":true,"schema":{"type":"string","format":"date","title":"Valid Until"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TariffPeriod"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Update Tariff Period Api Locations  Location Id  Tariff History  Valid Until  Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["locations"],"summary":"Delete Tariff Period","description":"Remove an earlier price; its days are billed at the next price (the\nfollowing entry, or the current tariff).","operationId":"delete_tariff_period_api_locations__location_id__tariff_history__valid_until__delete","parameters":[{"name":"location_id","in":"path","required":true,"schema":{"type":"string","title":"Location Id"}},{"name":"valid_until","in":"path","required":true,"schema":{"type":"string","format":"date","title":"Valid Until"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Delete Tariff Period Api Locations  Location Id  Tariff History  Valid Until  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/locations/{location_id}/usage-periods":{"put":{"tags":["locations"],"summary":"Update Usage Periods","description":"Set only a location's home/external usage calendar. Narrower than the full\nlocation PUT: needs ``manage_usage`` (or ``manage_settings``), never touches\nthe mobile toggle / tariff / name, and is scoped to locations the caller can\nsee. Powers the Dashboard's on-page calendar editor.","operationId":"update_usage_periods_api_locations__location_id__usage_periods_put","parameters":[{"name":"location_id","in":"path","required":true,"schema":{"type":"string","title":"Location Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsagePeriodsIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Update Usage Periods Api Locations  Location Id  Usage Periods Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/locations/{location_id}/rooms":{"put":{"tags":["locations"],"summary":"Update Rooms","description":"Replace a location's room list. Rooms are matched by id: a renamed room\ncarries its devices along (their ``room`` is the name), a removed one\nleaves its devices without a room and its heating zone unlinked. Rooms\ndescribe; nothing here moves a relay or a valve, so no CONTROL.","operationId":"update_rooms_api_locations__location_id__rooms_put","parameters":[{"name":"location_id","in":"path","required":true,"schema":{"type":"string","title":"Location Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoomsIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Update Rooms Api Locations  Location Id  Rooms Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/locations/{location_id}/wifi-recovery":{"get":{"tags":["meross-recovery"],"summary":"Get Wifi","operationId":"get_wifi_api_locations__location_id__wifi_recovery_get","parameters":[{"name":"location_id","in":"path","required":true,"schema":{"type":"string","title":"Location Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["meross-recovery"],"summary":"Put Wifi","operationId":"put_wifi_api_locations__location_id__wifi_recovery_put","parameters":[{"name":"location_id","in":"path","required":true,"schema":{"type":"string","title":"Location Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WifiIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/devices/{device_id}/wifi-recovery":{"get":{"tags":["meross-recovery"],"summary":"Status","operationId":"status_api_devices__device_id__wifi_recovery_get","parameters":[{"name":"device_id","in":"path","required":true,"schema":{"type":"string","title":"Device Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/devices/{device_id}/wifi-recovery/preflight":{"post":{"tags":["meross-recovery"],"summary":"Preflight","operationId":"preflight_api_devices__device_id__wifi_recovery_preflight_post","parameters":[{"name":"device_id","in":"path","required":true,"schema":{"type":"string","title":"Device Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/devices/{device_id}/wifi-recovery/execute":{"post":{"tags":["meross-recovery"],"summary":"Execute","operationId":"execute_api_devices__device_id__wifi_recovery_execute_post","parameters":[{"name":"device_id","in":"path","required":true,"schema":{"type":"string","title":"Device Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecuteIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/devices/{device_id}/wifi-recovery/automation":{"put":{"tags":["meross-recovery"],"summary":"Automation","operationId":"automation_api_devices__device_id__wifi_recovery_automation_put","parameters":[{"name":"device_id","in":"path","required":true,"schema":{"type":"string","title":"Device Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnableIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/gaps":{"get":{"tags":["recovery"],"summary":"Gaps","description":"Unfilled downtime gaps overlapping the window, for charts to shade. Scoped\nto the caller's visible devices (a restricted user must not learn about gaps\non devices they can't see), matching the time-series routes.","operationId":"gaps_api_gaps_get","parameters":[{"name":"device","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Device"}},{"name":"start","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Start"}},{"name":"end","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"End"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Gaps Api Gaps Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/recovery/backfill":{"post":{"tags":["recovery"],"summary":"Trigger Backfill","description":"Manually pull missed data from Tuya Cloud logs. Guarded by manage_settings\n(it depends on cloud credentials and affects stored data globally).","operationId":"trigger_backfill_api_recovery_backfill_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BackfillIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Trigger Backfill Api Recovery Backfill Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/load-shedding":{"get":{"tags":["load-shedding"],"summary":"List Sites","operationId":"list_sites_api_load_shedding_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response List Sites Api Load Shedding Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/load-shedding/{location_id}":{"put":{"tags":["load-shedding"],"summary":"Update Site","operationId":"update_site_api_load_shedding__location_id__put","parameters":[{"name":"location_id","in":"path","required":true,"schema":{"type":"string","title":"Location Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoadShedding"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Update Site Api Load Shedding  Location Id  Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/load-shedding/{location_id}/restore":{"post":{"tags":["load-shedding"],"summary":"Restore All","operationId":"restore_all_api_load_shedding__location_id__restore_post","parameters":[{"name":"location_id","in":"path","required":true,"schema":{"type":"string","title":"Location Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Restore All Api Load Shedding  Location Id  Restore Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/load-shedding/{location_id}/keep-on":{"post":{"tags":["load-shedding"],"summary":"Keep On","description":"Exempt one device from switch-offs for a while (\"Turn on and keep on\").\n\nSwitches nothing itself: the page turns the relay on through the manual\ncontrol, which settles a shed this controller still holds. Asked for\nBEFORE that switch-on, so the next tick cannot switch it straight off.\nNeeds CONTROL, as the switch it goes with does.","operationId":"keep_on_api_load_shedding__location_id__keep_on_post","parameters":[{"name":"location_id","in":"path","required":true,"schema":{"type":"string","title":"Location Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeepOnIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Keep On Api Load Shedding  Location Id  Keep On Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/load-shedding/{location_id}/test-mail":{"post":{"tags":["load-shedding"],"summary":"Test Mail","operationId":"test_mail_api_load_shedding__location_id__test_mail_post","parameters":[{"name":"location_id","in":"path","required":true,"schema":{"type":"string","title":"Location Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Test Mail Api Load Shedding  Location Id  Test Mail Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/watchdog":{"get":{"tags":["watchdog"],"summary":"List Sites","operationId":"list_sites_api_watchdog_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response List Sites Api Watchdog Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/watchdog/{location_id}":{"put":{"tags":["watchdog"],"summary":"Update Site","operationId":"update_site_api_watchdog__location_id__put","parameters":[{"name":"location_id","in":"path","required":true,"schema":{"type":"string","title":"Location Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Watchdog"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Update Site Api Watchdog  Location Id  Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/watchdog/{location_id}/devices/{device_id}/reset":{"post":{"tags":["watchdog"],"summary":"Reset","operationId":"reset_api_watchdog__location_id__devices__device_id__reset_post","parameters":[{"name":"location_id","in":"path","required":true,"schema":{"type":"string","title":"Location Id"}},{"name":"device_id","in":"path","required":true,"schema":{"type":"string","title":"Device Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Reset Api Watchdog  Location Id  Devices  Device Id  Reset Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/watchdog/{location_id}/test-mail":{"post":{"tags":["watchdog"],"summary":"Test Mail","operationId":"test_mail_api_watchdog__location_id__test_mail_post","parameters":[{"name":"location_id","in":"path","required":true,"schema":{"type":"string","title":"Location Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Test Mail Api Watchdog  Location Id  Test Mail Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/heating/{location_id}":{"get":{"tags":["heating"],"summary":"Get Site","operationId":"get_site_api_heating__location_id__get","parameters":[{"name":"location_id","in":"path","required":true,"schema":{"type":"string","title":"Location Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Site Api Heating  Location Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["heating"],"summary":"Update Site","operationId":"update_site_api_heating__location_id__put","parameters":[{"name":"location_id","in":"path","required":true,"schema":{"type":"string","title":"Location Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Heating"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Update Site Api Heating  Location Id  Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/heating/{location_id}/test-mail":{"post":{"tags":["heating"],"summary":"Test Mail","description":"A test of the pre-heating alert path, as load control and the watchdog\noffer: the page's mail hint points at it.","operationId":"test_mail_api_heating__location_id__test_mail_post","parameters":[{"name":"location_id","in":"path","required":true,"schema":{"type":"string","title":"Location Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Test Mail Api Heating  Location Id  Test Mail Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/heating/{location_id}/zones/{zone_id}/override":{"post":{"tags":["heating"],"summary":"Set Override","operationId":"set_override_api_heating__location_id__zones__zone_id__override_post","parameters":[{"name":"location_id","in":"path","required":true,"schema":{"type":"string","title":"Location Id"}},{"name":"zone_id","in":"path","required":true,"schema":{"type":"string","title":"Zone Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OverrideIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Set Override Api Heating  Location Id  Zones  Zone Id  Override Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["heating"],"summary":"Clear Override","operationId":"clear_override_api_heating__location_id__zones__zone_id__override_delete","parameters":[{"name":"location_id","in":"path","required":true,"schema":{"type":"string","title":"Location Id"}},{"name":"zone_id","in":"path","required":true,"schema":{"type":"string","title":"Zone Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Clear Override Api Heating  Location Id  Zones  Zone Id  Override Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/heating/{location_id}/zones/{zone_id}/learned-rate":{"get":{"tags":["heating"],"summary":"Learned Rate","description":"What the zone's own warm-ups say its pre-heat rate is (app.heating_learn).\nA proposal with its evidence; applying it is an ordinary heating PUT.","operationId":"learned_rate_api_heating__location_id__zones__zone_id__learned_rate_get","parameters":[{"name":"location_id","in":"path","required":true,"schema":{"type":"string","title":"Location Id"}},{"name":"zone_id","in":"path","required":true,"schema":{"type":"string","title":"Zone Id"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":30,"title":"Days"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Learned Rate Api Heating  Location Id  Zones  Zone Id  Learned Rate Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/push/config":{"get":{"tags":["push"],"summary":"Push Config","description":"What a browser needs to subscribe. The keypair is made on first ask.","operationId":"push_config_api_push_config_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Push Config Api Push Config Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/push/subscriptions":{"get":{"tags":["push"],"summary":"List Subscriptions","operationId":"list_subscriptions_api_push_subscriptions_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response List Subscriptions Api Push Subscriptions Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["push"],"summary":"Subscribe","operationId":"subscribe_api_push_subscriptions_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscribeIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Subscribe Api Push Subscriptions Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/push/subscriptions/{sub_id}":{"delete":{"tags":["push"],"summary":"Unsubscribe","operationId":"unsubscribe_api_push_subscriptions__sub_id__delete","parameters":[{"name":"sub_id","in":"path","required":true,"schema":{"type":"string","title":"Sub Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Unsubscribe Api Push Subscriptions  Sub Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/push/test":{"post":{"tags":["push"],"summary":"Send Test","description":"A test push to every subscription of the caller, whatever their\npreferences say: it answers \"does this browser receive\", nothing else.","operationId":"send_test_api_push_test_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Send Test Api Push Test Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/push/preferences":{"get":{"tags":["push"],"summary":"Get Preferences","operationId":"get_preferences_api_push_preferences_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Preferences Api Push Preferences Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["push"],"summary":"Set Preferences","operationId":"set_preferences_api_push_preferences_put","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Preferences"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Set Preferences Api Push Preferences Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/push/settings":{"get":{"tags":["push"],"summary":"Get Settings","operationId":"get_settings_api_push_settings_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Settings Api Push Settings Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["push"],"summary":"Set Settings","description":"The contact push services may use about this sender. Only the subject:\nthe keypair is never accepted from a client (a new one would orphan every\nsubscription, and an imported one is a secret travelling the wire).","operationId":"set_settings_api_push_settings_put","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PushSettingsIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Set Settings Api Push Settings Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/views":{"get":{"tags":["views"],"summary":"List Views","operationId":"list_views_api_views_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response List Views Api Views Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["views"],"summary":"Create View","operationId":"create_view_api_views_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ViewIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Create View Api Views Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/views/{view_id}":{"patch":{"tags":["views"],"summary":"Update View","operationId":"update_view_api_views__view_id__patch","parameters":[{"name":"view_id","in":"path","required":true,"schema":{"type":"string","title":"View Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ViewPatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Update View Api Views  View Id  Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["views"],"summary":"Delete View","operationId":"delete_view_api_views__view_id__delete","parameters":[{"name":"view_id","in":"path","required":true,"schema":{"type":"string","title":"View Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Delete View Api Views  View Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stats/heating":{"get":{"tags":["heating-usage"],"summary":"Heating Stats","description":"Per-room heating demand-hours (measured, or estimated from setpoint vs\ntemperature), an estimated kWh when calibrated by meter readings, and\nheating degree days. Calendar periods are cut on the heating clock.","operationId":"heating_stats_api_stats_heating_get","parameters":[{"name":"location","in":"query","required":true,"schema":{"type":"string","title":"Location"}},{"name":"start","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Start"}},{"name":"end","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"End"}},{"name":"period","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^(month|last-month|season|12m)$"},{"type":"null"}],"title":"Period"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Heating Stats Api Stats Heating Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/heating/{location_id}/meter-readings":{"get":{"tags":["heating-usage"],"summary":"Get Readings","operationId":"get_readings_api_heating__location_id__meter_readings_get","parameters":[{"name":"location_id","in":"path","required":true,"schema":{"type":"string","title":"Location Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Readings Api Heating  Location Id  Meter Readings Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["heating-usage"],"summary":"Put Readings","description":"Replace the location's meter readings and coordinates. Validated as a\nmeter counter: dates unique, kWh non-negative and never lower than an\nearlier reading.","operationId":"put_readings_api_heating__location_id__meter_readings_put","parameters":[{"name":"location_id","in":"path","required":true,"schema":{"type":"string","title":"Location Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HeatingUsage"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Put Readings Api Heating  Location Id  Meter Readings Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/onboarding/tado/cloud/login":{"post":{"tags":["tado"],"summary":"Cloud Login","operationId":"cloud_login_api_onboarding_tado_cloud_login_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Cloud Login Api Onboarding Tado Cloud Login Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["tado"],"summary":"Cloud Logout","description":"Remove the stored refresh token. \"Blank means keep\" protects a redacted\nround-trip, but a credential also needs a way OUT.","operationId":"cloud_logout_api_onboarding_tado_cloud_login_delete","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Cloud Logout Api Onboarding Tado Cloud Login Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/onboarding/tado/cloud/login/{login_id}/poll":{"post":{"tags":["tado"],"summary":"Cloud Login Poll","operationId":"cloud_login_poll_api_onboarding_tado_cloud_login__login_id__poll_post","parameters":[{"name":"login_id","in":"path","required":true,"schema":{"type":"string","title":"Login Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Cloud Login Poll Api Onboarding Tado Cloud Login  Login Id  Poll Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/onboarding/tado/cloud/rooms":{"get":{"tags":["tado"],"summary":"Cloud Rooms","description":"Every room of the tado home, with names and device serials. Admin\nonly, like the login it is read with: the home is the whole installation\nand maps to no one location, so a location-scoped manager would otherwise\nenumerate rooms at every site. (Node listing still gives them the room\nGUESS for their own valves, which is a single id, not the inventory.)\n\n409 while no home is chosen: rooms are listed for import, and importing\nfrom a home picked on the user's behalf is the multi-home bug.","operationId":"cloud_rooms_api_onboarding_tado_cloud_rooms_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Cloud Rooms Api Onboarding Tado Cloud Rooms Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/config/tado":{"put":{"tags":["tado"],"summary":"Set Tado","operationId":"set_tado_api_config_tado_put","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TadoSettingsIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Set Tado Api Config Tado Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/locations/{location_id}/matter":{"put":{"tags":["tado"],"summary":"Set Location Matter","operationId":"set_location_matter_api_locations__location_id__matter_put","parameters":[{"name":"location_id","in":"path","required":true,"schema":{"type":"string","title":"Location Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MatterIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Set Location Matter Api Locations  Location Id  Matter Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/onboarding/tado/matter/{location_id}/test":{"post":{"tags":["tado"],"summary":"Test Matter","description":"Connect once and read server_info. Tests the given url/token (unsaved\nform values; a blank token uses the stored one for the same url), or the\nsaved link with no body.","operationId":"test_matter_api_onboarding_tado_matter__location_id__test_post","parameters":[{"name":"location_id","in":"path","required":true,"schema":{"type":"string","title":"Location Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/MatterIn"},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Test Matter Api Onboarding Tado Matter  Location Id  Test Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/onboarding/tado/matter/{location_id}/nodes":{"get":{"tags":["tado"],"summary":"Matter Nodes","operationId":"matter_nodes_api_onboarding_tado_matter__location_id__nodes_get","parameters":[{"name":"location_id","in":"path","required":true,"schema":{"type":"string","title":"Location Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Matter Nodes Api Onboarding Tado Matter  Location Id  Nodes Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/onboarding/tado/matter/{location_id}/commission":{"post":{"tags":["tado"],"summary":"Matter Commission","operationId":"matter_commission_api_onboarding_tado_matter__location_id__commission_post","parameters":[{"name":"location_id","in":"path","required":true,"schema":{"type":"string","title":"Location Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommissionIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Matter Commission Api Onboarding Tado Matter  Location Id  Commission Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tado/status":{"get":{"tags":["tado"],"summary":"Tado Status","operationId":"tado_status_api_tado_status_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Tado Status Api Tado Status Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/locations/{location_id}/unifi":{"get":{"tags":["unifi"],"summary":"Get Location Unifi","operationId":"get_location_unifi_api_locations__location_id__unifi_get","parameters":[{"name":"location_id","in":"path","required":true,"schema":{"type":"string","title":"Location Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Location Unifi Api Locations  Location Id  Unifi Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["unifi"],"summary":"Set Location Unifi","operationId":"set_location_unifi_api_locations__location_id__unifi_put","parameters":[{"name":"location_id","in":"path","required":true,"schema":{"type":"string","title":"Location Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnifiIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Set Location Unifi Api Locations  Location Id  Unifi Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/onboarding/unifi/{location_id}/test":{"post":{"tags":["unifi"],"summary":"Test Unifi","description":"Read the Protect version and count the sensors, once. Tests the given\nurl/key (unsaved form values; a blank key uses the stored one for the same\nconsole), or the saved link with no body.","operationId":"test_unifi_api_onboarding_unifi__location_id__test_post","parameters":[{"name":"location_id","in":"path","required":true,"schema":{"type":"string","title":"Location Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/UnifiIn"},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Test Unifi Api Onboarding Unifi  Location Id  Test Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/onboarding/unifi/{location_id}/sensors":{"get":{"tags":["unifi"],"summary":"Unifi Sensors","description":"The console's sensors, each with the device already reading it (if any)\nand what an import would be tagged. From the live link's cache when it is\nup, else one direct read (a link saved a moment ago is still connecting).","operationId":"unifi_sensors_api_onboarding_unifi__location_id__sensors_get","parameters":[{"name":"location_id","in":"path","required":true,"schema":{"type":"string","title":"Location Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Unifi Sensors Api Onboarding Unifi  Location Id  Sensors Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/unifi/status":{"get":{"tags":["unifi"],"summary":"Unifi Status","operationId":"unifi_status_api_unifi_status_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Unifi Status Api Unifi Status Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/devices/{device_id}/thermostat":{"post":{"tags":["actions"],"summary":"Thermostat","operationId":"thermostat_api_devices__device_id__thermostat_post","parameters":[{"name":"device_id","in":"path","required":true,"schema":{"type":"string","title":"Device Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThermostatIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Thermostat Api Devices  Device Id  Thermostat Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/devices/{device_id}/control":{"post":{"tags":["actions"],"summary":"Control","operationId":"control_api_devices__device_id__control_post","parameters":[{"name":"device_id","in":"path","required":true,"schema":{"type":"string","title":"Device Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ControlIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Control Api Devices  Device Id  Control Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/health":{"get":{"summary":"Health","description":"Liveness probe. Returns 503 when the poller supervisor isn't running so a\nDocker HEALTHCHECK (and the autoheal watchdog) can restart a wedged\ncontainer — a dead process or hung event loop won't answer at all, and a\ncrashed poller behind a still-serving web layer reports degraded here.","operationId":"health_api_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/{full_path}":{"get":{"summary":"Spa","operationId":"spa__full_path__get","parameters":[{"name":"full_path","in":"path","required":true,"schema":{"type":"string","title":"Full Path"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"ActionsEnabledIn":{"properties":{"enabled":{"type":"boolean","title":"Enabled"}},"type":"object","required":["enabled"],"title":"ActionsEnabledIn"},"AiIn":{"properties":{"enabled":{"type":"boolean","title":"Enabled","default":false},"api_key":{"type":"string","title":"Api Key","default":""},"model":{"type":"string","title":"Model","default":"claude-opus-5"},"clear_key":{"type":"boolean","title":"Clear Key","default":false}},"type":"object","title":"AiIn","description":"The settings, plus an explicit \"forget the key\" switch.\n\nNeeded because \"blank means keep\" — the rule every credential in this file\nfollows, so a redacted round-trip can't wipe a secret — leaves no way to\nREMOVE one. For a key the user may want to revoke that is not a small gap:\nturning the feature off stops it being used, but the credential stays on\ndisk. So clearing is a separate, explicit instruction rather than an\noverloaded empty string."},"BackfillIn":{"properties":{"device_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Device Ids"},"start":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Start"},"end":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"End"}},"type":"object","title":"BackfillIn"},"CloudCreds":{"properties":{"region":{"type":"string","title":"Region","default":"eu"},"api_key":{"type":"string","title":"Api Key","default":""},"api_secret":{"type":"string","title":"Api Secret","default":""}},"type":"object","title":"CloudCreds"},"CloudFetchIn":{"properties":{"region":{"type":"string","title":"Region","default":"eu"},"api_key":{"type":"string","title":"Api Key","default":""},"api_secret":{"type":"string","title":"Api Secret","default":""},"device_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Device Ids"}},"type":"object","title":"CloudFetchIn"},"CommissionIn":{"properties":{"code":{"type":"string","maxLength":256,"minLength":8,"title":"Code"}},"type":"object","required":["code"],"title":"CommissionIn"},"ControlIn":{"properties":{"action":{"type":"string","enum":["on","off"],"title":"Action"},"confirm_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Confirm Token"}},"type":"object","required":["action"],"title":"ControlIn"},"DemoRemoveIn":{"properties":{"confirm":{"type":"boolean","title":"Confirm"}},"type":"object","required":["confirm"],"title":"DemoRemoveIn"},"DeviceConfig":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"type":{"type":"string","enum":["plug","meter","sensor","air","light","switch","meter_head","thermostat"],"title":"Type","default":"plug"},"enabled":{"type":"boolean","title":"Enabled","default":true},"allow_expected_absence":{"type":"boolean","title":"Allow Expected Absence","default":false},"vendor":{"type":"string","enum":["tuya","meross","tasmota","tado","unifi"],"title":"Vendor","default":"tuya"},"ip":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ip"},"local_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Local Key"},"version":{"type":"string","title":"Version","default":"3.3"},"channel":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Channel"},"meross_uuid":{"anyOf":[{"type":"string","pattern":"^[a-fA-F0-9]{32}$"},{"type":"null"}],"title":"Meross Uuid"},"matter_node_id":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Matter Node Id"},"matter_endpoint":{"type":"integer","minimum":0.0,"title":"Matter Endpoint","default":1},"tado_room_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Tado Room Id"},"tado_home_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Tado Home Id"},"unifi_sensor_id":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},{"type":"null"}],"title":"Unifi Sensor Id"},"profile":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Profile"},"dp_overrides":{"additionalProperties":{"anyOf":[{"$ref":"#/components/schemas/DpSpec"},{"$ref":"#/components/schemas/PackedSpec"}]},"type":"object","title":"Dp Overrides"},"energy_source":{"type":"string","enum":["auto","counter","power"],"title":"Energy Source","default":"auto"},"event_thresholds":{"additionalProperties":{"$ref":"#/components/schemas/ThresholdSpec"},"type":"object","title":"Event Thresholds"},"fault_map":{"anyOf":[{"$ref":"#/components/schemas/FaultMap"},{"type":"string"},{"type":"null"}],"title":"Fault Map"},"room":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Room"},"group":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Group"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags"},"location_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Location Id"},"parent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Id"},"poll_interval":{"type":"number","minimum":1.0,"title":"Poll Interval","default":5.0},"include_in_totals":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Include In Totals"},"exclude_from_accounting":{"type":"boolean","title":"Exclude From Accounting","default":false},"single_load":{"type":"boolean","title":"Single Load","default":false}},"type":"object","required":["id","name"],"title":"DeviceConfig"},"DpSpec":{"properties":{"metric":{"type":"string","title":"Metric"},"scale":{"type":"number","title":"Scale","default":1.0},"offset":{"type":"number","title":"Offset","default":0.0},"expr":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expr"}},"type":"object","required":["metric"],"title":"DpSpec","description":"How one DP that carries a single number maps to a canonical metric."},"EnableIn":{"properties":{"enabled":{"type":"boolean","title":"Enabled"},"confirmed_pairing_and_power":{"type":"boolean","title":"Confirmed Pairing And Power","default":false}},"type":"object","required":["enabled"],"title":"EnableIn"},"ExecuteIn":{"properties":{"token":{"type":"string","title":"Token"},"bssid":{"type":"string","title":"Bssid"}},"type":"object","required":["token","bssid"],"title":"ExecuteIn"},"FaultMap":{"properties":{"dp":{"type":"string","title":"Dp"},"kind":{"type":"string","enum":["enum","bitmap"],"title":"Kind","default":"enum"},"map":{"additionalProperties":{"type":"string"},"type":"object","title":"Map"}},"type":"object","required":["dp"],"title":"FaultMap","description":"How a device encodes protection events on one data point — for devices\nwhose event DP isn't the plain canonical fault bitmap (e.g. TONGOU/TOMZN DIN\nbreakers report a \"Last MCU Event\" enum). Decoded into the canonical ``fault``\nbitmap so the detector handles it unchanged.\n\n``dp`` is the raw DP id (local mode) or Tuya status code (cloud mode) carrying\nthe event. ``kind``:\n  * ``enum`` — the value is a single state: a string code in cloud mode, or an\n    integer option index in local mode. ``map`` maps that value (as a string\n    key, matched case-insensitively) to a canonical alarm code.\n  * ``bitmap`` — an integer whose set bits are active alarms. ``map`` remaps a\n    device bit index (string key) to a canonical code; omit it when the device\n    already uses the canonical bit order.\nUnmapped values/bits are treated as \"no alarm\". Canonical codes are those in\n``app.events`` (over_current, over_voltage, under_voltage, over_power,\nover_temperature, leakage_current, short_circuit, overload, power_failure)."},"GridTariff":{"properties":{"enabled":{"type":"boolean","title":"Enabled","default":false},"network_price_per_kwh":{"type":"number","minimum":0.0,"title":"Network Price Per Kwh","default":0.0},"network_loss_price_per_kwh":{"type":"number","minimum":0.0,"title":"Network Loss Price Per Kwh","default":0.0},"power_price_per_kw_month":{"type":"number","minimum":0.0,"title":"Power Price Per Kw Month","default":0.0},"power_price_above_10kw_per_kw_month":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Power Price Above 10Kw Per Kw Month"},"minimum_billable_kw":{"type":"number","minimum":0.0,"title":"Minimum Billable Kw","default":2.0},"power_price_valid_from":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Power Price Valid From","default":"2027-01-01"},"contracted_kw":{"type":"number","exclusiveMinimum":0.0,"title":"Contracted Kw","default":10.0},"timezone":{"type":"string","title":"Timezone","default":"Europe/Vienna"},"snap":{"$ref":"#/components/schemas/ReducedWindow"},"winap":{"$ref":"#/components/schemas/ReducedWindow"}},"type":"object","title":"GridTariff","description":"Network charges per the Austrian SNE-G-V (Systemnutzungsentgelte-\nGrundsatz-Verordnung). Defaults follow the regulation; the PRICES default to\nzero because they differ per network area and are set by the annual\nSystemnutzungsentgelte-Tarifverordnung.\n\nWhen enabled, ``network_price_per_kwh`` is billed ON TOP of\n``Tariff.price_per_kwh`` — which then means the supplier's energy price only,\nas on an Austrian bill that lists Energie and Netz separately."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HeatMeterReading":{"properties":{"date":{"type":"string","format":"date","title":"Date"},"kwh":{"type":"number","minimum":0.0,"title":"Kwh"},"note":{"type":"string","maxLength":200,"title":"Note","default":""}},"type":"object","required":["date","kwh"],"title":"HeatMeterReading","description":"A heat meter's counter as read by hand (meter display or the Wien\nEnergie bill), at local midnight of ``date`` on the heating clock."},"Heating":{"properties":{"enabled":{"type":"boolean","title":"Enabled","default":false},"dry_run":{"type":"boolean","title":"Dry Run","default":false},"timezone":{"type":"string","title":"Timezone","default":"Europe/Vienna"},"min_write_interval_s":{"type":"integer","maximum":3600.0,"minimum":30.0,"title":"Min Write Interval S","default":120},"zones":{"items":{"$ref":"#/components/schemas/HeatingZone"},"type":"array","title":"Zones"},"notify":{"items":{"type":"string"},"type":"array","title":"Notify"},"holidays":{"items":{"$ref":"#/components/schemas/Holiday"},"type":"array","title":"Holidays"}},"type":"object","title":"Heating","description":"Schedules owned by HomeInsight (app.heating). Off by default; honours\nthe global actions_enabled kill-switch like every automation."},"HeatingBlock":{"properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$","title":"Start"},"setpoint_c":{"type":"number","maximum":30.0,"minimum":5.0,"title":"Setpoint C"}},"type":"object","required":["start","setpoint_c"],"title":"HeatingBlock","description":"From `start` (local \"HH:MM\" on the heating clock) until the next block,\nhold `setpoint_c`. A day's first block also covers the time before it,\ncarried over from the previous day's last block."},"HeatingUsage":{"properties":{"meter_readings":{"items":{"$ref":"#/components/schemas/HeatMeterReading"},"type":"array","title":"Meter Readings"},"latitude":{"anyOf":[{"type":"number","maximum":90.0,"minimum":-90.0},{"type":"null"}],"title":"Latitude"},"longitude":{"anyOf":[{"type":"number","maximum":180.0,"minimum":-180.0},{"type":"null"}],"title":"Longitude"}},"type":"object","title":"HeatingUsage","description":"Inputs for heating usage (app.heating_usage). Its own block, not part of\n``Heating``: the heating PUT replaces that block whole, so a schedule saved\nfrom a page loaded before a reading was entered would erase the reading.\n\nHeat is never energy here: these readings calibrate an ESTIMATE of each\nroom's share, and nothing reads them into electricity totals or tariffs."},"HeatingZone":{"properties":{"id":{"type":"string","maxLength":64,"minLength":1,"title":"Id"},"name":{"type":"string","title":"Name","default":""},"enabled":{"type":"boolean","title":"Enabled","default":true},"room_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Room Id"},"members":{"items":{"type":"string"},"type":"array","title":"Members"},"schedule":{"additionalProperties":{"items":{"$ref":"#/components/schemas/HeatingBlock"},"type":"array"},"propertyNames":{"enum":["mon","tue","wed","thu","fri","sat","sun"]},"type":"object","title":"Schedule"},"frost_c":{"type":"number","maximum":15.0,"minimum":5.0,"title":"Frost C","default":7.0},"override_policy":{"type":"string","enum":["until_next_block","duration","until_resume"],"title":"Override Policy","default":"until_next_block"},"override_hours":{"type":"number","maximum":72.0,"exclusiveMinimum":0.0,"title":"Override Hours","default":2.0},"reference_sensors":{"items":{"type":"string"},"type":"array","title":"Reference Sensors"},"reference_tolerance_k":{"type":"number","maximum":10.0,"exclusiveMinimum":0.0,"title":"Reference Tolerance K","default":1.5},"preheat":{"$ref":"#/components/schemas/Preheat"}},"type":"object","required":["id"],"title":"HeatingZone","description":"A room: the thermostats in `members` are driven to one target."},"HistoryRepair":{"properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Id"},"start_ts":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Start Ts"},"end_ts":{"type":"integer","title":"End Ts"}},"type":"object","required":["end_ts"],"title":"HistoryRepair"},"Holiday":{"properties":{"name":{"type":"string","maxLength":80,"title":"Name","default":""},"start":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T([01]\\d|2[0-3]):[0-5]\\d$","title":"Start"},"end":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T([01]\\d|2[0-3]):[0-5]\\d$","title":"End"},"setpoint_c":{"type":"number","maximum":30.0,"minimum":5.0,"title":"Setpoint C","default":16.0},"zones":{"items":{"type":"string"},"type":"array","title":"Zones"}},"type":"object","required":["start","end"],"title":"Holiday","description":"Away from home: from ``start`` until ``end`` (local \"YYYY-MM-DDTHH:MM\" on\nthe heating clock, end exclusive) the zones in ``zones`` (none listed:\nevery zone) are held at MOST at ``setpoint_c``. It caps the schedule rather\nthan replacing it, so a block already colder (a night setback) stays\ncolder; the frost floor still applies, and a person's override still wins\n(a house-sitter turning a valve up). Its end is a change of target like a\nblock start, so a zone with pre-heating warms up for the return."},"KeepOnIn":{"properties":{"device_id":{"type":"string","title":"Device Id"},"minutes":{"anyOf":[{"type":"integer","maximum":10080.0,"minimum":1.0},{"type":"null"}],"title":"Minutes"},"clear":{"type":"boolean","title":"Clear","default":false}},"type":"object","required":["device_id"],"title":"KeepOnIn"},"LoadShedding":{"properties":{"enabled":{"type":"boolean","title":"Enabled","default":false},"dry_run":{"type":"boolean","title":"Dry Run","default":false},"shed_above_kw":{"type":"number","exclusiveMinimum":0.0,"title":"Shed Above Kw","default":9.9},"shed_target_kw":{"type":"number","exclusiveMinimum":0.0,"title":"Shed Target Kw","default":8.0},"trigger_after_s":{"type":"integer","maximum":900.0,"minimum":0.0,"title":"Trigger After S","default":15},"step_s":{"type":"integer","maximum":600.0,"minimum":2.0,"title":"Step S","default":10},"restore_mode":{"type":"string","enum":["auto","fixed"],"title":"Restore Mode","default":"auto"},"restore_below_kw":{"type":"number","minimum":0.0,"title":"Restore Below Kw","default":6.0},"history_hours":{"type":"integer","maximum":48.0,"minimum":1.0,"title":"History Hours","default":6},"min_off_s":{"type":"integer","maximum":86400.0,"minimum":0.0,"title":"Min Off S","default":300},"restore_step_s":{"type":"integer","maximum":3600.0,"minimum":10.0,"title":"Restore Step S","default":120},"devices":{"items":{"type":"string"},"type":"array","title":"Devices"},"notify":{"items":{"type":"string"},"type":"array","title":"Notify"}},"type":"object","title":"LoadShedding","description":"Keep a site's grid draw under the Leistungspreis band (see\n:mod:`app.load_shedding`).\n\nWhen the live load of the site's COUNTED devices stays above\n``shed_above_kw`` for ``trigger_after_s``, the devices in ``devices`` are\nswitched off one at a time, first entry first, until the load is at or below\n``shed_target_kw``. They come back last-off-first once there is room:\n``restore_mode=\"auto\"`` waits until the load plus what the device itself drew\nover the last ``history_hours`` fits under ``shed_target_kw``; ``\"fixed\"``\n(and any device with no power history) waits for ``restore_below_kw``.\n\nOff by default: nothing switches a relay until someone turns it on."},"LocateIn":{"properties":{"cidr":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cidr"},"device_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Device Ids"},"timeout":{"type":"number","title":"Timeout","default":1.5}},"type":"object","title":"LocateIn"},"LocationIn":{"properties":{"id":{"type":"string","minLength":1,"pattern":"^[^\\x00-\\x1f]+$","title":"Id"},"name":{"type":"string","minLength":1,"title":"Name"},"tariff":{"$ref":"#/components/schemas/Tariff"},"unmetered_group":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Unmetered Group"}},"type":"object","required":["id","name"],"title":"LocationIn"},"LocationOrder":{"properties":{"order":{"items":{"type":"string"},"type":"array","title":"Order"}},"type":"object","title":"LocationOrder"},"LocationPatch":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"unmetered_group":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Unmetered Group"},"tariff":{"anyOf":[{"$ref":"#/components/schemas/Tariff"},{"type":"null"}]},"tariff_change":{"anyOf":[{"type":"string","enum":["apply_from","correct"]},{"type":"null"}],"title":"Tariff Change"},"tariff_valid_from":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Tariff Valid From"},"scanner":{"anyOf":[{"$ref":"#/components/schemas/ScannerConfig"},{"type":"null"}]},"mobile":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Mobile"},"usage_periods":{"anyOf":[{"items":{"$ref":"#/components/schemas/UsagePeriod"},"type":"array"},{"type":"null"}],"title":"Usage Periods"}},"type":"object","title":"LocationPatch"},"LoginIn":{"properties":{"username":{"type":"string","title":"Username","default":""},"password":{"type":"string","title":"Password"}},"type":"object","required":["password"],"title":"LoginIn"},"MatterIn":{"properties":{"url":{"type":"string","title":"Url","default":""},"token":{"type":"string","title":"Token","default":""},"verify_tls":{"type":"boolean","title":"Verify Tls","default":false}},"type":"object","title":"MatterIn"},"MerossCreds":{"properties":{"region":{"type":"string","title":"Region","default":"eu"},"email":{"type":"string","title":"Email","default":""},"password":{"type":"string","title":"Password","default":""},"key":{"type":"string","title":"Key","default":""},"user_id":{"type":"string","title":"User Id","default":""},"cloud_fallback_enabled":{"type":"boolean","title":"Cloud Fallback Enabled","default":false},"lan_recovery_enabled":{"type":"boolean","title":"Lan Recovery Enabled","default":false},"cloud_poll_interval_s":{"type":"integer","minimum":60.0,"title":"Cloud Poll Interval S","default":60}},"type":"object","title":"MerossCreds","description":"Persisted Meross *account* credentials (distinct from Tuya's CloudCreds).\n\nMeross devices sign local traffic with an account ``key`` that only changes\nwhen the account password does, so it is durable: storing it here means the\nonboarding panel never has to re-run the rate-limited login. ``password``\nand ``key`` are secrets — redacted over the wire and reused server-side when\nleft blank, exactly like ``CloudCreds.api_secret`` and per-device local keys."},"MerossFallbackSettings":{"properties":{"cloud_fallback_enabled":{"type":"boolean","title":"Cloud Fallback Enabled"},"cloud_poll_interval_s":{"type":"integer","title":"Cloud Poll Interval S"},"lan_recovery_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Lan Recovery Enabled"}},"type":"object","required":["cloud_fallback_enabled","cloud_poll_interval_s"],"title":"MerossFallbackSettings"},"MerossKeyIn":{"properties":{"email":{"type":"string","title":"Email"},"password":{"type":"string","title":"Password","default":""},"region":{"type":"string","title":"Region","default":"eu"}},"type":"object","required":["email"],"title":"MerossKeyIn"},"MerossScanIn":{"properties":{"subnet":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subnet"},"timeout":{"type":"number","maximum":10.0,"minimum":0.2,"title":"Timeout","default":2.0},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"},"token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"},"location_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Location Id"}},"type":"object","title":"MerossScanIn"},"MerossTestIn":{"properties":{"ip":{"type":"string","title":"Ip"},"key":{"type":"string","title":"Key","default":""},"channel":{"type":"integer","title":"Channel","default":0},"protocol":{"type":"string","title":"Protocol","default":"auto"}},"type":"object","required":["ip"],"title":"MerossTestIn"},"ModeIn":{"properties":{"mode":{"type":"string","enum":["simulator","local","cloud"],"title":"Mode"},"remove_demo":{"type":"boolean","title":"Remove Demo","default":false},"erase_simulated":{"type":"boolean","title":"Erase Simulated","default":false}},"type":"object","required":["mode"],"title":"ModeIn"},"NamedFaultMap":{"properties":{"dp":{"type":"string","title":"Dp"},"kind":{"type":"string","enum":["enum","bitmap"],"title":"Kind","default":"enum"},"map":{"additionalProperties":{"type":"string"},"type":"object","title":"Map"},"name":{"type":"string","title":"Name"}},"type":"object","required":["dp","name"],"title":"NamedFaultMap","description":"A FaultMap plus the name it's stored under, for create."},"OverrideIn":{"properties":{"setpoint_c":{"type":"number","maximum":30.0,"minimum":5.0,"title":"Setpoint C"},"hours":{"anyOf":[{"type":"number","maximum":72.0,"exclusiveMinimum":0.0},{"type":"null"}],"title":"Hours"}},"type":"object","required":["setpoint_c"],"title":"OverrideIn"},"PackedField":{"properties":{"metric":{"type":"string","title":"Metric"},"start":{"type":"integer","minimum":0.0,"title":"Start","default":0},"length":{"type":"integer","maximum":8.0,"minimum":1.0,"title":"Length","default":2},"signed":{"type":"boolean","title":"Signed","default":false},"byteorder":{"anyOf":[{"type":"string","enum":["big","little"]},{"type":"null"}],"title":"Byteorder"},"scale":{"type":"number","title":"Scale","default":1.0},"offset":{"type":"number","title":"Offset","default":0.0},"expr":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expr"},"wrap_at":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Wrap At"},"wrap_above":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Wrap Above"}},"additionalProperties":false,"type":"object","required":["metric"],"title":"PackedField","description":"One number carved out of a packed data point's payload.\n\n``start``/``length`` are a byte slice of the DECODED payload; the slice is\nread as an integer, then run through the same ``scale``/``offset``/``expr``\ntransform a scalar :class:`DpSpec` uses.\n\nNOTE ``offset`` is that ADDITIVE transform, not a byte position — the byte\nposition is ``start``. (Easy to confuse; they are different things.)"},"PackedSpec":{"properties":{"fields":{"items":{"$ref":"#/components/schemas/PackedField"},"type":"array","minItems":1,"title":"Fields"},"encoding":{"type":"string","enum":["base64","hex"],"title":"Encoding","default":"base64"},"byteorder":{"type":"string","enum":["big","little"],"title":"Byteorder","default":"big"}},"additionalProperties":false,"type":"object","required":["fields"],"title":"PackedSpec","description":"How ONE data point carrying a packed binary payload maps to SEVERAL\ncanonical metrics.\n\nThis is the shape Tuya ``raw``-type DPs use on metering breakers (category\n``dlq``), where a whole phase's voltage, current and power arrive as one\nbase64 blob instead of three numeric DPs.\n\nLayouts are firmware-specific — the same vendor ships an 8-byte and an\n18-byte variant — so every offset/length/scale here is DATA, not code: a\ndevice that packs the DP differently is corrected with a per-device\n``dp_overrides`` entry, exactly like a wrong scale on a scalar DP."},"PasswordIn":{"properties":{"password":{"type":"string","title":"Password"},"allow_open":{"type":"boolean","title":"Allow Open","default":false}},"type":"object","required":["password"],"title":"PasswordIn"},"Preferences":{"properties":{"device_faults":{"type":"boolean","title":"Device Faults","default":true},"automations":{"type":"boolean","title":"Automations","default":true}},"type":"object","title":"Preferences"},"Preheat":{"properties":{"enabled":{"type":"boolean","title":"Enabled","default":false},"max_lead_min":{"type":"integer","maximum":600.0,"minimum":15.0,"title":"Max Lead Min","default":180},"rate_k_per_h":{"type":"number","maximum":10.0,"minimum":0.1,"title":"Rate K Per H","default":1.0},"outdoor_factor_per_k":{"type":"number","maximum":0.2,"minimum":0.0,"title":"Outdoor Factor Per K","default":0.03},"model":{"type":"string","enum":["linear","first_order"],"title":"Model","default":"linear"},"tau_h":{"type":"number","maximum":24.0,"minimum":0.1,"title":"Tau H","default":1.5},"margin_k":{"type":"number","maximum":10.0,"minimum":0.1,"title":"Margin K","default":1.0}},"type":"object","title":"Preheat","description":"Weather-led pre-heating (app.heating): when the next schedule block asks\nfor more heat, its setpoint starts early enough for the room to be there\nwhen the block begins. The lead is the deficit (block setpoint minus the\nvalves' temperature) over the warm-up rate, and the rate falls as it gets\ncolder outside: ``rate_k_per_h`` at 10 °C, changed by\n``outdoor_factor_per_k`` of itself per kelvin (bounded to 0.25x..2x),\nusing the forecast for the location's coordinates (``heating_usage``).\nNever above the block's own setpoint, never longer than ``max_lead_min``.\n\n``model`` \"first_order\" replaces the fixed rate with a room that closes in\non a temperature ``margin_k`` above the setpoint and slows as it nears it:\nthe lead is ``tau_h`` · ln(1 + deficit / ``margin_k``) hours, divided by\nthe same outdoor factor. A small top-up then takes nearly as long as a big\nwarm-up, which a fixed rate cannot say. \"linear\" (the default) is the\nfixed rate, so saved configs plan exactly as before."},"PushSettingsIn":{"properties":{"vapid_subject":{"type":"string","maxLength":320,"title":"Vapid Subject","default":""}},"type":"object","title":"PushSettingsIn"},"RecoveryConfig":{"properties":{"auto_backfill":{"type":"boolean","title":"Auto Backfill","default":true},"gap_threshold_s":{"type":"integer","minimum":60.0,"title":"Gap Threshold S","default":900},"max_backfill_days":{"type":"integer","minimum":1.0,"title":"Max Backfill Days","default":7}},"type":"object","title":"RecoveryConfig","description":"Downtime data recovery. When the service is stopped/crashes no polling\nhappens, leaving a gap in the series. If Tuya Cloud credentials are set we can\npull the missed window from the cloud device-log API (getdevicelog) and fill\nit in; gaps we can't fill (no creds, older than retention, device didn't\nreport) are recorded so charts show honest holes instead of bridging them."},"ReducedWindow":{"properties":{"enabled":{"type":"boolean","title":"Enabled","default":true},"discount_pct":{"type":"number","maximum":100.0,"minimum":0.0,"title":"Discount Pct","default":20.0},"start_month":{"type":"integer","maximum":12.0,"minimum":1.0,"title":"Start Month","default":4},"end_month":{"type":"integer","maximum":12.0,"minimum":1.0,"title":"End Month","default":9},"start_hour":{"type":"integer","maximum":23.0,"minimum":0.0,"title":"Start Hour","default":10},"end_hour":{"type":"integer","maximum":24.0,"minimum":1.0,"title":"End Hour","default":16},"valid_from":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Valid From"}},"type":"object","title":"ReducedWindow","description":"A seasonal time-of-day window in which the network work price is reduced\n(the Sommer-/Winter-Nieder-Arbeitspreis). Months and hours are LOCAL time and\nmay wrap: Oct–Mar is ``start_month=10, end_month=3``, 23:00–05:00 is\n``start_hour=23, end_hour=5``. Both ends of the month range are inclusive,\nthe hour range is half-open ``[start_hour, end_hour)``."},"RefreshKeysIn":{"properties":{"region":{"type":"string","title":"Region","default":"eu"},"api_key":{"type":"string","title":"Api Key","default":""},"api_secret":{"type":"string","title":"Api Secret","default":""},"device_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Device Ids"}},"type":"object","title":"RefreshKeysIn"},"ReportSubscription":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name","default":""},"enabled":{"type":"boolean","title":"Enabled","default":true},"recipients":{"items":{"type":"string"},"type":"array","title":"Recipients"},"device_ids":{"items":{"type":"string"},"type":"array","title":"Device Ids"},"location_ids":{"items":{"type":"string"},"type":"array","title":"Location Ids"},"time_frame":{"type":"string","enum":["1h","6h","24h","7d","30d","1y","previous_month","month_to_date"],"title":"Time Frame","default":"7d"},"fmt":{"type":"string","enum":["json","excel","pdf"],"title":"Fmt","default":"excel"},"formats":{"items":{"type":"string","enum":["json","excel","pdf"]},"type":"array","minItems":1,"title":"Formats"},"timezone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Timezone"},"frequency":{"type":"string","enum":["daily","weekly","monthly"],"title":"Frequency","default":"weekly"},"send_hour":{"type":"integer","maximum":23.0,"minimum":0.0,"title":"Send Hour","default":7},"day_of_week":{"type":"integer","maximum":6.0,"minimum":0.0,"title":"Day Of Week","default":0},"day_of_month":{"type":"integer","maximum":28.0,"minimum":1.0,"title":"Day Of Month","default":1},"tz_offset":{"type":"integer","exclusiveMaximum":1440.0,"exclusiveMinimum":-1440.0,"title":"Tz Offset","default":0},"include_measurements":{"type":"boolean","title":"Include Measurements","default":true}},"type":"object","required":["id"],"title":"ReportSubscription","description":"A scheduled email report. The report content is the same bundle the manual\nexport produces (see app/export_builder.py), scoped to ``device_ids`` and/or\n``location_ids`` (both empty = all visible), covering the chosen\n``time_frame`` window, rendered in ``formats``, and emailed to ``recipients`` on\nthe chosen ``frequency``.\n\nTiming uses the saved IANA ``timezone`` when present. Legacy ``tz_offset`` is the browser's\n``Date.getTimezoneOffset()`` (minutes, UTC minus local) captured at creation,\nmatching the convention used across stats/export."},"Room":{"properties":{"id":{"type":"string","maxLength":64,"minLength":1,"pattern":"^[A-Za-z0-9_-]+$","title":"Id"},"name":{"type":"string","maxLength":80,"minLength":1,"title":"Name"},"floor":{"anyOf":[{"type":"integer","maximum":50.0,"minimum":-5.0},{"type":"null"}],"title":"Floor"},"area_m2":{"anyOf":[{"type":"number","maximum":1000.0,"exclusiveMinimum":0.0},{"type":"null"}],"title":"Area M2"},"ceiling_m":{"anyOf":[{"type":"number","maximum":10.0,"minimum":1.5},{"type":"null"}],"title":"Ceiling M"},"outside_walls":{"items":{"type":"string","enum":["N","E","S","W"]},"type":"array","title":"Outside Walls"},"neighbours":{"items":{"type":"string"},"type":"array","title":"Neighbours"}},"type":"object","required":["id","name"],"title":"Room","description":"A room of a location. Devices name it by ``name`` (``DeviceConfig.room``,\nthe label every grouping prints), so a rename here is carried to them in the\nsame edit (``sync_rooms`` and the rooms route). The facts describe the room\nfor the heating: what it is next to, how big it is, where it loses heat.\nNone of them steers a write; they are evidence beside a learned rate."},"RoomsIn":{"properties":{"rooms":{"items":{"$ref":"#/components/schemas/Room"},"type":"array","title":"Rooms"},"known":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Known"}},"type":"object","title":"RoomsIn"},"ScanIn":{"properties":{"timeout":{"type":"integer","title":"Timeout","default":18},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"},"token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"},"location_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Location Id"}},"type":"object","title":"ScanIn"},"ScannerConfig":{"properties":{"url":{"type":"string","title":"Url","default":""},"token":{"type":"string","title":"Token","default":""}},"type":"object","title":"ScannerConfig","description":"A remote LAN-scan agent. Tuya discovery is UDP broadcast and doesn't cross\nsubnets, so when the server lives on a different network than the devices the\nadmin can point this at a small agent running on the device subnet; the scan\nis then proxied there. Empty url => scan this server's own LAN."},"SetupIn":{"properties":{"username":{"type":"string","minLength":1,"title":"Username"},"password":{"type":"string","minLength":1,"title":"Password"}},"type":"object","required":["username","password"],"title":"SetupIn"},"SmtpConfig":{"properties":{"host":{"type":"string","title":"Host","default":"localhost"},"port":{"type":"integer","title":"Port","default":25},"use_starttls":{"type":"boolean","title":"Use Starttls","default":false},"use_ssl":{"type":"boolean","title":"Use Ssl","default":false},"username":{"type":"string","title":"Username","default":""},"password":{"type":"string","title":"Password","default":""},"from_addr":{"type":"string","title":"From Addr","default":"homeinsight@localhost"},"verified":{"type":"boolean","title":"Verified","default":false},"last_test_ok":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Last Test Ok"},"last_test_ts":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Last Test Ts"},"last_test_message":{"type":"string","title":"Last Test Message","default":""}},"type":"object","title":"SmtpConfig","description":"Outgoing mail server for scheduled email reports. Defaults target a local,\nunauthenticated relay (``localhost:25``), the common home-server setup, so\nreports work out of the box. ``password`` is a secret — redacted over the wire\nand reused server-side when left blank, like ``CloudCreds.api_secret``."},"SmtpTestIn":{"properties":{"to":{"type":"string","title":"To"}},"type":"object","required":["to"],"title":"SmtpTestIn"},"SubscribeIn":{"properties":{"subscription":{"$ref":"#/components/schemas/SubscriptionInfo"},"label":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Label"}},"type":"object","required":["subscription"],"title":"SubscribeIn"},"SubscriptionInfo":{"properties":{"endpoint":{"type":"string","maxLength":2048,"minLength":1,"title":"Endpoint"},"keys":{"$ref":"#/components/schemas/SubscriptionKeys"}},"type":"object","required":["endpoint","keys"],"title":"SubscriptionInfo"},"SubscriptionKeys":{"properties":{"p256dh":{"type":"string","maxLength":256,"minLength":1,"title":"P256Dh"},"auth":{"type":"string","maxLength":64,"minLength":1,"title":"Auth"}},"type":"object","required":["p256dh","auth"],"title":"SubscriptionKeys"},"TadoSettingsIn":{"properties":{"cloud_fallback_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Cloud Fallback Enabled"},"quota_override":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Quota Override"},"home_id":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Home Id"}},"type":"object","title":"TadoSettingsIn"},"Tariff":{"properties":{"currency":{"type":"string","title":"Currency","default":"EUR"},"price_per_kwh":{"type":"number","title":"Price Per Kwh","default":0.3},"standing_charge_per_day":{"type":"number","title":"Standing Charge Per Day","default":0.0},"base_fee_per_month":{"type":"number","title":"Base Fee Per Month","default":0.0},"grid":{"$ref":"#/components/schemas/GridTariff"},"history":{"items":{"$ref":"#/components/schemas/TariffPeriod"},"type":"array","title":"History"}},"type":"object","title":"Tariff"},"TariffPeriod":{"properties":{"valid_until":{"type":"string","format":"date","title":"Valid Until"},"price_per_kwh":{"type":"number","title":"Price Per Kwh","default":0.3},"standing_charge_per_day":{"type":"number","title":"Standing Charge Per Day","default":0.0},"base_fee_per_month":{"type":"number","title":"Base Fee Per Month","default":0.0},"grid":{"$ref":"#/components/schemas/GridTariff"}},"type":"object","required":["valid_until"],"title":"TariffPeriod","description":"An earlier tariff: the cost-relevant fields of :class:`Tariff` (every\nfield ``stats.cost_for`` and ``grid_tariff`` read, the grid settings whole)\nplus the local date it stopped applying (exclusive)."},"TasmotaScanIn":{"properties":{"subnet":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subnet"},"timeout":{"type":"number","maximum":10.0,"minimum":0.2,"title":"Timeout","default":2.0},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"},"token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"},"location_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Location Id"}},"type":"object","title":"TasmotaScanIn"},"TasmotaTestIn":{"properties":{"ip":{"type":"string","title":"Ip"},"key":{"type":"string","title":"Key","default":""},"group":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Group"}},"type":"object","required":["ip"],"title":"TasmotaTestIn"},"TestIn":{"properties":{"id":{"type":"string","title":"Id"},"ip":{"type":"string","title":"Ip"},"local_key":{"type":"string","title":"Local Key"},"version":{"type":"string","title":"Version","default":"3.3"}},"type":"object","required":["id","ip","local_key"],"title":"TestIn"},"ThermostatIn":{"properties":{"setpoint_c":{"anyOf":[{"type":"number","maximum":30.0,"minimum":5.0},{"type":"null"}],"title":"Setpoint C"},"hvac_mode":{"anyOf":[{"type":"integer","enum":[0,1]},{"type":"null"}],"title":"Hvac Mode"},"confirm_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Confirm Token"}},"type":"object","title":"ThermostatIn"},"ThresholdSpec":{"properties":{"min":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Min"},"max":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Max"}},"type":"object","title":"ThresholdSpec","description":"A manual per-device event threshold for one canonical metric: fire an\nevent when the value drops below ``min`` (e.g. under-voltage) or rises above\n``max`` (e.g. over-current / over-power).\n\nEach bound is an independent, optional override. A bound left ``None`` is\n*not* overridden — for that side the detector falls through to the device's\nown reported alarm setpoint, then a built-in default (see :mod:`app.events`).\nSo ``ThresholdSpec(max=10)`` overrides only the upper limit and leaves the\nlower one to the setpoint/default."},"UnifiIn":{"properties":{"url":{"type":"string","title":"Url","default":""},"api_key":{"type":"string","title":"Api Key","default":""},"verify_tls":{"type":"boolean","title":"Verify Tls","default":true}},"type":"object","title":"UnifiIn"},"UsagePeriod":{"properties":{"start":{"type":"integer","title":"Start"},"end":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"End"},"state":{"type":"string","enum":["home","external"],"title":"State","default":"external"}},"type":"object","required":["start"],"title":"UsagePeriod","description":"A time range on a *mobile* location, classified ``home`` or ``external``.\n\nBoundaries are epoch seconds — ``start`` inclusive, ``end`` exclusive, and\n``end=None`` means open-ended (\"from ``start`` on\"). Absolute epochs (not\nlocal dates) keep them unambiguous even as a mobile site crosses time zones,\nand let a single calendar day carry both home and external ranges. Time not\ncovered by any period defaults to ``home`` (the baseline), so only the\nexceptions (typically the external stays) need to be recorded."},"UsagePeriodsIn":{"properties":{"usage_periods":{"items":{"$ref":"#/components/schemas/UsagePeriod"},"type":"array","title":"Usage Periods"}},"type":"object","title":"UsagePeriodsIn"},"UserIn":{"properties":{"username":{"type":"string","minLength":1,"title":"Username"},"password":{"type":"string","minLength":1,"title":"Password"},"role":{"type":"string","enum":["admin","user"],"title":"Role","default":"user"},"devices":{"items":{"type":"string"},"type":"array","title":"Devices"},"locations":{"items":{"type":"string"},"type":"array","title":"Locations"},"capabilities":{"items":{"type":"string"},"type":"array","title":"Capabilities"}},"type":"object","required":["username","password"],"title":"UserIn"},"UserPatch":{"properties":{"password":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Password"},"role":{"anyOf":[{"type":"string","enum":["admin","user"]},{"type":"null"}],"title":"Role"},"devices":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Devices"},"locations":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Locations"},"capabilities":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Capabilities"}},"type":"object","title":"UserPatch"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"ViewIn":{"properties":{"name":{"type":"string","maxLength":200,"title":"Name"},"path":{"type":"string","maxLength":2048,"title":"Path"}},"type":"object","required":["name","path"],"title":"ViewIn"},"ViewPatch":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Name"},"path":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}],"title":"Path"}},"type":"object","title":"ViewPatch"},"Watchdog":{"properties":{"devices":{"items":{"$ref":"#/components/schemas/WatchedDevice"},"type":"array","title":"Devices"},"notify":{"items":{"type":"string"},"type":"array","title":"Notify"}},"type":"object","title":"Watchdog","description":"A location's keep-on list. Empty by default: nothing is switched."},"WatchedDevice":{"properties":{"device_id":{"type":"string","title":"Device Id"},"enabled":{"type":"boolean","title":"Enabled","default":true},"delay_s":{"type":"integer","maximum":3600.0,"minimum":5.0,"title":"Delay S","default":30},"max_attempts":{"type":"integer","maximum":10.0,"minimum":1.0,"title":"Max Attempts","default":3},"window_min":{"type":"integer","maximum":1440.0,"minimum":1.0,"title":"Window Min","default":30},"restore_after_fault":{"type":"boolean","title":"Restore After Fault","default":true},"restore_unknown":{"type":"boolean","title":"Restore Unknown","default":true},"never_after":{"items":{"type":"string"},"type":"array","title":"Never After"}},"type":"object","required":["device_id"],"title":"WatchedDevice","description":"One device the watchdog keeps on (see :mod:`app.watchdog`)."},"WifiIn":{"properties":{"ssid":{"type":"string","title":"Ssid"},"password":{"type":"string","title":"Password","default":""},"clear_password":{"type":"boolean","title":"Clear Password","default":false}},"type":"object","required":["ssid"],"title":"WifiIn"}}}}