iobroker.sbfspot 4.2.4 → 4.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,12 +5,12 @@ name: Test and Release
5
5
  on:
6
6
  push:
7
7
  branches:
8
- - "master"
8
+ - '*'
9
9
  tags:
10
10
  # normal versions
11
- - "v[0-9]+.[0-9]+.[0-9]+"
11
+ - "v?[0-9]+.[0-9]+.[0-9]+"
12
12
  # pre-releases
13
- - "v[0-9]+.[0-9]+.[0-9]+-**"
13
+ - "v?[0-9]+.[0-9]+.[0-9]+-**"
14
14
  pull_request: {}
15
15
 
16
16
  jobs:
@@ -21,61 +21,146 @@ jobs:
21
21
  runs-on: ubuntu-latest
22
22
 
23
23
  steps:
24
- - uses: ioBroker/testing-action-check@v1
24
+ - uses: actions/checkout@v4
25
+ - name: Use Node.js 18.x
26
+ uses: actions/setup-node@v4
25
27
  with:
26
- node-version: '18.x'
27
- # Uncomment the following line if your adapter cannot be installed using 'npm ci'
28
- # install-command: 'npm install'
29
- lint: true
28
+ node-version: 18.x
29
+
30
+
31
+ - name: Install Dependencies
32
+ run: npm install
33
+
34
+ # - name: Perform a type check
35
+ # run: npm run check:ts
36
+ # env:
37
+ # CI: true
38
+ # - name: Lint TypeScript code
39
+ # run: npm run lint
40
+ # - name: Test package files
41
+ # run: npm run test:package
42
+
30
43
 
31
44
  # Runs adapter tests on all supported node versions and OSes
32
45
  adapter-tests:
33
46
  if: contains(github.event.head_commit.message, '[skip ci]') == false
34
47
 
48
+ needs: [check-and-lint]
49
+
35
50
  runs-on: ${{ matrix.os }}
36
51
  strategy:
37
52
  matrix:
38
- node-version: [16.x, 18.x, 20.x]
39
- os: [ubuntu-latest, windows-latest]
53
+ node-version: [18.x, 20.x]
54
+ os: [ubuntu-latest, windows-latest, macos-latest]
40
55
 
41
56
  steps:
42
- - uses: ioBroker/testing-action-adapter@v1
57
+ - uses: actions/checkout@v4
58
+ - name: Use Node.js ${{ matrix.node-version }}
59
+ uses: actions/setup-node@v4
43
60
  with:
44
61
  node-version: ${{ matrix.node-version }}
45
- os: ${{ matrix.os }}
46
- # Uncomment the following line if your adapter cannot be installed using 'npm ci'
47
- # install-command: 'npm install'
48
62
 
63
+ - name: Install Dependencies
64
+ run: npm install
65
+
66
+ - name: Run local tests
67
+ run: npm test
68
+ # - name: Run unit tests
69
+ # run: npm run test:unit
70
+ # - name: Run integration tests # (linux/osx)
71
+ # if: startsWith(runner.OS, 'windows') == false
72
+ # run: DEBUG=testing:* npm run test:integration
73
+ # - name: Run integration tests # (windows)
74
+ # if: startsWith(runner.OS, 'windows')
75
+ # run: set DEBUG=testing:* & npm run test:integration
49
76
  # Deploys the final package to NPM
77
+
50
78
  deploy:
51
79
  needs: [check-and-lint, adapter-tests]
52
80
 
53
- # Trigger this step only when a commit on any branch is tagged with a version number
81
+ # Trigger this step only when a commit on master is tagged with a version number
54
82
  if: |
55
83
  contains(github.event.head_commit.message, '[skip ci]') == false &&
56
84
  github.event_name == 'push' &&
57
- startsWith(github.ref, 'refs/tags/v')
58
-
85
+ startsWith(github.ref, 'refs/tags/')
59
86
  runs-on: ubuntu-latest
60
87
 
61
88
  steps:
62
- - uses: ioBroker/testing-action-deploy@v1
89
+ - name: Checkout code
90
+ uses: actions/checkout@v4
91
+
92
+ - name: Use Node.js 18.x
93
+ uses: actions/setup-node@v4
63
94
  with:
64
- node-version: '18.x'
65
- # Uncomment the following line if your adapter cannot be installed using 'npm ci'
66
- # install-command: 'npm install'
67
- npm-token: ${{ secrets.NPM_TOKEN }}
68
- github-token: ${{ secrets.secrets.AUTOMERGER }}
69
-
70
- # When using Sentry for error reporting, Sentry can be informed about new releases
71
- # To enable create a API-Token in Sentry (User settings, API keys)
72
- # Enter this token as a GitHub secret (with name SENTRY_AUTH_TOKEN) in the repository options
73
- # Then uncomment and customize the following block:
74
- sentry: true
75
- sentry-url: "https://sentry.io"
76
- sentry-org: "rg-engineering"
77
- sentry-token: ${{ secrets.SENTRY_AUTH_TOKEN }}
78
- sentry-project: "iobroker_sbfspot"
79
- sentry-version-prefix: "iobroker.sbfspot"
80
- # If your sentry project is linked to a GitHub repository, you can enable the following option
81
- # sentry-github-integration: true
95
+ node-version: 18.x
96
+
97
+ - name: Extract the version and commit body from the tag
98
+ id: extract_release
99
+ # The body may be multiline, therefore we need to escape some characters
100
+ run: |
101
+ VERSION="${{ github.ref }}"
102
+ VERSION=${VERSION##*/}
103
+ VERSION=${VERSION##*v}
104
+ echo "::set-output name=VERSION::$VERSION"
105
+ BODY=$(git show -s --format=%b)
106
+ BODY="${BODY//'%'/'%25'}"
107
+ BODY="${BODY//$'\n'/'%0A'}"
108
+ BODY="${BODY//$'\r'/'%0D'}"
109
+ echo "::set-output name=BODY::$BODY"
110
+
111
+ - name: Install Dependencies
112
+ run: npm install
113
+ #- name: Create a clean build
114
+ # run: npm run build
115
+ - name: Publish package to npm
116
+ run: |
117
+ npm config set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}
118
+ npm whoami
119
+ npm publish
120
+
121
+ - name: Create Github Release
122
+ uses: actions/create-release@v1
123
+ env:
124
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
125
+ with:
126
+ tag_name: ${{ github.ref }}
127
+ release_name: Release v${{ steps.extract_release.outputs.VERSION }}
128
+ draft: false
129
+ # Prerelease versions create pre-releases on GitHub
130
+ prerelease: ${{ contains(steps.extract_release.outputs.VERSION, '-') }}
131
+ body: ${{ steps.extract_release.outputs.BODY }}
132
+
133
+ - name: Notify Sentry.io about the release
134
+ run: |
135
+ npm i -g @sentry/cli
136
+ export SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }}
137
+ export SENTRY_URL=https://sentry.io
138
+ export SENTRY_ORG=rg-engineering
139
+ export SENTRY_PROJECT=iobroker_sbfspot
140
+ export SENTRY_VERSION=rg-engineering.sbfspot@${{ steps.extract_release.outputs.VERSION }}
141
+ sentry-cli releases new $SENTRY_VERSION
142
+ sentry-cli releases set-commits $SENTRY_VERSION --auto
143
+ sentry-cli releases finalize $SENTRY_VERSION
144
+
145
+ # Add the following line BEFORE finalize if sourcemap uploads are needed
146
+ # sentry-cli releases files $SENTRY_VERSION upload-sourcemaps build/
147
+
148
+
149
+
150
+
151
+
152
+
153
+
154
+
155
+
156
+
157
+
158
+
159
+
160
+
161
+
162
+
163
+
164
+
165
+
166
+
package/README.md CHANGED
@@ -63,6 +63,15 @@ sometimes npm intall must be called more then one time to successfully install a
63
63
  Placeholder for the next version (at the beginning of the line):
