Yapay zekâ tarafından English dilinden çevrildi ·
Megan haklı. Ben şunu yapardım:1. co2, temperature ve motion değerlerini sayı olarak göndermeye devam edin (motion true/false değil, 0/1 olarak; böylece bir geçmişi olur).2. Ham verileri geçmiş API’si ile çekin, çağrı başına bir gün rahat bir seçenektir:
curl -s -H "Authorization: Bearer $KEY" "https://$HOST/tenant/$TENANT/api/telemetry/series?kind=iot_device&entityId=$ROOM&keys=co2,temperature,motion&from=$FROM&to=$TO&bucket=raw"
Bir anahtar 10.000 nokta döndürürse, son ts + 1 değerinden itibaren tekrar isteyin.3. Bunu bir dizüstü bilgisayarda ön büro dışa aktarımıyla birleştirin; Python’da bir lojistik regresyon ya da 3 girişli, 8 nöronlu bir ağ eğitin. CO2 eğimi + hareket sayısı için bu yeterince fazla.4. Ağırlıkları int8’e nicemleyin, bunları const int8_t w[] PROGMEM dizisi olarak yapıştırın; Uno yalnızca ileri geçişi çalıştırır. Sonucu diğer anahtarların yanında occupied_p (0-100) olarak gönderin.Açıkçası doluluk için, son 20 dakikadaki CO2 artışı ile “son 30 dakikada herhangi bir hareket” kuralı, herhangi bir sinir ağından önce büyük ölçüde işinizi görür. Modelin değer katıp katmadığını anlamak için önce bunu bir temel çizgi olarak başlatın. API tarafı burada: Geçmiş API’si.
Megan’s right. What I’d do:
1. Keep sending co2, temperature and motion as numbers (motion as 0/1, not true/false, so it has a history).
2. Pull the raw data out with the history API, one day per call is comfortable:
curl -s -H "Authorization: Bearer $KEY" "https://$HOST/tenant/$TENANT/api/telemetry/series?kind=iot_device&entityId=$ROOM&keys=co2,temperature,motion&from=$FROM&to=$TO&bucket=raw"
If a key comes back with 10,000 points, ask again from the last ts + 1.
3. Join it with the front desk export on a laptop, train a logistic regression or a 3-input, 8-neuron net in Python. That is plenty for CO2 slope + motion count.
4. Quantise the weights to int8, paste them as a const int8_t w[] PROGMEM array, and the Uno only runs the forward pass. Send the result as occupied_p (0-100) alongside the other keys.
Honestly, for occupancy the CO2 rise over 20 minutes plus “any motion in the last 30 min” gets you most of the way before any neural net. Start with that as a baseline so you know if the model is worth it. API side is here: The history API.

