Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


Recommended Posts

Posted (edited)

# 804. History Charts and 992. InfluxDB 2

I have created two companion QuickApps for collecting and displaying historical Fibaro HC3 device values:

- **804. History Charts** displays historical values as SVG charts directly in the Fibaro interface.
- **992. InfluxDB 2** continuously sends selected HC3 device values to an InfluxDB 2 server for longer retention and more detailed history.
 

This is something I know many people have missed on the Fibaro HC3. We can now keep long-term history, display it inside the HC3 interface and compare several devices in the same chart. :D

I am also open to suggestions and improvements! 😄 
 

History Charts can retrieve data from either the built-in HC3 history API or an InfluxDB 2 server.
The source is selected with a switch, so History Charts can be used by itself or together with the InfluxDB 2 QuickApp.


image.png.39341126e823749f53e7bac2c1623eb9.png

 

The QuickApps have separate responsibilities:

- **992. InfluxDB 2** is the writer. It listens for HC3 device changes and stores them in InfluxDB.

Download v1.0.0:

Please login or register to see this attachment.


- **804. History Charts** is the reader and chart renderer. It can read either HC3 History or the values stored by 992 in InfluxDB.

You do not need 992 or an InfluxDB server to use HC3 History mode. Install both QuickApps when you want longer retention and InfluxDB-backed charts.

Download v1.0.0:

Please login or register to see this attachment.



 

## Usful URL's
 

Fibaro Marketpalce URL:

Please login or register to see this link.


Please login or register to see this link.


Github:

Please login or register to see this link.


Please login or register to see this link.



QA Dist Manager by @jgab, for possible to update Quickapps from the QA itself :D Thanks for all your Nice Tools Jgab!! Couldnt have made this without them!
To find my Quickapps add this quickappvariable manifest to the QA Dist Manager:

Please login or register to see this link.



Please login or register to see this attachment.



## What the QA can do

- Load historical values from the HC3 history API.
- Query historical values from InfluxDB 2.
- Display up to six devices in the same chart.
- Use separate left and right Y-axes when devices have different units, for example temperature and power.
- Keep the last value as a continuous step line between recorded changes.
- Draw a blue zero-reference line when the chart contains values above and below zero.
- Show the minimum, maximum and mean value for every displayed device.
- Use raw InfluxDB values for the displayed minimum, maximum and mean statistics.
- Convert cumulative kWh counters to hourly or daily consumption and display them as grouped bars.
- Keep the previous chart visible until a new request has completed successfully.
- Restore the last aggregated chart after a QuickApp restart.
- Store six favorite chart setups for frequently used device combinations.
- Display the current HC3 energy tariff schedule as a virtual Tariffs device type.

 

## Device selection

The QA loads the HC3 device catalog and provides two multiselect lists:

1. Device Types
2. Device List

image.png.b5b9f59c6dcd768729821baa47976336.png


 

## Date, time and scale controls

The To date and time can be edited by selecting year, month, day, hour or minute and then using the minus and plus switches. Holding a switch accelerates the adjustment.

The **Set To Time to Now on Load** toggle updates the To value immediately before history is requested.

Available chart scales currently include:

- Manual (default)
- 1 hour
- 1 day
- 2 days
- 1 week
- 2 weeks
- 1 month
- 2 months
- 3 months
- 6 months
- 1 year
- This Year
- Last Year
- This Month
- Last Month
- This Week
- Last Week
- Today
- Yesterday

When Manual is selected, the Change switch cycles through ten editable targets instead of five. The first five edit To year, month, day, hour and minute. The next five edit the corresponding From values. Minus and plus, including held acceleration, work for both timestamps.

The relative scales derive From from the editable To time. The calendar scales use exact local calendar boundaries and refresh automatically when history is loaded. Current calendar periods end at the current minute, while Last Year, Last Month, Last Week and Yesterday cover the complete previous period.

The record limit can be selected from 2,000 to 100,000 records per device. A configurable 200,000-record ceiling applies to the complete load, so the effective per-device limit is reduced automatically when many devices are selected.
image.png.d5865bcad71cf5c19881940adaa3159a.png
 

## Y-axis modes

The chart supports four Y-axis modes:

- **Auto** adds suitable padding around the observed values.
- **Include Zero** keeps zero inside the displayed range.
- **Fixed Range** allows the minimum and maximum bounds to be adjusted manually.
- **Min / Max** scales directly to the observed minimum and maximum values without additional space.

Below From, To and Scale, the statistics header also shows the final minimum and maximum scale used by each rendered Y-axis. Dual-unit charts show two Y-Axis rows.

This makes smaller variations easier to see. For example, a voltage chart containing values between 220 V and 240 V no longer needs to use a fixed 0–300 V scale.
image.png.e004719eead038f89e6abbeff933d8ef.png

 

## Favorites

Six favorite switches are available above the notification setup.

- Hold a favorite switch for five seconds to store the selected devices, query range, scale, Y-axis setup and current aggregated chart.
- Press it once to restore the saved setup and chart.
- Press it three times within two seconds to restore the favorite and request fresh values.

The QA shows a countdown while a favorite is being saved and displays the device IDs and names stored in every favorite slot.

image.png.7ced2a59f9654b5e1ecacbdef81cb62a.png

 

 

## HC3 tariff chart

The virtual **Tariffs** device type reads the current tariff schedule from the HC3 energy billing endpoint and displays the rate in NOK/kWh.