64
64
  ### **WORK IN PROGRESS**
65
65
  -->
66
+ ### 4.3.2 (2024-05-26)
67
+ * (René) change of dependencies
68
+
69
+ ### 4.3.1 (2024-05-23)
70
+ * (René) bug fix for data history in VIS-2
71
+
72
+ ### 4.3.0 (2024-05-22)
73
+ * (René) data history prepared for VIS-2: just a option here in the adapter and new widget (at this moment GeneralChart widget in vis-2-widgets-weather can be used)
74
+
66
75
  ### 4.2.4 (2024-01-13)
67
76
  * (René) upgrade better-sqlite
68
77
 
@@ -196,6 +196,13 @@
196
196
  </div>
197
197
  </div>
198
198
 
199
+ <div class="row">
200
+ <div class="input-field col s6">
201
+ <input type="checkbox" id="History4Vis2" class="value" />
202
+ <label for="History4Vis2" class="translate">History4Vis2</label>
203
+ </div>
204
+ </div>
205
+
199
206
  </div>
200
207
 
201
208
  <!-- settings for mySQL / MariaDB -->
@@ -228,7 +235,7 @@
228
235
  </div>
229
236
 
230
237
  <div class="input-field col s6 col-mysql-password">
231
- <input type="text" id="sbfspotPassword" class="value" />
238
+ <input type="password" id="sbfspotPassword" class="value" />
232
239
  <label for="sbfspotPassword" class="translate">sbfspot_DB_password</label>
233
240
  </div>
234
241
  </div>
package/admin/words.js CHANGED
@@ -8,10 +8,11 @@
8
8
  'use strict';
9
9
 
