Traducido del English por IA ·
Megan tiene razón. Lo que haría:1. Sigue enviando co2, temperature y motion como números (motion como 0/1, no true/false, para que tenga un historial).2. Extrae los datos sin procesar con la API de historial; un día por llamada es cómodo:
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"
Si una clave devuelve 10.000 puntos, vuelve a pedir desde el último ts + 1.3. Únelo con la exportación de recepción en un portátil y entrena una regresión logística o una red de 3 entradas y 8 neuronas en Python. Eso basta de sobra para la pendiente de CO2 + el recuento de movimiento.4. Cuantiza los pesos a int8, pégalos como un array const int8_t w[] PROGMEM y el Uno solo ejecuta el forward pass. Envía el resultado como occupied_p (0-100) junto con las otras claves.Sinceramente, para la ocupación, el aumento de CO2 en 20 minutos más «cualquier movimiento en los últimos 30 min» te lleva ya bastante lejos antes de cualquier red neuronal. Empieza con eso como línea base para saber si el modelo merece la pena. El lado de la API está aquí: La API de historial.
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.

