Skip to content

Commit

Permalink
v1.4.0-beta.28
Browse files Browse the repository at this point in the history
- improved statistics
- new statistics widget: create and add statistics to dashboards
- new program: sine wave signal generator example
  • Loading branch information
genemars committed Mar 19, 2023
1 parent ea00abc commit 054eac3
Show file tree
Hide file tree
Showing 17 changed files with 130 additions and 83 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
- Customizable client configurations that can be saved and recalled quickly from the UI preferences


![HomeGenie Dashboard](https://genielabs.github.io/HomeGenie/images/homegenie_dashboard_01.jpg)


## Documentation

https://genielabs.github.io/HomeGenie
Expand Down
28 changes: 27 additions & 1 deletion assets/build/all/app/3rdpartylicenses.txt
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,19 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

@kurkle/color
MIT
The MIT License (MIT)

Copyright (c) 2018-2021 Jukka Kurkela

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


@larscom/ngx-translate-module-loader
MIT

Expand Down Expand Up @@ -702,7 +715,20 @@ chart.js
MIT
The MIT License (MIT)

Copyright (c) 2018 Chart.js Contributors
Copyright (c) 2014-2022 Chart.js Contributors

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


chartjs-adapter-moment
MIT
The MIT License (MIT)

Copyright (c) 2019 Chart.js Contributors

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
10 changes: 8 additions & 2 deletions assets/build/all/app/assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"add_device": "Add device",
"operation_failed": "Operation failed",
"device_manager": "Device manager",
"title": "Title",
"name": "Name",
"enter_name": "Enter name",
"description": "Description",
Expand Down Expand Up @@ -70,8 +71,9 @@
"graph_mode": "Graph Mode",
"data_filter": "Data filter",
"data_filter_none": "(none)",
"show_fields": "Fields",
"field": "Field",
"compare_modules": "Compare with",
"compact_mode": "Compact mode",
"not_set": "Not set",
"enable": "Enable",
"disable": "Disable",
Expand Down Expand Up @@ -130,5 +132,9 @@
"no_data_received_yet": "Waiting for data",
"backup_and_restore": "Backup and restore",
"software_updates": "Software updates",
"service_configuration": "Service configuration"
"service_configuration": "Service configuration",
"add_data_source": "Add data source",
"edit_data_source": "Edit data source",
"add_to_dashboard": "Add to dashboard",
"fill": "Fill"
}
10 changes: 8 additions & 2 deletions assets/build/all/app/assets/i18n/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"add_device": "Aggiungi dispositivo",
"operation_failed": "Operazione fallita",
"device_manager": "Gestione dispositivi",
"title": "Titolo",
"name": "Nome",
"enter_name": "Inserire nome",
"description": "Descrizione",
Expand Down Expand Up @@ -70,8 +71,9 @@
"graph_mode": "Tipo Grafico",
"data_filter": "Filtro dati",
"data_filter_none": "(nessuno)",
"show_fields": "Campi",
"field": "Campo",
"compare_modules": "Confronta con",
"compact_mode": "Modalità compatta",
"not_set": "Non impostato",
"enable": "Abilita",
"disable": "Disabilita",
Expand Down Expand Up @@ -130,5 +132,9 @@
"no_data_received_yet": "In attesa dati",
"backup_and_restore": "Backup e ripristino",
"software_updates": "Aggiornamenti software",
"service_configuration": "Configurazione servizio"
"service_configuration": "Configurazione servizio",
"add_data_source": "Agg. sorgente dati",
"edit_data_source": "Modifica sorgente dati",
"add_to_dashboard": "Agg. a dashboard",
"fill": "Riempi"
}
2 changes: 1 addition & 1 deletion assets/build/all/app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@

</div>

<script src="runtime.b92e2ca178ebbf4a.js" type="module"></script><script src="polyfills.710b144f4805f4b0.js" type="module"></script><script src="main.4de4b0ec78f21ce3.js" type="module"></script>
<script src="runtime.b92e2ca178ebbf4a.js" type="module"></script><script src="polyfills.710b144f4805f4b0.js" type="module"></script><script src="main.114b2ad8ed67078d.js" type="module"></script>