10
10
  systemDictionary = {
11
- "Attention": { "en": "adapter, sbfspot and database should run on the same system", "de": "adapter, sbfspot und database sollten auf demselben system laufen", "ru": "адаптер, sbfspot и база данных должны работать в одной системе", "pt": "adaptador, sbfspot e banco de dados devem ser executados no mesmo sistema", "nl": "adapter, sbfspot en database moeten op hetzelfde systeem worden uitgevoerd", "fr": "L'adaptateur, sbfspot et la base de données doivent fonctionner sur le même système", "it": "adattatore, sbfspot e database dovrebbero essere eseguiti sullo stesso sistema", "es": "adaptador, sbfspot y base de datos deben ejecutarse en el mismo sistema", "pl": "adapter, sbfspot i baza danych powinny działać w tym samym systemie", "uk": "адаптер, sbfspot і база даних повинні працювати в одній системі", "zh-cn": "适配器,sbfspot和数据库应在同一系统上运行"},
11
+ "Attention": { "en": "adapter, sbfspot and database should run on the same system", "de": "adapter, sbfspot und Datenbank sollten auf demselben System laufen", "ru": "адаптер, sbfspot и база данных должны работать в одной системе", "pt": "adaptador, sbfspot e banco de dados devem ser executados no mesmo sistema", "nl": "adapter, sbfspot en database moeten op hetzelfde systeem worden uitgevoerd", "fr": "L'adaptateur, sbfspot et la base de données doivent fonctionner sur le même système", "it": "adattatore, sbfspot e database dovrebbero essere eseguiti sullo stesso sistema", "es": "adaptador, sbfspot y base de datos deben ejecutarse en el mismo sistema", "pl": "adapter, sbfspot i baza danych powinny działać w tym samym systemie", "uk": "адаптер, sbfspot і база даних повинні працювати в одній системі", "zh-cn": "适配器,sbfspot和数据库应在同一系统上运行"},
12
12
  "GetDataOnlyWhenDaylight": { "en": "get data only when daylight", "de": "Daten nur bei Tageslicht abrufen", "ru": "получать данные только при дневном свете", "pt": "obtenha dados somente quando a luz do dia", "nl": "krijg alleen gegevens bij daglicht", "fr": "obtenir des données uniquement lorsque la lumière du jour", "it": "ottenere i dati solo alla luce del giorno", "es": "obtener datos solo cuando la luz del día", "pl": "odbieraj dane tylko przy świetle dziennym", "uk": "отримувати дані тільки вдень", "zh-cn": "仅在白天时获取数据"},
13
+ "History4Vis2": { "en": "Create history value for VIS-2 widget", "de": "History für VIS-2-Widgets erstellen", "ru": "Создать значение истории для виджета VIS-2", "pt": "Criar valor histórico para o widget VIS-2", "nl": "Creëer geschiedeniswaarde voor VIS-2 widget", "fr": "Créer une valeur historique pour le widget VIS-2", "it": "Crea un valore di cronologia per il widget VIS-2", "es": "Crear valor de historial para el widget VIS-2", "pl": "Utwórz wartość historii dla widżetu VIS-2", "uk": "Створення значення історії для віджета VIS-2", "zh-cn": "为 VIS-2 小部件创建历史值"},
13
14
  "install_date": { "en": "install date PV-System", "de": "Installationsdatum PV-Anlage", "ru": "дата установки PV-система", "pt": "data de instalação PV-System", "nl": "installeer datum PV-systeem", "fr": "date d'installation PV-System", "it": "installare data PV-System", "es": "fecha de instalación PV-System", "pl": "data instalacji PV-System", "uk": "дата встановлення PV-системи", "zh-cn": "安装日期PV-System"},
14
- "install_date_desc": { "en": "used for calculation of history in vis widget", "de": "verwendet für die Berechnung der Geschichte in vis Widget", "ru": "используется для расчета истории в виджетах", "pt": "usado para calcular o histórico no vis widget", "nl": "gebruikt voor de berekening van de geschiedenis in vis widget", "fr": "utilisé pour le calcul de l'histoire dans vis widget", "it": "utilizzato per il calcolo della cronologia nel widget vis", "es": "utilizado para el cálculo de la historia en el widget vis", "pl": "służy do obliczania historii w widgecie vis", "uk": "використовується для обчислення історії у віджеті vis", "zh-cn": "用于计算vis小部件中的历史记录"},
15
+ "install_date_desc": { "en": "used for calculation of history in vis widget", "de": "verwendet für die Berechnung der History in vis Widget", "ru": "используется для расчета истории в виджетах", "pt": "usado para calcular o histórico no vis widget", "nl": "gebruikt voor de berekening van de geschiedenis in vis widget", "fr": "utilisé pour le calcul de l'histoire dans vis widget", "it": "utilizzato per il calcolo della cronologia nel widget vis", "es": "utilizado para el cálculo de la historia en el widget vis", "pl": "służy do obliczania historii w widgecie vis", "uk": "використовується для обчислення історії у віджеті vis", "zh-cn": "用于计算vis小部件中的历史记录"},
15
16
  "path_to_DB_file": { "en": "path to sqlite database file", "de": "Pfad zur SQLite-Datenbankdatei", "ru": "путь к файлу базы данных sqlite", "pt": "caminho para o arquivo de banco de dados sqlite", "nl": "pad naar sqlite databasebestand", "fr": "chemin vers le fichier de base de données sqlite", "it": "percorso per il file di database sqlite", "es": "ruta al archivo de base de datos sqlite", "pl": "ścieżka do pliku bazy danych sqlite", "uk": "шлях до файлу бази даних sqlite", "zh-cn": "sqlite数据库文件的路径"},
16
17
  "path_to_DB_file_descr": { "en": "enter the complete path incl. database file name e.g. /home/pi/sbfspot/smadata/SBFspot.db", "de": "geben Sie den kompletten Pfad inkl. Datenbankdateiname z.B. /home/pi/sbfspot/smadata/SBFspot.db", "ru": "введите полный путь, включая. имя файла базы данных, например. /home/pi/sbfspot/smadata/SBFspot.db", "pt": "insira o caminho completo incl. nome do arquivo do banco de dados, e. /home/pi/sbfspot/smadata/SBFspot.db", "nl": "vul het complete pad in incl. databasebestandsnaam, b.v. /home/pi/sbfspot/smadata/SBFspot.db", "fr": "entrez le chemin complet incl. nom de fichier de base de données, par ex. /home/pi/sbfspot/smadata/SBFspot.db", "it": "inserisci il percorso completo incl. nome del file di database, ad es. /home/pi/sbfspot/smadata/SBFspot.db", "es": "ingrese la ruta completa incl. nombre de archivo de base de datos, p. /home/pi/sbfspot/smadata/SBFspot.db", "pl": "wprowadź pełną ścieżkę włącznie nazwa pliku bazy danych, np. /home/pi/sbfspot/smadata/SBFspot.db", "uk": "введіть повний шлях, вкл. назва файлу бази даних, напр. /home/pi/sbfspot/smadata/SBFspot.db", "zh-cn": "输入完整的路径,包括"},
17
18
  "sbfspot_DB_IP": { "en": "database IP", "de": "Datenbank-IP", "ru": "IP-адрес", "pt": "banco de dadosL", "nl": "database IP", "fr": "base de données IP", "it": "IP del databaseL", "es": "base de datos IP", "pl": "IP bazy danych", "uk": "IP бази даних", "zh-cn": "数据库IP"},
package/io-package.json CHANGED
@@ -1,8 +1,47 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "sbfspot",
4
- "version": "4.2.4",
4
+ "version": "4.3.2",
5
5
  "news": {
6
+ "4.3.2": {
7
+ "en": "(René) change of dependencies",
8
+ "de": "(René) Veränderung der Abhängigkeiten",
9
+ "ru": "(René) изменение зависимостей",
10
+ "pt": "(René) mudança de dependências",
11
+ "nl": "(René) verandering van afhankelijkheden",
12
+ "fr": "(René) changement de dépendances",
13
+ "it": "(René) cambiamento delle dipendenze",
14
+ "es": "(René) cambio de dependencia",
15
+ "pl": "(René) zmiana zależności",
16
+ "uk": "(Рене) зміна залежностей",
17
+ "zh-cn": "(René) 属地变化"
18
+ },
19
+ "4.3.1": {
20
+ "en": "(René) bug fix for data history in VIS-2",
21
+ "de": "Fehlerbehebung für die Datenhistorie in VIS-2",
22
+ "ru": "(René) исправление ошибок для истории данных в VIS-2",
23
+ "pt": "(René) correção de bugs para histórico de dados no VIS-2",
24
+ "nl": "(René) bug fix voor gegevensgeschiedenis in VIS-2",
25
+ "fr": "Correction du bogue (René) pour l'historique des données dans VIS-2",
26
+ "it": "(René) bug fix per la cronologia dei dati in VIS-2",
27
+ "es": "(René) bug fix for data history in VIS-2",
28
+ "pl": "(René) fix dla historii danych w VIS-2",
29
+ "uk": "(René) Виправлення помилок для історії даних в VIS-2",
30
+ "zh-cn": "(René) VIS-2中数据历史的错误修正"
31
+ },
32
+ "4.3.0": {
33
+ "en": "(René) data history prepared for VIS-2: just a option here in the adapter and new widget (at this moment GeneralChart widget in vis-2-widgets-weather can be used)",
34
+ "de": "(René) Datenhistorie für VIS-2 vorbereitet: nur eine Option hier im Adapter und neues Widget (in diesem Moment kann GeneralChart Widget in vis-2-widgets-weather verwendet werden)",
35
+ "ru": "(René) история данных, подготовленная для VIS-2: просто вариант здесь в адаптере и новом виджете (в этот момент виджет GeneralChart в vis-2-widgets-weather может быть использован)",
36
+ "pt": "(René) histórico de dados preparado para VIS-2: apenas uma opção aqui no adaptador e novo widget (neste momento o widget GeneralChart em vis-2-widgets-weather pode ser usado)",
37
+ "nl": "(René) data geschiedenis voorbereid voor VIS-2: alleen een optie hier in de adapter en nieuwe widget (op dit moment GeneralChart widget in vis-2-widgets-weer kan worden gebruikt)",
38
+ "fr": "(René) historique de données préparé pour VIS-2: juste une option ici dans l'adaptateur et le nouveau widget (à ce moment le widget GeneralChart dans vis-2-widgets-weather peut être utilisé)",
39
+ "it": "(René) cronologia dei dati preparati per VIS-2: solo un'opzione qui nell'adattatore e nuovo widget (in questo momento GeneralChart widget in vis-2-widgets-weather può essere utilizzato)",
40
+ "es": "(René) historial de datos preparado para VIS-2: sólo una opción aquí en el adaptador y nuevo widget (en este momento se puede utilizar el widget GeneralChart en vis-2-widgets-weather)",
41
+ "pl": "(René) Historia danych przygotowana dla VIS-2: tylko opcja tutaj w adapterze i nowy widget (w tym momencie GeneralChart widget w vis- 2-widgets- pogoda może być użyta)",
42
+ "uk": "(René) історії даних, підготовлених для VIS-2: просто варіант тут в адаптері і новому віджеті (з цього моменту можна використовувати GeneralChart віджет в vis-2-widgets-weather)",
43
+ "zh-cn": "(René)为VIS-2准备的数据历史:仅在适配器和新部件中设置一个选项(此时可使用GeneralChart部件相对-2-widgets-weather)"
44
+ },
6
45
  "4.2.4": {
7
46
  "en": "(René) upgrade better-sqlite",
8
47
  "de": "(René) Upgrade besser-sqlite",
@@ -54,32 +93,6 @@
54
93
  "pl": "(René) zależności od aktualizacji",
55
94
  "uk": "(René) залежностей оновлено",
56
95
  "zh-cn": "(单位:千美元)"
57
- },
58
- "4.2.0": {
59
- "en": "(René) dependencies updated",
60
- "de": "(René)",
61
- "ru": "(René) обновления зависимости",
62
- "pt": "(René) dependências atualizadas",
63
- "nl": "Afhankelijkheid",
64
- "fr": "(René) dépendances mises à jour",
65
- "it": "(René) dipendenze aggiornate",
66
- "es": "(René) dependencies updated",
67
- "pl": "(René) zależności od aktualizacji",
68
- "uk": "(René) залежностей оновлено",
69
- "zh-cn": "(单位:千美元)"
70
- },
71
- "4.1.7": {
72
- "en": "dependencies updated",
73
- "de": "Abhängigkeiten aktualisiert",
74
- "ru": "зависимости обновлены",
75
- "pt": "dependências atualizadas",
76
- "nl": "afhankelijkheden bijgewerkt",
77
- "fr": "dépendances mises à jour",
78
- "it": "dipendenze aggiornate",
79
- "es": "dependencias actualizadas",
80
- "pl": "zaktualizowane zależności",
81
- "uk": "залежності оновлено",
82
- "zh-cn": "依赖更新"
83
96
  }
84
97
  },
85
98
  "titleLang": {
@@ -122,11 +135,14 @@
122
135
  "loglevel": "info",
123
136
  "stopBeforeUpdate": true,
124
137
  "type": "hardware",
125
- "license": "MIT",
138
+ "licenseInformation": {
139
+ "license": "MIT",
140
+ "type": "free"
141
+ },
126
142
  "materialize": true,
127
143
  "dependencies": [
128
144
  {
129
- "js-controller": ">=2.0.0"
145
+ "js-controller": ">=5.0.0"
130
146
  }
131
147
  ],
132
148
  "plugins": {
package/main.js CHANGED
@@ -208,83 +208,6 @@ async function GetSystemDateformat() {
208
208
  }
209
209
  }
210
210
 
211
- /*
212
-
213
- 2020-07-27 19:30:06.897 - info: sbfspot.0 (6113) Terminated (ADAPTER_REQUESTED_TERMINATION): Without reason
214
- 2020-07-27 19:30:07.015 - warn: sbfspot.0 (6113) Object sbfspot.0.1100173807 is invalid: obj.common.name has an invalid type! Expected "string" or "object", received "number"
215
- 2020-07-27 19:30:07.018 - warn: sbfspot.0 (6113) This object will not be created in future versions. Please report this to the developer.
216
- 2020-07-27 19:30:07.063 - warn: sbfspot.0 (6113) Object sbfspot.0.1100173807.Type is invalid: obj.type has to exist
217
- 2020-07-27 19:30:07.065 - warn: sbfspot.0 (6113) This object will not be created in future versions. Please report this to the developer.
218
- 2020-07-27 19:30:07.068 - warn: sbfspot.0 (6113) Object sbfspot.0.1100173807.ETotal is invalid: obj.type has to exist
219
- 2020-07-27 19:30:07.070 - warn: sbfspot.0 (6113) This object will not be created in future versions. Please report this to the developer.
220
- 2020-07-27 19:30:07.073 - warn: sbfspot.0 (6113) Object sbfspot.0.1100173807.EToday is invalid: obj.type has to exist
221
- 2020-07-27 19:30:07.076 - warn: sbfspot.0 (6113) This object will not be created in future versions. Please report this to the developer.
222
- 2020-07-27 19:30:07.078 - warn: sbfspot.0 (6113) Object sbfspot.0.1100173807.SW_Version is invalid: obj.type has to exist
223
- 2020-07-27 19:30:07.081 - warn: sbfspot.0 (6113) This object will not be created in future versions. Please report this to the developer.
224
- 2020-07-27 19:30:07.084 - warn: sbfspot.0 (6113) Object sbfspot.0.1100173807.TotalPac is invalid: obj.type has to exist
225
- 2020-07-27 19:30:07.086 - warn: sbfspot.0 (6113) This object will not be created in future versions. Please report this to the developer.
226
- 2020-07-27 19:30:07.088 - warn: sbfspot.0 (6113) Object sbfspot.0.1100173807.OperatingTime is invalid: obj.type has to exist
227
- 2020-07-27 19:30:07.090 - warn: sbfspot.0 (6113) This object will not be created in future versions. Please report this to the developer.
228
- 2020-07-27 19:30:07.093 - warn: sbfspot.0 (6113) Object sbfspot.0.1100173807.FeedInTime is invalid: obj.type has to exist
229
- 2020-07-27 19:30:07.095 - warn: sbfspot.0 (6113) This object will not be created in future versions. Please report this to the developer.
230
- 2020-07-27 19:30:07.098 - warn: sbfspot.0 (6113) Object sbfspot.0.1100173807.Status is invalid: obj.type has to exist
231
- 2020-07-27 19:30:07.100 - warn: sbfspot.0 (6113) This object will not be created in future versions. Please report this to the developer.
232
- 2020-07-27 19:30:07.103 - warn: sbfspot.0 (6113) Object sbfspot.0.1100173807.GridRelay is invalid: obj.type has to exist
233
- 2020-07-27 19:30:07.105 - warn: sbfspot.0 (6113) This object will not be created in future versions. Please report this to the developer.
234
- 2020-07-27 19:30:07.107 - warn: sbfspot.0 (6113) Object sbfspot.0.1100173807.Temperature is invalid: obj.type has to exist
235
- 2020-07-27 19:30:07.109 - warn: sbfspot.0 (6113) This object will not be created in future versions. Please report this to the developer.
236
- 2020-07-27 19:30:07.112 - warn: sbfspot.0 (6113) Object sbfspot.0.1100173807.Pdc1 is invalid: obj.type has to exist
237
- 2020-07-27 19:30:07.114 - warn: sbfspot.0 (6113) This object will not be created in future versions. Please report this to the developer.
238
- 2020-07-27 19:30:07.116 - warn: sbfspot.0 (6113) Object sbfspot.0.1100173807.Pdc2 is invalid: obj.type has to exist
239
- 2020-07-27 19:30:07.118 - warn: sbfspot.0 (6113) This object will not be created in future versions. Please report this to the developer.
240
- 2020-07-27 19:30:07.121 - warn: sbfspot.0 (6113) Object sbfspot.0.1100173807.Idc1 is invalid: obj.type has to exist
241
- 2020-07-27 19:30:07.123 - warn: sbfspot.0 (6113) This object will not be created in future versions. Please report this to the developer.
242
- 2020-07-27 19:30:07.125 - warn: sbfspot.0 (6113) Object sbfspot.0.1100173807.Idc2 is invalid: obj.type has to exist
243
- 2020-07-27 19:30:07.127 - warn: sbfspot.0 (6113) This object will not be created in future versions. Please report this to the developer.
244
- 2020-07-27 19:30:07.130 - warn: sbfspot.0 (6113) Object sbfspot.0.1100173807.Udc1 is invalid: obj.type has to exist
245
- 2020-07-27 19:30:07.132 - warn: sbfspot.0 (6113) This object will not be created in future versions. Please report this to the developer.
246
- 2020-07-27 19:30:07.134 - warn: sbfspot.0 (6113) Object sbfspot.0.1100173807.Udc2 is invalid: obj.type has to exist
247
- 2020-07-27 19:30:07.136 - warn: sbfspot.0 (6113) This object will not be created in future versions. Please report this to the developer.
248
- 2020-07-27 19:30:07.139 - warn: sbfspot.0 (6113) Object sbfspot.0.1100173807.Pac1 is invalid: obj.type has to exist
249
- 2020-07-27 19:30:07.141 - warn: sbfspot.0 (6113) This object will not be created in future versions. Please report this to the developer.
250
- 2020-07-27 19:30:07.143 - warn: sbfspot.0 (6113) Object sbfspot.0.1100173807.Pac2 is invalid: obj.type has to exist
251
- 2020-07-27 19:30:07.145 - warn: sbfspot.0 (6113) This object will not be created in future versions. Please report this to the developer.
252
- 2020-07-27 19:30:07.148 - warn: sbfspot.0 (6113) Object sbfspot.0.1100173807.Pac3 is invalid: obj.type has to exist
253
- 2020-07-27 19:30:07.149 - warn: sbfspot.0 (6113) This object will not be created in future versions. Please report this to the developer.
254
- 2020-07-27 19:30:07.152 - warn: sbfspot.0 (6113) Object sbfspot.0.1100173807.Iac1 is invalid: obj.type has to exist
255
- 2020-07-27 19:30:07.154 - warn: sbfspot.0 (6113) This object will not be created in future versions. Please report this to the developer.
256
- 2020-07-27 19:30:07.156 - warn: sbfspot.0 (6113) Object sbfspot.0.1100173807.Iac2 is invalid: obj.type has to exist
257
- 2020-07-27 19:30:07.158 - warn: sbfspot.0 (6113) This object will not be created in future versions. Please report this to the developer.
258
- 2020-07-27 19:30:07.161 - warn: sbfspot.0 (6113) Object sbfspot.0.1100173807.Iac3 is invalid: obj.type has to exist
259
- 2020-07-27 19:30:07.163 - warn: sbfspot.0 (6113) This object will not be created in future versions. Please report this to the developer.
260
- 2020-07-27 19:30:07.165 - warn: sbfspot.0 (6113) Object sbfspot.0.1100173807.Uac1 is invalid: obj.type has to exist
261
- 2020-07-27 19:30:07.175 - warn: sbfspot.0 (6113) This object will not be created in future versions. Please report this to the developer.
262
- 2020-07-27 19:30:07.178 - warn: sbfspot.0 (6113) Object sbfspot.0.1100173807.Uac2 is invalid: obj.type has to exist
263
- 2020-07-27 19:30:07.180 - warn: sbfspot.0 (6113) This object will not be created in future versions. Please report this to the developer.
264
- 2020-07-27 19:30:07.183 - warn: sbfspot.0 (6113) Object sbfspot.0.1100173807.Uac3 is invalid: obj.type has to exist
265
- 2020-07-27 19:30:07.185 - warn: sbfspot.0 (6113) This object will not be created in future versions. Please report this to the developer.
266
- 2020-07-27 19:30:07.187 - warn: sbfspot.0 (6113) Object sbfspot.0.1100173807.Frequency is invalid: obj.type has to exist
267
- 2020-07-27 19:30:07.189 - warn: sbfspot.0 (6113) This object will not be created in future versions. Please report this to the developer.
268
- 2020-07-27 19:30:07.191 - warn: sbfspot.0 (6113) Object sbfspot.0.1100173807.BT_Signal is invalid: obj.type has to exist
269
- 2020-07-27 19:30:07.193 - warn: sbfspot.0 (6113) This object will not be created in future versions. Please report this to the developer.
270
- 2020-07-27 19:30:07.196 - warn: sbfspot.0 (6113) Object sbfspot.0.1100173807.timestamp is invalid: obj.type has to exist
271
- 2020-07-27 19:30:07.198 - warn: sbfspot.0 (6113) This object will not be created in future versions. Please report this to the developer.
272
- 2020-07-27 19:30:07.200 - warn: sbfspot.0 (6113) Object sbfspot.0.1100173807.lastup is invalid: obj.type has to exist
273
- 2020-07-27 19:30:07.202 - warn: sbfspot.0 (6113) This object will not be created in future versions. Please report this to the developer.
274
- 2020-07-27 19:30:07.205 - warn: sbfspot.0 (6113) Object sbfspot.0.1100173807.error is invalid: obj.type has to exist
275
- 2020-07-27 19:30:07.206 - warn: sbfspot.0 (6113) This object will not be created in future versions. Please report this to the developer.
276
- 2020-07-27 19:30:07.209 - warn: sbfspot.0 (6113) Object sbfspot.0.1100173807.history.today is invalid: obj.type has to exist
277
- 2020-07-27 19:30:07.211 - warn: sbfspot.0 (6113) This object will not be created in future versions. Please report this to the developer.
278
- 2020-07-27 19:30:07.213 - warn: sbfspot.0 (6113) Object sbfspot.0.1100173807.history.last30Days is invalid: obj.type has to exist
279
- 2020-07-27 19:30:07.215 - warn: sbfspot.0 (6113) This object will not be created in future versions. Please report this to the developer.
280
- 2020-07-27 19:30:07.218 - warn: sbfspot.0 (6113) Object sbfspot.0.1100173807.history.last12Months is invalid: obj.type has to exist
281
- 2020-07-27 19:30:07.220 - warn: sbfspot.0 (6113) This object will not be created in future versions. Please report this to the developer.
282
- 2020-07-27 19:30:07.222 - warn: sbfspot.0 (6113) Object sbfspot.0.1100173807.history.years is invalid: obj.type has to exist
283
- 2020-07-27 19:30:07.224 - warn: sbfspot.0 (6113) This object will not be created in future versions. Please report this to the developer.
284
- 2020-07-27 19:30:07.538 - info: host.orangepizero instance system.adapter.sbfspot.0 terminated with code 11 (ADAPTER_REQUESTED_TERMINATION)
285
-
286
- */
287
-
288
211
 
289
212
 
290
213
  async function AddInverterVariables(serial) {
@@ -378,7 +301,7 @@ async function AddObject(key, type, common_name, common_type, common_role, commo
378
301
 
379
302
  adapter.log.debug("addObject " + key);
380
303
 
381
- let obj= {
304
+ const obj= {
382
305
  type: type,
383
306
  common: {
384
307
  name: common_name,
@@ -397,19 +320,6 @@ async function AddObject(key, type, common_name, common_type, common_role, commo
397
320
  }
398
321
 
399
322
 
400
- /*
401
- sbfspot.0 2021-07-08 19:30:16.081 info State value to set for "sbfspot.0.2000562095.history.last12Months" has to be type "number" but received type "string"
402
- sbfspot.0 2021-07-08 19:30:14.909 info State value to set for "sbfspot.0.2000562095.history.years" has to be type "number" but received type "string"
403
- sbfspot.0 2021-07-08 19:30:13.024 info State value to set for "sbfspot.0.2000562095.history.today" has to be type "number" but received type "string"
404
- sbfspot.0 2021-07-08 19:30:12.888 info State value to set for "sbfspot.0.2000562095.history.last30Days" has to be type "number" but received type "string"
405
- */
406
-
407
- /*
408
- async function CheckInverterVariables() {
409
-
410
- }
411
- */
412
-
413
323
 
414
324
  async function DB_Connect() {
415
325
 
@@ -513,7 +423,7 @@ async function DB_CheckLastUploads(serial) {
513
423
 
514
424
  let rows = await DB_Query(query);
515
425
 
516
- let notUploaded = rows.length;
426
+ const notUploaded = rows.length;
517
427
 
518
428
  await adapter.setStateAsync(serial + ".sbfspot.notUploaded", { ack: true, val: notUploaded });
519
429
 
@@ -522,7 +432,7 @@ async function DB_CheckLastUploads(serial) {
522
432
  rows = await DB_Query(query);
523
433
 
524
434
  if (rows.length > 0) {
525
- let updateTimestamp = rows[0].TimeStamp;
435
+ const updateTimestamp = rows[0].TimeStamp;
526
436
  const oDate = new Date(updateTimestamp * 1000);
527
437
  const oDateNow = new Date();
528
438
 
@@ -533,7 +443,7 @@ async function DB_CheckLastUploads(serial) {
533
443
  adapter.log.error("no upload to sbfspot since " + oDate.toLocaleString());
534
444
  }
535
445
 
536
- let lastUpload = oDate.toLocaleString();
446
+ const lastUpload = oDate.toLocaleString();
537
447
 
538
448
  await adapter.setStateAsync(serial + ".sbfspot.LastUpload", { ack: true, val: lastUpload });
539
449
  }
@@ -755,10 +665,36 @@ async function CalcHistory_LastMonth(err, rows, serial) {
755
665
 
756
666
  const data = rows[i];
757
667
 
758
- oLastDays.push({
759
- "date": data["date"],
760
- "value": data["ertrag"]
761
- });
668
+ if (adapter.config.History4Vis2) {
669
+
670
+ const oDate = new Date(data["date"]);
671
+ oDate.setHours(12);
672
+ oDate.setMinutes(0);
673
+
674
+ //for vis-2
675
+ oLastDays.push(
676
+ [
677
+ oDate,
678
+ data["ertrag"]
679
+ ]);
680
+
681
+ /*
682
+ [
683
+ ["2024-04-23T00:00:00.000Z",12551],
684
+ ["2024-04-24T00:00:00.000Z",5898],
685
+ ["2024-04-25T00:00:00.000Z",8373]
686
+ ]
687
+
688
+ */
689
+
690
+ }
691
+ else {
692
+ oLastDays.push({
693
+ "date": data["date"],
694
+ "value": data["ertrag"]
695
+ });
696
+ }
697
+
762
698
  //adapter.log.debug(JSON.stringify(oLastDays));
763
699
 
764
700
  }
@@ -874,10 +810,46 @@ async function CalcHistory_Today(err, rows, serial) {
874
810
 
875
811
  const data = rows[i];
876
812
 
877
- oLastDays.push({
878
- "time": data["time"],
879
- "value": data["ertrag"]
880
- });
813
+ if (adapter.config.History4Vis2) {
814
+
815
+
816
+ const oDate = new Date();
817
+
818
+ const times = data["time"].split(":");
819
+ oDate.setHours(parseInt(times[0]));
820
+ oDate.setMinutes(parseInt(times[1]));
821
+ oDate.setSeconds(0);
822
+
823
+ adapter.log.debug("### " + data["time"] + " " + JSON.stringify(times) + " " + oDate.toLocaleString());
824
+
825
+ //for vis-2
826
+ oLastDays.push(
827
+ [
828
+ oDate,
829
+ data["ertrag"]
830
+ ]);
831
+
832
+ /*
833
+ [
834
+ ["2024-05-23T14:45:07.403Z",1],
835
+ ["2024-05-23T14:45:07.403Z",3],
836
+ ["2024-05-23T14:45:07.403Z",4],
837
+ ["2024-05-23T14:45:07.403Z",6],
838
+ ["2024-05-23T14:45:07.403Z",9],
839
+ ["2024-05-23T14:45:07.403Z",12],
840
+ ["2024-05-23T14:45:07.404Z",16],
841
+ ["2024-05-23T14:45:07.404Z",20]]
842
+
843
+ */
844
+
845
+ }
846
+ else {
847
+ oLastDays.push({
848
+ "time": data["time"],
849
+ "value": data["ertrag"]
850
+ });
851
+
852
+ }
881
853
 
882
854
  }
883
855
 
@@ -977,13 +949,38 @@ async function CalcHistory_Years(err, rows, serial) {
977
949
 
978
950
  adapter.log.debug("fillup " + (installyear + n) + " " + yearvalue);
979
951
 
980
- oLastYears.push({
981
- "year": installyear + n,
982
- "value": parseInt(yearvalue)
983
- });
952
+ if (adapter.config.History4Vis2) {
953
+
954
+ const year = installyear + n;
955
+ const oDate = new Date(year);
956
+
957
+ //for vis-2
958
+ oLastYears.push(
959
+ [
960
+ oDate,
961
+ parseInt(yearvalue)
962
+ ]);
963
+
964
+ /*
965
+ [
966
+ ["2008-01-01T00:00:00.000Z",7000],
967
+ ["2009-01-01T00:00:00.000Z",2309000],
968
+ ["2010-01-01T00:00:00.000Z",4445000],
969
+ ["2011-01-01T00:00:00.000Z",7019000],["2012-01-01T00:00:00.000Z",9371000],["2013-01-01T00:00:00.000Z",11393000],["2014-01-01T00:00:00.000Z",13666000],["2015-01-01T00:00:00.000Z",16034000],["2016-01-01T00:00:00.000Z",18052202],["2017-01-01T00:00:00.000Z",20172891],["2018-01-01T00:00:00.000Z",22476037],["2019-01-01T00:00:00.000Z",24617484],["2020-01-01T00:00:00.000Z",26802727],["2021-01-01T00:00:00.000Z",28673935],["2022-01-01T00:00:00.000Z",30710918],["2023-01-01T00:00:00.000Z",32662549],["2024-01-01T00:00:00.000Z",33370608]]
970
+
971
+
972
+ */
973
+
974
+ }
975
+ else {
976
+ oLastYears.push({
977
+ "year": installyear + n,
978
+ "value": parseInt(yearvalue)
979
+ });
980
+ }
984
981
  }
985
982
 
986
-
983
+
987
984
  } else {
988
985
 
989
986
 
@@ -991,10 +988,25 @@ async function CalcHistory_Years(err, rows, serial) {
991
988
 
992
989
  adapter.log.debug(data["date"] + " " + yearvalue);
993
990
 
994
- oLastYears.push({
995
- "year": data["date"],
996
- "value": yearvalue
997
- });
991
+ if (adapter.config.History4Vis2) {
992
+
993
+ const oDate = new Date(data["date"]);
994
+ //for vis-2
995
+ oLastYears.push(
996
+ [
997
+ oDate,
998
+ yearvalue
999
+ ]);
1000
+ }
1001
+ else {
1002
+
1003
+ oLastYears.push({
1004
+ "year": data["date"],
1005
+ "value": yearvalue
1006
+ });
1007
+ }
1008
+
1009
+
998
1010
  }
999
1011
  firstyear = false;
1000
1012
 
@@ -1057,12 +1069,33 @@ async function CalcHistory_Months(err, rows, serial) {
1057
1069
  for (const i in rows) {
1058
1070
 
1059
1071
  const data = rows[i];
1072
+ if (adapter.config.History4Vis2) {
1060
1073
 
1061
- oLastMonth.push({
1062
- "month": data["date"],
1063
- "value": data["ertrag"]
1064
- });
1074
+ const oDate = new Date(data["date"]);
1075
+ //for vis-2
1076
+ oLastMonth.push(
1077
+ [
1078
+ oDate,
1079
+ data["ertrag"]
1080
+ ]);
1081
+
1082
+ /*
1083
+ [
1084
+ ["2023-05-01T00:00:00.000Z",31422838],
1085
+ ["2023-06-01T00:00:00.000Z",31732951],
1086
+ ["2023-07-01T00:00:00.000Z",32009703],
1087
+ ["2023-08-01T00:00:00.000Z",32245904],["2023-09-01T00:00:00.000Z",32505135],["2023-10-01T00:00:00.000Z",32615574],["2023-11-01T00:00:00.000Z",32645852],["2023-12-01T00:00:00.000Z",32662549],["2024-01-01T00:00:00.000Z",32689084],["2024-02-01T00:00:00.000Z",32754174],["2024-03-01T00:00:00.000Z",32940065],["2024-04-01T00:00:00.000Z",33184421],["2024-05-01T00:00:00.000Z",33370608]]
1088
+
1089
+
1090
+ */
1065
1091
 
1092
+ }
1093
+ else {
1094
+ oLastMonth.push({
1095
+ "month": data["date"],
1096
+ "value": data["ertrag"]
1097
+ });
1098
+ }
1066
1099
  }
1067
1100
 
1068
1101
  await adapter.setStateAsync(serial + ".history.last12Months", { ack: true, val: JSON.stringify(oLastMonth) });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.sbfspot",
3
- "version": "4.2.4",
3
+ "version": "4.3.2",
4
4
  "description": "sbfspot (SMA inverter) Adapter",
5
5
  "author": {
6
6
  "name": "René G.",
@@ -18,38 +18,38 @@
18
18
  "url": "https://github.com/rg-engineering/ioBroker.sbfspot"
19
19
  },
20
20
  "engines": {
21
- "node": ">= 16"
21
+ "node": ">= 18"
22
22
  },
23
23
  "dependencies": {
24
- "@iobroker/adapter-core": "3.0.4",
25
- "better-sqlite3": "9.2.2",
26
- "mysql2": "3.7.0",
27
- "suncalc2": "1.8.1"
24
+ "@iobroker/adapter-core": "^3.1.4",
25
+ "better-sqlite3": "^10.0.0",
26
+ "mysql2": "^3.9.7",
27
+ "suncalc2": "^1.8.1"
28
28
  },
29
29
  "devDependencies": {
30
- "@alcalzone/release-script": "3.7.0",
31
- "@alcalzone/release-script-plugin-iobroker": "3.7.0",
32
- "@alcalzone/release-script-plugin-license": "3.7.0",
33
- "@iobroker/adapter-dev": "1.2.0",
34
- "@iobroker/testing": "4.1.0",
35
- "@types/chai": "4.3.11",
36
- "@types/chai-as-promised": "7.1.8",
37
- "@types/gulp": "4.0.17",
38
- "@types/mocha": "10.0.6",
39
- "@types/node": "20.11.0",
40
- "@types/proxyquire": "1.3.31",
41
- "@types/request-promise-native": "1.0.21",
42
- "@types/sinon": "17.0.3",
43
- "@types/sinon-chai": "3.2.12",
44
- "axios": "1.6.5",
45
- "chai": "4.4.1",
46
- "chai-as-promised": "7.1.1",
47
- "eslint": "8.56.0",
48
- "gulp": "4.0.2",
49
- "mocha": "10.2.0",
50
- "proxyquire": "2.1.3",
51
- "sinon": "17.0.1",
52
- "sinon-chai": "3.7.0"
30
+ "@alcalzone/release-script": "^3.7.0",
31
+ "@alcalzone/release-script-plugin-iobroker": "^3.7.0",
32
+ "@alcalzone/release-script-plugin-license": "^3.7.0",
33
+ "@iobroker/adapter-dev": "^1.3.0",
34
+ "@iobroker/testing": "^4.1.3",
35
+ "@types/chai": "^4.3.11",
36
+ "@types/chai-as-promised": "^7.1.8",
37
+ "@types/gulp": "^4.0.17",
38
+ "@types/mocha": "^10.0.6",
39
+ "@types/node": "^20.12.12",
40
+ "@types/proxyquire": "^1.3.31",
41
+ "@types/request-promise-native": "^1.0.21",
42
+ "@types/sinon": "^17.0.3",
43
+ "@types/sinon-chai": "^3.2.12",
44
+ "axios": "^1.7.2",
45
+ "chai": "^4.4.1",
46
+ "chai-as-promised": "^7.1.2",
47
+ "eslint": "^9.3.0",
48
+ "gulp": "^5.0.0",
49
+ "mocha": "^10.4.0",
50
+ "proxyquire": "^2.1.3",
51
+ "sinon": "^18.0.0",
52
+ "sinon-chai": "^3.7.0"
53
53
  },
54
54
  "main": "main.js",
55
55
  "bugs": {