Repository navigation
Description
Problem
I regularly stay at more than one place and want HealthLog to use the right location. Today, /settings/environment stores a single home. I’d like to save multiple homes and select the active one either in settings or through the API. This would let scripts and automation platforms update my active home when I arrive.
Proposed solution
Settings and history
• Let users save multiple homes using the existing city search. The first saved home becomes active automatically. Additional homes are saved for later selection.
• Show which home is active and when it was activated. Give each saved home a Set as active action and a copyable, stable ID for API clients.
• Let users archive inactive homes while preserving the days already assigned to them.
• Switch the active home immediately. The last selection of the day applies to the whole day, using the existing UTC day boundary. If I switch from City A to City B and then back to City A on the same day, that day uses City A.
Earlier days retain their original assignments, including when environmental data is fetched again.
• Record home assignments automatically and use the existing Travel section for historical corrections. A travel period takes precedence over the home assignment for its date range and queues a refresh for those dates. Add a short note in settings explaining where to make those corrections.
Proposed API
• Extend GET /api/environment with homes and activeHomeId, keeping the existing home field for current clients.
• Add POST /api/environment/homes to save a home and DELETE /api/environment/homes/{id} to archive an inactive home. Preserve the existing PUT /api/environment/home request and response format.
• Add PUT /api/environment/homes/active with {"homeId":"…"}. Return the active ID and activation timestamp. Repeating the request for the already active home returns the same result without adding a history entry or queuing another refresh. Unknown, archived, and other accounts’ IDs return 404.
• Add a revocable API token with an environment:home:activate scope that grants access solely to the activation endpoint on the token owner’s account. Document the endpoint in OpenAPI and include a curl example that any API client can adapt.
Alternatives considered
No response
Affected surface
API, Web (PWA)
Additional context
No response
Pre-flight checks
- I confirmed this is not a duplicate of an existing feature request.
- I'm proposing a feature, not asking a usage question (those go to Discussions or the docs).
Activity
MBombeck commentedon Dec 1, 2026
Thanks @ferges123, this is a well thought-out proposal, and the use case makes sense to me: if you split your time between two places, the environment data should follow you without you having to remember to change a setting.
It won't make 1.50.0, which closes for features this week. I'd like to build it for 1.51.0 on January 2. Roughly along your lines:
I'd probably leave archiving out of the first version and add it if a list of old homes turns out to get in the way. If anything in that cut would break your setup, tell me before I start.
Refs #1759