</body></html>
1 change: 1 addition & 0 deletions assets/build/all/app/main.114b2ad8ed67078d.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion assets/build/all/app/main.4de4b0ec78f21ce3.js

This file was deleted.

12 changes: 6 additions & 6 deletions assets/build/all/app/ngsw.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"configVersion": 1,
"timestamp": 1678551458013,
"timestamp": 1679250327466,
"index": "/app/index.html",
"assetGroups": [
{
Expand All @@ -15,7 +15,7 @@
"/app/613.16b9c52c0ae74833.js",
"/app/859.0f150be9c99a6b5a.js",
"/app/index.html",
"/app/main.4de4b0ec78f21ce3.js",
"/app/main.114b2ad8ed67078d.js",
"/app/manifest.webmanifest",
"/app/polyfills.710b144f4805f4b0.js",
"/app/runtime.b92e2ca178ebbf4a.js",
Expand Down Expand Up @@ -410,10 +410,10 @@
"/app/assets/fonts/Roboto-Latin-300.woff": "fec6225507c70951797db15985fe0bf87195d6ee",
"/app/assets/fonts/Roboto-Latin-400.woff": "fec6225507c70951797db15985fe0bf87195d6ee",
"/app/assets/fonts/Roboto-Latin-500.woff": "7416b5d46c615d2786a604d71d334b605d41cc73",
"/app/assets/i18n/en.json": "8ce7cbf7fe68f3961e589ab1616a9d06ce3ca7d6",
"/app/assets/i18n/en.json": "aa0a916b9a98227656643e64a5c1b18ce4c2e1fa",
"/app/assets/i18n/homegenie/en.json": "d8ea4950b51f0db6dc54e1c7247e06dd9d1502be",
"/app/assets/i18n/homegenie/it.json": "45981bcdbaa0e57ce93621cd82d5329ad8fa834c",
"/app/assets/i18n/it.json": "cb63d28177c4e0f3d23fa1cbc03f528d408ad20e",
"/app/assets/i18n/it.json": "508682b9ca4bd059afa51145c1c953bb55f9e174",
"/app/assets/i18n/module/en.json": "b91f73dda960b9c0cb26aeee6820019fc893b833",
"/app/assets/i18n/module/it.json": "02c2a0c1deab911e7e527548003afa717bd8d03e",
"/app/assets/i18n/widgets/en.json": "81775f6536411948d4d4c6e054a768a21793ab24",
Expand Down Expand Up @@ -724,8 +724,8 @@
"/app/assets/widgets/weather/images_alt/weather.svg": "c719c09048977fd40688272316b35ddf1bdf89e8",
"/app/assets/widgets/weather/style.css": "1b70730e73885cc0ee83566eaf584008d34e2255",
"/app/assets/workers/typings-worker.js": "8df10d867c12d36cdebfb7e16caacd0020db301f",
"/app/index.html": "9006de6c51a40aea0ba127285addbad1a359f35c",
"/app/main.4de4b0ec78f21ce3.js": "11913520717e6765c0ed4de7f0872f39f6ae71dc",
"/app/index.html": "d0d8f4f35b61035cfc3852bddfccd2d051c182c3",
"/app/main.114b2ad8ed67078d.js": "634ae7d69ffb7b8110abd22776212db7d5152caa",
"/app/manifest.webmanifest": "d47bb07a495e27ddf072f8702df373f79b4eb183",
"/app/polyfills.710b144f4805f4b0.js": "594a5ea1b9d3f9cbc4f363eca84eda2c8bb8a901",
"/app/runtime.b92e2ca178ebbf4a.js": "b50d841a4c50d466c34aab3267d3fb4afe87dede",
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"repository":"homegenie","id":"homegenie-base","version":"1.0.0","description":"HomeGenie base package. This should always be installed.","programs":[{"repository":"homegenie","packageId":"homegenie-base","packageVersion":"1.0.0","hid":"111","id":"client-configs","required":true,"version":"1.0.1","checksum":"AC96494FCA5A5E953B728A669BAF7CA3","installed":false},{"repository":"homegenie","packageId":"homegenie-base","packageVersion":"1.0.0","hid":"142","id":"e-mail-account","required":true,"version":"1.0.0","checksum":"8A42A1D70C35CF3C855AF8761795F5B7","installed":false},{"repository":"homegenie","packageId":"homegenie-base","packageVersion":"1.0.0","hid":"95","id":"events-logging","required":true,"version":"1.0.0","checksum":"25467F93E2AA07645AE54E5D5BB9587E","installed":false},{"repository":"homegenie","packageId":"homegenie-base","packageVersion":"1.0.0","hid":"77","id":"mqtt-network","required":true,"version":"1.0.1","checksum":"60A252D5988007FD051C58E78ACDDA5D","installed":false},{"repository":"homegenie","packageId":"homegenie-base","packageVersion":"1.0.0","hid":"34","id":"openweathermap","required":true,"version":"1.0.0","checksum":"F22CC262E2D8B59CF3C97348D552398E","installed":false},{"repository":"homegenie","packageId":"homegenie-base","packageVersion":"1.0.0","hid":"505","id":"remote-control","required":true,"version":"1.0.0","checksum":"3CCE84C3D6FAFC582974FA8A189B3665","installed":false},{"repository":"homegenie","packageId":"homegenie-base","packageVersion":"1.0.0","hid":"570","id":"time-series-filters","required":true,"version":"1.0.0","checksum":"749ED822713EF777CDDAE4E60D2F22E2","installed":false}],"modules":null,"groups":[{"repository":null,"packageId":null,"packageVersion":null,"hid":"Dashboard","id":"0","required":false,"version":"0","checksum":null,"installed":false}],"schedules":[{"repository":null,"packageId":null,"packageVersion":null,"hid":"System.UpdateCheck","id":"0","required":false,"version":"0","checksum":null,"installed":false}]}
{"repository":"homegenie","id":"homegenie-base","version":"1.0.0","description":"HomeGenie base package. This should always be installed.","programs":[{"repository":"homegenie","packageId":"homegenie-base","packageVersion":"1.0.0","hid":"111","id":"client-configs","required":true,"version":"1.0.1","checksum":"AC96494FCA5A5E953B728A669BAF7CA3","installed":false},{"repository":"homegenie","packageId":"homegenie-base","packageVersion":"1.0.0","hid":"142","id":"e-mail-account","required":true,"version":"1.0.0","checksum":"8A42A1D70C35CF3C855AF8761795F5B7","installed":false},{"repository":"homegenie","packageId":"homegenie-base","packageVersion":"1.0.0","hid":"95","id":"events-logging","required":true,"version":"1.0.0","checksum":"25467F93E2AA07645AE54E5D5BB9587E","installed":false},{"repository":"homegenie","packageId":"homegenie-base","packageVersion":"1.0.0","hid":"77","id":"mqtt-network","required":true,"version":"1.0.1","checksum":"60A252D5988007FD051C58E78ACDDA5D","installed":false},{"repository":"homegenie","packageId":"homegenie-base","packageVersion":"1.0.0","hid":"34","id":"openweathermap","required":true,"version":"1.0.0","checksum":"F22CC262E2D8B59CF3C97348D552398E","installed":false},{"repository":"homegenie","packageId":"homegenie-base","packageVersion":"1.0.0","hid":"505","id":"remote-control","required":true,"version":"1.0.0","checksum":"3CCE84C3D6FAFC582974FA8A189B3665","installed":false},{"repository":"homegenie","packageId":"homegenie-base","packageVersion":"1.0.0","hid":"900","id":"sine-wave-signal","required":false,"version":"1.0.0","checksum":"E399C55B9D64FCBD38E9B2254066159A","installed":false},{"repository":"homegenie","packageId":"homegenie-base","packageVersion":"1.0.0","hid":"570","id":"time-series-filters","required":true,"version":"1.0.1","checksum":"CB0B3531765B9FEFD9E62D8FC8729EC0","installed":false}],"modules":null,"groups":[{"repository":null,"packageId":null,"packageVersion":null,"hid":"Dashboard","id":"0","required":false,"version":"0","checksum":null,"installed":false}],"schedules":[{"repository":null,"packageId":null,"packageVersion":null,"hid":"System.UpdateCheck","id":"0","required":false,"version":"0","checksum":null,"installed":false}]}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<ArrayOfProgramBlock xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<ArrayOfProgramBlock xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ProgramBlock>
<ScriptSetup>var dataFolder = Data.GetFolder("client-presets");
Data.AddToSystemBackup(dataFolder);
Expand Down Expand Up @@ -791,12 +791,53 @@ Program.GoBackground();
<Type>CSharp</Type>
<IsEnabled>true</IsEnabled>
</ProgramBlock>
<ProgramBlock>
<ScriptSetup>Program.UseWidget("homegenie/generic/sensor");
//Program.Run();</ScriptSetup>
<ScriptSource>#using NWaves.Signals.Builders

DiscreteSignal sinusoid =
new SineBuilder()
.SetParameter("frequency", 200/*Hz*/)
.SetParameter("phase", Math.PI)
.OfLength(50)
.SampledAt(5000/*Hz*/)
.Build();

var samples = new List&lt;float&gt;(sinusoid.Samples);
while (Program.IsRunning)
{
foreach (var s in samples)
{
Program.Emit("Sensor.SineWave", (s * 8) + 8);
Pause(.05);
}
}
</ScriptSource>
<ScriptErrors />
<PackageInfo>
<Repository>homegenie</Repository>
<PackageId>homegenie-base</PackageId>
<PackageVersion>1.0.0</PackageVersion>
<Id>sine-wave-signal</Id>
<Version>1.0.0</Version>
<Required>false</Required>
<Checksum>E399C55B9D64FCBD38E9B2254066159A</Checksum>
</PackageInfo>
<Domain>HomeAutomation.HomeGenie.Automation</Domain>
<Address>900</Address>
<Name>SineWave Signal</Name>
<Description>Example</Description>
<Group>Data Processing</Group>
<Features />
<AutoRestartEnabled>false</AutoRestartEnabled>
<Cloneable>false</Cloneable>
<Type>csharp</Type>
<IsEnabled>false</IsEnabled>
</ProgramBlock>
<ProgramBlock>
<ScriptSetup>#region program-context

#using NWaves.Filters
#using NWaves.Operations

const int windowSize = 9;

ValueStatistics ApplySimpleAverageFilter(ModuleParameter parameter, double startTime, double endTime, double chartWidth) {
Expand All @@ -816,7 +857,7 @@ ValueStatistics ApplySimpleAverageFilter(ModuleParameter parameter, double start
stats.History.Reverse();

// Process time series
if (startTime &gt; 0 &amp;&amp; stats.History.Count &gt; 0)
if (startTime &gt; 0 &amp;&amp; stats.History.Count &gt; 0 &amp;&amp; chartWidth &lt; stats.History.Count)
{
var stepMs = (timeSpan / chartWidth);
if (stepMs &lt; 1000) stepMs = 1000;
Expand Down Expand Up @@ -941,15 +982,15 @@ When.WebServiceCallReceived("DataProcessing.Filters/Series/SavitzkyGolay", (args

Program.GoBackground();
</ScriptSource>
<ScriptErrors />
<ScriptErrors>[]</ScriptErrors>
<PackageInfo>
<Repository>homegenie</Repository>
<PackageId>homegenie-base</PackageId>
<PackageVersion>1.0.0</PackageVersion>
<Id>time-series-filters</Id>
<Version>1.0.0</Version>
<Version>1.0.1</Version>
<Required>true</Required>
<Checksum>749ED822713EF777CDDAE4E60D2F22E2</Checksum>
<Checksum>CB0B3531765B9FEFD9E62D8FC8729EC0</Checksum>
</PackageInfo>
<Domain>HomeAutomation.HomeGenie.Automation</Domain>
<Address>570</Address>
Expand All @@ -963,4 +1004,4 @@ Program.GoBackground();
<Type>csharp</Type>
<IsEnabled>true</IsEnabled>
</ProgramBlock>
</ArrayOfProgramBlock>
</ArrayOfProgramBlock>
Loading

0 comments on commit 054eac3

Please sign in to comment.