Urgent.News

What's breaking now, across thousands of outlets.

Tech

Building a Local Energy Monitoring Pipeline Without Locking Yourself Into One Vendor

Energy monitoring projects often start with one simple request: show the current power reading in a dashboard. The first version is usually straightforward. Poll a meter, parse its response, and draw a chart. The trouble starts later, when the meter changes, a second inverter is added, or the same data needs to reach both a local dashboard and a cloud service. At that point, device-specific code…

Energy monitoring systems can start simple, requiring only a basic power reading on a dashboard. However, complications arise when devices change, additional inverters are added, or data needs to be shared between local and cloud services. To build a more resilient system, separate the design into four key components: the meter or inverter, a device adapter, a normalized energy model, and final destinations for local web dashboards, home automation, time-series storage, and optional cloud forwarding.

The normalization layer, known as the "middle layer," is crucial and separates device-specific code from the rest of the system. This approach allows the system to handle various devices without becoming a large integration platform. Start by answering the gateway's fundamental question: What is the current electrical state, and can it be trusted?

Focus on a normalized record that includes timestamp, source type and model, online status, and voltage, current, and active power values for each phase. Device-specific quirks, such as register addresses, byte order, and response shapes, should be handled within the device adapter. This separation enables easier testing and prevents branches in the dashboard code or uploader.

When dealing with import and export measurements, normalize the direction explicitly. Do not let dashboards decide the meaning of negative numbers. Document this rule and include it in automated tests. Validate the system locally before forwarding any data to the cloud. Establish a clear sequence for connecting to a device, examining raw and normalized readings, comparing phase values, checking import and export direction, observing timeouts and reconnect behavior, and only then enabling remote upload destinations.

Begin with a basic Docker deployment, exposing a local setup page that polls one supported source, stores runtime history, and forwards normalized records at a conservative interval. Avoid adding unnecessary components like message brokers, database clusters, or rules engines until the pipeline is trustworthy. Limit the initial device set to a manageable number, focusing on thorough testing and documentation rather than attempting to support every possible protocol.

Finally, prioritize security by implementing strong defaults, such as no default passwords, one-time password bootstrap flows, one-way password hashing, public Internet exposure restrictions, masked identifiers in logs, and conservative request and polling timeouts.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Meta Title and Description Length: What Google Actually Cuts Off

You ship a page, Google indexes it, and then your title shows up cut off with an ellipsis in the search results. Or worse, your carefully written meta description gets replaced entirely.

  • Google cuts off titles/meta descriptions exceeding limits, showing with ellipsis
  • Titles 50-60 chars, meta descriptions 120-155 chars for optimal visibility
  • Use Title/Meta Description Checker to preview SERP appearance on desktop/mobile

How i did the Multi VM monitoring

I Had 5 Servers Sending Metrics But Couldn't Tell Which One Was Which What happened I had one server. It sent metrics (CPU, errors, etc.) to my monitoring dashboard. Fine.

More from Tuesday 1 September →