Station tab: explain what the station is
Publish Container / publish (push) Successful in 2m13s

- 'What is this station?' card: a personal weather station measuring real conditions on site
  (not a forecast), how it differs from the Now tab, update cadence, what Live/Offline mean
- Lists the instruments this station actually reports (temp/humidity, wind, rain, pressure,
  sun, indoor), using the station's real name
- Open for new visitors, remembers once closed; empty state and Now-tab badge/tab hover explain it too

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Nate EmmertandClaude Sonnet 5.5 committed 2026-10-15 15:16:33 -04:00
1 parent eaff2f55c8
commit dde59e3865
3 files changed
+58 -3

No files matched your search

+41 -1
View File
@@ -52,6 +52,22 @@ const SHELL = `
<span class="sl-live" id="sl-live"><span class="sl-dot"></span><span id="sl-live-text">Live</span></span>
<span><span class="sl-time" id="sl-time"></span></span>
</div>
<details class="sl-about" id="sl-about">
<summary><span class="sl-about-ico">ⓘ</span><span>What is this station?</span><span class="sl-about-chev">›</span></summary>
<div class="sl-about-body">
<p><b id="sl-about-name">This station</b> is a <b>personal weather station</b>: real instruments on the owner's property that measure the weather <i>right here, right now</i>. These numbers are measurements, not a forecast or a computer model.</p>
<p class="sl-about-h">What it measures</p>
<ul id="sl-sensors" class="sl-sensors"><li>Waiting for the first reading…</li></ul>
<p class="sl-about-h">How it fits with the rest of the app</p>
<ul class="sl-sensors">
<li><b>Now</b> shows a forecast model for the city you picked. <b>Station</b> shows what one spot is actually measuring.</li>
<li>When you see <b>📡 Your station</b> on the Now tab, its temperature, wind and rain come from this station.</li>
<li>It reports about every minute or two. <b>Live</b> means the last reading is under 15 minutes old; <b>Offline</b> means older.</li>
<li>Because it's one spot, it can differ a little from the airport or the forecast, and that's normal.</li>
</ul>
<p class="sl-about-foot">History, records and charts, plus a side-by-side with the official National Weather Service station, are on the <a href="/dashboard">Station Dashboard</a> (sign-in required).</p>
</div>
</details>
<section class="sl-hero">
<div class="sl-hero-dots"></div><div class="sl-hero-sweep"></div><div class="sl-hero-ring"></div><div class="sl-hero-ring2"></div>
<div class="sl-hero-body">
@@ -109,10 +125,21 @@ const setAll = (sel, v) => root.querySelectorAll(sel).forEach((el) => { el.textC
let shellReady = false;
let lastDir = null;
// "What is this station?" starts open for new visitors and stays closed once dismissed
function initAbout() {
const d = $('sl-about');
if (!d) return;
let closed = false; try { closed = localStorage.getItem('stationAboutClosed') === '1'; } catch {}
d.open = !closed;
d.addEventListener('toggle', () => { try { localStorage.setItem('stationAboutClosed', d.open ? '0' : '1'); } catch {} });
}
function ensureShell() {
if (shellReady) return;
root.innerHTML = SHELL;
shellReady = true;
initAbout();
drawCompass(null, null);
}
@@ -178,6 +205,19 @@ window.renderStationTab = function renderStationTab(device) {
const name = (typeof state !== 'undefined' && state.stationName) || device.info?.name || 'My Station';
set('sl-name', name);
// Describe the instruments this particular station really has
set('sl-about-name', name);
const has = (...k) => k.some((f) => d[f] != null);
const sensors = [
has('tempf', 'humidity') && '🌡 <b>Temperature &amp; humidity</b>: a shaded outdoor sensor',
has('windspeedmph', 'winddir', 'windgustmph') && '💨 <b>Wind</b>: speed, gusts and direction (anemometer and wind vane)',
has('dailyrainin', 'rainratein') && '🌧 <b>Rain</b>: a rain gauge that tips with each bit of rain',
has('baromrelin') && '🧭 <b>Pressure</b>: a barometer (falling pressure often means weather is coming)',
has('uv', 'solarradiation') && '☀️ <b>Sun</b>: UV and solar-radiation sensors',
has('tempinf', 'humidityin') && '🏠 <b>Indoor</b>: a sensor inside the house',
].filter(Boolean);
if (sensors.length) $('sl-sensors').innerHTML = sensors.map((x) => `<li>${x}</li>`).join('');
const fresh = d.dateutc && Date.now() - d.dateutc < 15 * 60 * 1000;
const live = $('sl-live');
live.classList.toggle('stale', !fresh);
@@ -230,7 +270,7 @@ window.stationTabMessage = function (kind, detail) {
return;
}
if (kind === 'unconfigured') {
showMessage('No station connected', 'Add your Ambient Weather API keys in Settings to see live readings from your own station here.');
showMessage('No station connected', 'This tab shows live readings from a <b>personal weather station</b> (a real device on someone\'s property that measures conditions on the spot, not a forecast). Add your Ambient Weather API keys in Settings to connect yours.');
} else {
showMessage('Station unavailable', detail || 'Could not reach your station right now. It will keep retrying.');
}