The QA automatically adopts the time range covered by the returned tariff schedule. The HC3 endpoint provides the current recurring schedule, not an archive of previous tariff definitions.

But this is a bit work in progess so will come back to it :D 

 

 

 

## 992. InfluxDB 2 writer

 

The **992. InfluxDB 2** QuickApp collects HC3 device-property events and writes them to an InfluxDB 2 bucket using line protocol.

It can:

- Send values from selected HC3 devices or all devices.
- Restrict exported properties with an allowlist, such as `value`, `power` and `energy`.
- Store device ID, device name, room, device type and property information with the values.
- Batch writes to reduce HTTP traffic.
- Keep a bounded in-memory queue during temporary connection problems.
- Retry transient failures with limits instead of retrying forever.
- Use an optional failover InfluxDB endpoint.
- Export bounded HC3 system-event telemetry.
- Export the HC3 energy tariff schedule at startup and once per day.
- Show connection, queue, filtering and transport diagnostics in its interface.

The writer uses `value_num_v2` for numeric device values. History Charts can also read legacy `value` data, so charts can cover periods written before and after the field change.

image.png.f8a1e01931837440982dc81017e7add1.png

 

 

## InfluxDB charts in 804. History Charts

InfluxDB mode queries the selected HC3 device IDs and aggregates values to the current chart resolution on the server. This keeps the response and QuickApp memory bounded even when the database contains many raw records.

Normal plotted lines use aggregated mean values, but the displayed Min, Max and Mean statistics are calculated separately from all raw values in the selected period. This preserves the real statistics and short spikes even when the chart line is smoothed by aggregation.

When every selected device uses a cumulative kWh value, the QA uses the last counter value in each interval, calculates non-negative hourly or daily consumption deltas and renders the devices as grouped bars.

The statistics header below the SVG shows the actual bar interval, for example `1 h`, `6 h`, or `24 h`.

The **Records** selector is active in both source modes. HC3 applies the selected limit to each device request. InfluxDB applies it after `aggregateWindow`, so it limits the aggregated points returned per device or series rather than the raw database rows. Because the chart is normally reduced to about 300 points, the lowest 2,000-record setting will usually be sufficient for InfluxDB.

The current writer schema uses the numeric field `value_num_v2`. The QA also reads older `value` data across the complete selected range and merges both schemas, preferring `value_num_v2` wherever both fields contain the same timestamp or chart interval.

HTTP and HTTPS are supported. When HTTPS is selected, `tls_verify` controls whether the server certificate is validated. It has no effect in HTTP mode.

On startup and after Reload Lists, History Charts automatically reads UUID-validated nonsecret connection settings from the `jbs992_InfluxdbV2` global, including the current measurement. Its existing 804 configuration remains the fallback if the 992 global is unavailable or invalid.

A token configured specifically for History Charts through its QuickApp variable, Config or own global always takes precedence. This allows a write token for 992 and a separate read token for 804. The 992 token is used only as a last-resort fallback when History Charts has no token of its own.

If InfluxDB returns HTTP 401 or 403, History Charts reports whether authentication failed or the token lacks read permission. When the rejected token came from the 992 fallback, the warning explains that it may be write-only and recommends configuring a separate read token for 804.

The token is never displayed or written to the QA log, but HC3 global variables contain readable plaintext. The global and its backups must therefore be treated as sensitive.

Do not publish screenshots, exported globals or configuration dumps containing an InfluxDB token.

 

 

## Saved state

The QA stores only bounded, aggregated chart values rather than every raw history event. The latest successful chart survives a restart and can also be restored by a fresh QA using the same permanent UUID. The versioned `jbs804_History_Charts` global is refreshed on every enabled startup and daily at the configurable `BackupTime` while the QA is enabled.

Factory Reset removes the QA-owned saved state and global backup. Restart preserves the configuration and saved charts.

## Language and interface support

The QuickApp includes:

- English
- Norwegian
- Dutch
- Polish
- Follow Home Center Language
- Automatic Classic-view setup and a protected one-way switch back to Classic view
- Enabled/disabled mode
- CPU and memory diagnostics
- Update controls
- A built-in manual

 

## Versions

- **804. History Charts:** v1.0.0
- **992. InfluxDBv2:** v1.0.0

## Installation and configuration

### Using HC3 History only

1. Install 804. History Charts and its companion files.
2. Open the QuickApp and wait for the HC3 device list to load.
3. Select one or more device types and devices.
4. Select HC3 History as the source.
5. Select the time range, scale, record limit and Y-axis mode.
6. Press Load History.
 

### Using InfluxDB 2

1. Install and configure 992. InfluxDB 2 with the server, bucket, organization, measurement and token.
2. Select which HC3 devices and properties the writer should export, or enable Send All Devices.
3. Confirm in the 992 status labels that writes are reaching InfluxDB.
4. Install 804. History Charts. It automatically adopts the UUID-validated nonsecret connection settings from 992; configure a separate read token for 804 when desired.
5. Select InfluxDB 2 as the History Charts source.
6. Select the devices and requested time range, then press Load History.

HC3 History mode works without an external database. InfluxDB mode requires an InfluxDB 2 server, bucket, organization and token with permission to query the selected bucket.
 

## Support continued development

If you find these QuickApps useful, donations would be greatly appreciated.
Contributions will help cover more AI token usage while developing, testing and improving these and future QuickApps. :D

[Donate through PayPal](

Please login or register to see this link.

)

Feedback, testing results and suggestions for additional chart types or supported device properties are welcome.


 

Edited by Brors94
  • Like 1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...