Skip to content

Add telemetry simulator and regenerate sample data#9

Merged
AUREX-ML merged 1 commit into
mainfrom
copilot/create-simulator-script
Jun 30, 2026
Merged

Add telemetry simulator and regenerate sample data#9
AUREX-ML merged 1 commit into
mainfrom
copilot/create-simulator-script

Conversation

Copilot AI commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Introduces services/simulator/simulate.py to programmatically generate the demo site's sample telemetry, replacing the placeholder single-record JSON with a realistic 24-hour dataset.

Changes

services/simulator/simulate.py (new)

  • Generates 24 hourly records for demo-site-001 using stdlib only (json, math, os, datetime)
  • Solar: sine-curve profile peaking ~50 kW at noon, zero 20:00–06:00
  • Load: 20 kW base + Gaussian peaks at 08:00 (morning) and 19:00 (evening)
  • Battery: charges/discharges at up to ±10 kW; SOC clamped to [0, 100]
  • Generator: cuts in up to 15 kW when SOC < 20% and solar is insufficient
  • Grid: residual balancing term (negative = import)
  • site_status: derived enum — solar_export, solar_charging, low_battery, grid_import, normal
  • Writes output to data/sample-telemetry.json relative to repo root

data/sample-telemetry.json (updated)

  • Replaced single placeholder record with the full 24-record output
# Run directly to regenerate the sample data
python services/simulator/simulate.py

@sonarqubecloud

Copy link
Copy Markdown

@AUREX-ML
AUREX-ML marked this pull request as ready for review June 30, 2026 18:59
Copilot AI review requested due to automatic review settings June 30, 2026 18:59
@AUREX-ML
AUREX-ML merged commit a141506 into main Jun 30, 2026
3 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a small Python-based telemetry simulator to generate a realistic 24-hour sample dataset for the demo energy site, and updates the checked-in data/sample-telemetry.json accordingly.

Changes:

  • Added services/simulator/simulate.py to generate 24 hourly telemetry records (solar/load/battery/gen/grid + derived site_status).
  • Replaced the placeholder sample telemetry JSON with a full 24-record day generated by the simulator.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
services/simulator/simulate.py New script to generate hourly demo-site telemetry and write data/sample-telemetry.json.
data/sample-telemetry.json Updated sample dataset intended to reflect the simulator’s generated output.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +29 to +30
if solar > 30:
return "solar_export" if grid < 0 else "solar_charging"
Comment on lines +33 to +34
if grid > 10:
return "grid_import"
Comment on lines +8 to +10
"generator_kw": 0.0,
"grid_kw": -10.01,
"site_status": "normal"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants