iobroker.autodarts 0.0.14 → 0.2.0

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.
package/README.md CHANGED
@@ -19,6 +19,15 @@
19
19
  - Announce the current player via TTS.
20
20
  - Trigger other automations in ioBroker.
21
21
 
22
+ It also provides:
23
+
24
+ - `visit.score`: Total score of the last complete visit (3 darts).
25
+ - `throw.current`: Numeric score of the last thrown dart.
26
+ - `throw.isTriple`: Boolean flag that only turns true for triple hits above a configurable score threshold.
27
+ - `throw.isBullseye`: Boolean flag that only turns true for bullseye hits.
28
+ - `system.boardVersion`: Reported Board Manager version.
29
+ - `system.cam0/1/2`: JSON with camera settings (width, height, fps).
30
+
22
31
  ## What this adapter does NOT do
23
32
 
24
33
  - ❌ No data is sent to the internet or to third-party servers.
@@ -47,6 +56,17 @@ In the adapter settings, enter:
47
56
  <!--
48
57
  ### **WORK IN PROGRESS**
49
58
  -->
59
+ ### 0.2.0 (2025-12-25)
60
+ - Added datapoint for bulls-hit
61
+ - Added maximun triple-hit flag score
62
+ - Update config
63
+ - Warning in log cleared
64
+
65
+ ### 0.1.0 (2025-12-23)
66
+ - Added datapoints for visit score, current dart score, triple-hit flag with configurable minimum score, and camera configuration (cam0–cam2).
67
+ - Cleaned up adapter logic and internal polling/timing.
68
+ - Updated translations.
69
+
50
70
  ### 0.0.14 (2025-12-22)
51
71
  - fix
52
72
 
@@ -1,7 +1,13 @@
1
1
  {
2
- "host_ip": "Autodarts (Boardmanager) Host / IP",
2
+ "host_ip": "Autodarts (Boardmanager) Host/IP",
3
+ "host_ip_help": "IP-Adresse des lokalen Autodarts Boardmanagers.",
3
4
  "host_port": "Autodarts (Boardmanager) Port",
4
- "intro_txt": "Autodarts-Adapterkonfiguration.<br>Bitte gebe IP und Port vom Boardmanager sowie den Abfrageintervall ein.",
5
- "outro_txt": "Team inventwo • <a href=\"https://github.com/inventwo\">https://github.com/inventwo</a>",
6
- "polling": "Abfrageintervall (ms)"
5
+ "host_port_help": "Portnummer des lokalen Autodarts Boardmanagers.",
6
+ "intro_txt": "Konfiguration des Autodarts-Adapters.",
7
+ "polling": "Abfrageintervall (ms)",
8
+ "polling_help": "Abfrageintervall in Millisekunden zum Abrufen von Daten vom Autodarts Boardmanager.",
9
+ "triple_flag": "Minimales Feld für den Triple-Trigger",
10
+ "triple_flag2": "Maximales Feld für den Triple-Trigger",
11
+ "triple_flag2_help": "Feld „Maximale Punktzahl“ für den Triple-Trigger. Darts mit einer Punktzahl über diesem Wert lösen den Triple-Trigger-Datenpunkt nicht aus.",
12
+ "triple_flag_help": "Feld „Mindestpunktzahl“ für den Triple-Trigger. Darts mit einer Punktzahl unter diesem Wert lösen den Triple-Trigger-Datenpunkt nicht aus."
7
13
  }
@@ -1,7 +1,13 @@
1
1
  {
2
- "intro_txt": "Autodarts adapter configuration.<br>Please enter host and port from Boardmanager as well as the polling interval.",
3
- "outro_txt": "Team inventwo • <a href=\"https://github.com/inventwo\">https://github.com/inventwo</a>",
4
- "host_ip": "Autodarts (Boardmanager) Host / IP",
2
+ "host_ip": "Autodarts (Boardmanager) Host/IP",
3
+ "host_ip_help": "IP address of the local Autodarts Boardmanager.",
5
4
  "host_port": "Autodarts (Boardmanager) Port",
6
- "polling": "Polling interval (ms)"
5
+ "host_port_help": "Port number of the local Autodarts Boardmanager.",
6
+ "intro_txt": "Autodarts adapter configuration.",
7
+ "polling": "Polling interval (ms)",
8
+ "polling_help": "Polling interval in milliseconds to retrieve data from the Autodarts Boardmanager.",
9
+ "triple_flag": "Minimum field for the triple trigger",
10
+ "triple_flag2": "Maximum field for the triple trigger",
11
+ "triple_flag2_help": "Maximum score field for the triple trigger. Darts with a score above this value will not trigger the Triple-Trigger datapoint.",
12
+ "triple_flag_help": "Minimum score field for the triple trigger. Darts with a score below this value will not trigger the Triple-Trigger datapoint."
7
13
  }
@@ -1,7 +1,13 @@
1
1
  {
2
- "host_ip": "Autodarts (Boardmanager) Host/IP",
2
+ "host_ip": "Host/IP de Autodarts (Boardmanager)",
3
+ "host_ip_help": "Dirección IP del administrador local de Autodarts Board.",
3
4
  "host_port": "Puerto Autodarts (Boardmanager)",
4
- "intro_txt": "Configuración del adaptador Autodarts.<br>Ingrese el host y el puerto de Boardmanager, así como el intervalo de sondeo.",
5
- "outro_txt": "Equipo inventwo <a href=\"https://github.com/inventwo\">https://github.com/inventwo</a>",
6
- "polling": "Intervalo de sondeo (ms)"
5
+ "host_port_help": "Número de puerto del administrador local de Autodarts Boardmanager.",
6
+ "intro_txt": "Configuración del adaptador Autodarts.",
7
+ "polling": "Intervalo de sondeo (ms)",
8
+ "polling_help": "Intervalo de sondeo en milisegundos para recuperar datos del Autodarts Boardmanager.",
9
+ "triple_flag": "Campo mínimo para el triple disparador",
10
+ "triple_flag2": "Campo máximo para el triple disparador",
11
+ "triple_flag2_help": "Campo de puntuación máxima para el triple disparador. Los dardos con una puntuación superior a este valor no activarán el punto de datos Triple-Trigger.",
12
+ "triple_flag_help": "Campo de puntuación mínima para el triple disparador. Los dardos con una puntuación inferior a este valor no activarán el punto de datos Triple-Trigger."
7
13
  }
@@ -1,7 +1,13 @@
1
1
  {
2
- "host_ip": "Hôte / IP Autodarts (Boardmanager)",
2
+ "host_ip": "Autodarts (Boardmanager) Hôte/IP",
3
+ "host_ip_help": "Adresse IP de l'Autodarts Boardmanager local.",
3
4
  "host_port": "Port Autodarts (Boardmanager)",
4
- "intro_txt": "Configuration de l'adaptateur Autodarts.<br>Veuillez saisir l'hôte et le port de Boardmanager ainsi que l'intervalle d'interrogation.",
5
- "outro_txt": "Équipe inventwo <a href=\"https://github.com/inventwo\">https://github.com/inventwo</a>",
6
- "polling": "Intervalle d'interrogation (ms)"
5
+ "host_port_help": "Numéro de port du Boardmanager Autodarts local.",
6
+ "intro_txt": "Configuration de l'adaptateur Autodarts.",
7
+ "polling": "Intervalle d'interrogation (ms)",
8
+ "polling_help": "Intervalle d'interrogation en millisecondes pour récupérer les données d'Autodarts Boardmanager.",
9
+ "triple_flag": "Champ minimum pour le triple déclencheur",
10
+ "triple_flag2": "Champ maximum pour le triple déclencheur",
11
+ "triple_flag2_help": "Champ de score maximum pour le triple déclencheur. Les fléchettes avec un score supérieur à cette valeur ne déclencheront pas le point de données Triple-Trigger.",
12
+ "triple_flag_help": "Champ de score minimum pour le triple déclencheur. Les fléchettes avec un score inférieur à cette valeur ne déclencheront pas le point de données Triple-Trigger."
7
13
  }
@@ -1,7 +1,13 @@
1
1
  {
2
2
  "host_ip": "Host/IP Autodarts (Boardmanager).",
3
+ "host_ip_help": "Indirizzo IP del Boardmanager Autodarts locale.",
3
4
  "host_port": "Porta Autodarts (Boardmanager).",
4
- "intro_txt": "Configurazione dell'adattatore Autodarts.<br>Inserisci host e porta da Boardmanager nonché l'intervallo di polling.",
5
- "outro_txt": "Team inventtwo • <a href=\"https://github.com/inventtwo\">https://github.com/inventtwo</a>",
6
- "polling": "Intervallo di polling (ms)"
5
+ "host_port_help": "Numero di porta del Boardmanager Autodarts locale.",
6
+ "intro_txt": "Configurazione dell'adattatore Autodarts.",
7
+ "polling": "Intervallo di polling (ms)",
8
+ "polling_help": "Intervallo di polling in millisecondi per recuperare i dati da Autodarts Boardmanager.",
9
+ "triple_flag": "Campo minimo per il triplo trigger",
10
+ "triple_flag2": "Campo massimo per il triplo trigger",
11
+ "triple_flag2_help": "Campo del punteggio massimo per il triplo trigger. Le freccette con un punteggio superiore a questo valore non attiveranno il punto dati Triple-Trigger.",
12
+ "triple_flag_help": "Campo del punteggio minimo per il triplo trigger. Le freccette con un punteggio inferiore a questo valore non attiveranno il punto dati Triple-Trigger."
7
13
  }
@@ -1,7 +1,13 @@
1
1
  {
2
- "host_ip": "Autodarts (Boardmanager) Host / IP",
2
+ "host_ip": "Autodarts (Bestuursmanager) Host/IP",
3
+ "host_ip_help": "IP-adres van de lokale Autodarts Boardmanager.",
3
4
  "host_port": "Autodarts (Bestuursmanager) Port",
4
- "intro_txt": "Autodarts-adapterconfiguratie.<br>Voer de host en poort van Boardmanager in, evenals het polling-interval.",
5
- "outro_txt": "Team inventwo • <a href=\"https://github.com/inventwo\">https://github.com/inventwo</a>",
6
- "polling": "Polling-interval (ms)"
5
+ "host_port_help": "Poortnummer van de lokale Autodarts Boardmanager.",
6
+ "intro_txt": "Autodarts-adapterconfiguratie.",
7
+ "polling": "Polling-interval (ms)",
8
+ "polling_help": "Polling-interval in milliseconden om gegevens uit de Autodarts Boardmanager op te halen.",
9
+ "triple_flag": "Minimumveld voor de drievoudige trigger",
10
+ "triple_flag2": "Maximaal veld voor de drievoudige trigger",
11
+ "triple_flag2_help": "Maximaal scoreveld voor de drievoudige trigger. Darten met een score boven deze waarde activeren het Triple-Trigger-datapunt niet.",
12
+ "triple_flag_help": "Minimumscoreveld voor de drievoudige trigger. Darten met een score onder deze waarde activeren het Triple-Trigger-datapunt niet."
7
13
  }
@@ -1,7 +1,13 @@
1
1
  {
2
- "host_ip": "Autodarts (Boardmanager) Host / IP",
2
+ "host_ip": "Autodarts (Boardmanager) Host/IP",
3
+ "host_ip_help": "Adres IP lokalnego zarządcy Autodarts.",
3
4
  "host_port": "Port Autodarts (Boardmanager).",
4
- "intro_txt": "Konfiguracja adaptera Autodarts.<br>Wprowadź host i port z Boardmanager oraz interwał odpytywania.",
5
- "outro_txt": "Zespół inventwo • <a href=\"https://github.com/inventwo\">https://github.com/inventwo</a>",
6
- "polling": "Interwał odpytywania (ms)"
5
+ "host_port_help": "Numer portu lokalnego zarządcy Autodarts.",
6
+ "intro_txt": "Konfiguracja adaptera Autodarts.",
7
+ "polling": "Interwał odpytywania (ms)",
8
+ "polling_help": "Interwał odpytywania w milisekundach w celu pobrania danych z menedżera Autodarts Boardmanager.",
9
+ "triple_flag": "Minimalne pole dla potrójnego wyzwalacza",
10
+ "triple_flag2": "Maksymalne pole dla potrójnego wyzwalacza",
11
+ "triple_flag2_help": "Pole maksymalnego wyniku dla potrójnego wyzwalacza. Rzutki z wynikiem powyżej tej wartości nie uruchomią punktu danych Triple-Trigger.",
12
+ "triple_flag_help": "Pole minimalnego wyniku dla potrójnego wyzwalacza. Rzutki z wynikiem poniżej tej wartości nie uruchomią punktu danych Triple-Trigger."
7
13
  }
@@ -1,7 +1,13 @@
1
1
  {
2
2
  "host_ip": "Host/IP do Autodarts (Boardmanager)",
3
+ "host_ip_help": "Endereço IP do Autodarts Boardmanager local.",
3
4
  "host_port": "Porto Autodarts (Boardmanager)",
4
- "intro_txt": "Configuração do adaptador Autodarts.<br>Insira o host e a porta do Boardmanager, bem como o intervalo de pesquisa.",
5
- "outro_txt": "Equipe inventtwo <a href=\"https://github.com/inventwo\">https://github.com/inventwo</a>",
6
- "polling": "Intervalo de pesquisa (ms)"
5
+ "host_port_help": "Número da porta do Autodarts Boardmanager local.",
6
+ "intro_txt": "Configuração do adaptador Autodarts.",
7
+ "polling": "Intervalo de pesquisa (ms)",
8
+ "polling_help": "Intervalo de pesquisa em milissegundos para recuperar dados do Autodarts Boardmanager.",
9
+ "triple_flag": "Campo mínimo para o disparo triplo",
10
+ "triple_flag2": "Campo máximo para o disparo triplo",
11
+ "triple_flag2_help": "Campo de pontuação máxima para o disparo triplo. Dardos com pontuação acima deste valor não acionarão o ponto de dados Triple-Trigger.",
12
+ "triple_flag_help": "Campo de pontuação mínima para o disparo triplo. Dardos com pontuação abaixo deste valor não acionarão o ponto de dados Triple-Trigger."
7
13
  }
@@ -1,7 +1,13 @@
1
1
  {
2
2
  "host_ip": "Autodarts (Boardmanager) Хост/IP",
3
+ "host_ip_help": "IP-адрес местного Autodarts Boardmanager.",
3
4
  "host_port": "Порт Autodarts (Boardmanager)",
4
- "intro_txt": "Конфигурация адаптера Autodarts.<br>Укажите хост и порт из Boardmanager, а также интервал опроса.",
5
- "outro_txt": "Команда inventwo • <a href=\"https://github.com/inventwo\">https://github.com/inventwo</a>",
6
- "polling": "Интервал опроса (мс)"
5
+ "host_port_help": "Номер порта местного Autodarts Boardmanager.",
6
+ "intro_txt": "Конфигурация адаптера Autodarts.",
7
+ "polling": "Интервал опроса (мс)",
8
+ "polling_help": "Интервал опроса в миллисекундах для получения данных из Autodarts Boardmanager.",
9
+ "triple_flag": "Минимальное поле для тройного триггера",
10
+ "triple_flag2": "Максимальное поле для тройного триггера",
11
+ "triple_flag2_help": "Поле максимального результата для тройного триггера. Дартс с результатом выше этого значения не будет активировать точку данных тройного триггера.",
12
+ "triple_flag_help": "Поле минимального балла для тройного триггера. Дартс со счетом ниже этого значения не будет активировать точку данных тройного триггера."
7
13
  }
@@ -1,7 +1,13 @@
1
1
  {
2
- "host_ip": "Autodarts (Boardmanager) Хост / IP",
2
+ "host_ip": "Autodarts (Boardmanager) Host/IP",
3
+ "host_ip_help": "IP-адреса місцевого менеджера Autodarts Board.",
3
4
  "host_port": "Autodarts (Boardmanager) Порт",
4
- "intro_txt": "Конфігурація адаптера Autodarts.<br>Введіть хост і порт із Boardmanager, а також інтервал опитування.",
5
- "outro_txt": "Команда inventwo • <a href=\"https://github.com/inventwo\">https://github.com/inventwo</a>",
6
- "polling": "Інтервал опитування (мс)"
5
+ "host_port_help": "Номер порту місцевого менеджера Autodarts Board.",
6
+ "intro_txt": "Конфігурація адаптера Autodarts.",
7
+ "polling": "Інтервал опитування (мс)",
8
+ "polling_help": "Інтервал опитування в мілісекундах для отримання даних із Autodarts Boardmanager.",
9
+ "triple_flag": "Мінімальне поле для потрійного тригера",
10
+ "triple_flag2": "Максимальне поле для потрійного тригера",
11
+ "triple_flag2_help": "Поле максимального балу для потрійного тригера. Дартс із результатом вище цього значення не активує точку даних Triple-Trigger.",
12
+ "triple_flag_help": "Мінімальне поле для потрійного тригера. Дартс із результатом, нижчим за це значення, не активує точку даних Triple-Trigger."
7
13
  }
@@ -1,7 +1,13 @@
1
1
  {
2
2
  "host_ip": "Autodarts (Boardmanager) 主机/IP",
3
+ "host_ip_help": "本地 Autodarts Boardmanager 的 IP 地址。",
3
4
  "host_port": "Autodarts(Boardmanager)端口",
4
- "intro_txt": "Autodarts 适配器配置。<br>请输入 Boardmanager 中的主机和端口以及轮询间隔。",
5
- "outro_txt": "团队 inventwo • <a href=\"https://github.com/inventwo\">https://github.com/inventwo</a>",
6
- "polling": "轮询间隔(毫秒)"
5
+ "host_port_help": "本地 Autodarts Boardmanager 的端口号。",
6
+ "intro_txt": "Autodarts 适配器配置。",
7
+ "polling": "轮询间隔(毫秒)",
8
+ "polling_help": "从 Autodarts Boardmanager 检索数据的轮询间隔(以毫秒为单位)。",
9
+ "triple_flag": "三重触发器的最小字段",
10
+ "triple_flag2": "三重触发器的最大字段",
11
+ "triple_flag2_help": "三重触发器的最大分数字段。分数高于此值的飞镖将不会触发三重触发数据点。",
12
+ "triple_flag_help": "三重触发器的最低分数字段。分数低于此值的飞镖将不会触发三重触发数据点。"
7
13
  }
@@ -8,61 +8,153 @@
8
8
  "newLine": true,
9
9
  "sm": 12,
10
10
  "xs": 12,
11
- "md": 8,
12
- "lg": 6,
13
- "xl": 4,
11
+ "md": 12,
12
+ "lg": 12,
13
+ "xl": 12,
14
14
  "style": {
15
- "border": "1px solid #ccc",
15
+ "border": "1px solid",
16
16
  "borderRadius": "0px",
17
17
  "padding": "8px",
18
+ "marginTop": "10px",
18
19
  "marginBottom": "10px",
19
20
  "textAlign": "center",
20
- "font-size": "larger"
21
+ "font-size": "20px"
21
22
  }
22
23
  },
23
24
  "host": {
24
25
  "type": "text",
25
26
  "label": "host_ip",
27
+ "help": "host_ip_help",
26
28
  "newLine": true,
27
29
  "sm": 12,
28
30
  "xs": 12,
29
- "md": 8,
31
+ "md": 6,
30
32
  "lg": 6,
31
- "xl": 4
33
+ "xl": 6,
34
+ "style": {
35
+ "marginTop": "10px",
36
+ "marginBottom": "10px"
37
+ }
32
38
  },
33
39
  "port": {
34
40
  "type": "number",
35
41
  "label": "host_port",
42
+ "newLine": false,
43
+ "sm": 12,
44
+ "xs": 12,
45
+ "md": 6,
46
+ "lg": 6,
47
+ "xl": 6,
48
+ "style": {
49
+ "marginTop": "10px",
50
+ "marginBottom": "10px"
51
+ }
52
+ },
53
+ "tripleMinScore": {
54
+ "type": "select",
55
+ "label": "triple_flag",
56
+ "help": "triple_flag_help",
57
+ "default": 1,
58
+ "options": [
59
+ { "label": "1", "value": 1 },
60
+ { "label": "2", "value": 2 },
61
+ { "label": "3", "value": 3 },
62
+ { "label": "4", "value": 4 },
63
+ { "label": "5", "value": 5 },
64
+ { "label": "6", "value": 6 },
65
+ { "label": "7", "value": 7 },
66
+ { "label": "8", "value": 8 },
67
+ { "label": "9", "value": 9 },
68
+ { "label": "10", "value": 10 },
69
+ { "label": "11", "value": 11 },
70
+ { "label": "12", "value": 12 },
71
+ { "label": "13", "value": 13 },
72
+ { "label": "14", "value": 14 },
73
+ { "label": "15", "value": 15 },
74
+ { "label": "16", "value": 16 },
75
+ { "label": "17", "value": 17 },
76
+ { "label": "18", "value": 18 },
77
+ { "label": "19", "value": 19 },
78
+ { "label": "20", "value": 20 }
79
+ ],
36
80
  "newLine": true,
37
81
  "sm": 12,
38
82
  "xs": 12,
39
- "md": 8,
83
+ "md": 6,
40
84
  "lg": 6,
41
- "xl": 4
85
+ "xl": 6,
86
+ "style": {
87
+ "marginTop": "10px",
88
+ "marginBottom": "10px"
89
+ }
90
+ },
91
+ "tripleMaxScore": {
92
+ "type": "select",
93
+ "label": "triple_flag2",
94
+ "help": "triple_flag2_help",
95
+ "default": 20,
96
+ "options": [
97
+ { "label": "1", "value": 1 },
98
+ { "label": "2", "value": 2 },
99
+ { "label": "3", "value": 3 },
100
+ { "label": "4", "value": 4 },
101
+ { "label": "5", "value": 5 },
102
+ { "label": "6", "value": 6 },
103
+ { "label": "7", "value": 7 },
104
+ { "label": "8", "value": 8 },
105
+ { "label": "9", "value": 9 },
106
+ { "label": "10", "value": 10 },
107
+ { "label": "11", "value": 11 },
108
+ { "label": "12", "value": 12 },
109
+ { "label": "13", "value": 13 },
110
+ { "label": "14", "value": 14 },
111
+ { "label": "15", "value": 15 },
112
+ { "label": "16", "value": 16 },
113
+ { "label": "17", "value": 17 },
114
+ { "label": "18", "value": 18 },
115
+ { "label": "19", "value": 19 },
116
+ { "label": "20", "value": 20 }
117
+ ],
118
+ "newLine": false,
119
+ "sm": 12,
120
+ "xs": 12,
121
+ "md": 6,
122
+ "lg": 6,
123
+ "xl": 6,
124
+ "style": {
125
+ "marginTop": "10px",
126
+ "marginBottom": "10px"
127
+ }
42
128
  },
43
129
  "interval": {
44
130
  "type": "number",
45
131
  "label": "polling",
132
+ "help": "polling_help",
46
133
  "newLine": true,
47
134
  "sm": 12,
48
135
  "xs": 12,
49
- "md": 8,
50
- "lg": 6,
51
- "xl": 4
136
+ "md": 12,
137
+ "lg": 12,
138
+ "xl": 12,
139
+ "style": {
140
+ "marginTop": "10px",
141
+ "marginBottom": "10px"
142
+ }
52
143
  },
53
144
  "outro": {
54
145
  "type": "staticText",
55
- "text": "outro_txt",
146
+ "text": "Team inventwo • <a href=\"https://github.com/inventwo\">https://github.com/inventwo</a> • by skvarel",
56
147
  "newLine": true,
57
148
  "sm": 12,
58
149
  "xs": 12,
59
- "md": 8,
60
- "lg": 6,
61
- "xl": 4,
150
+ "md": 12,
151
+ "lg": 12,
152
+ "xl": 12,
62
153
  "style": {
63
- "border": "1px solid #ccc",
154
+ "border": "1px solid",
64
155
  "borderRadius": "0px",
65
156
  "padding": "8px",
157
+ "marginTop": "10px",
66
158
  "marginBottom": "10px",
67
159
  "textAlign": "center",
68
160
  "font-size": "larger"
package/io-package.json CHANGED
@@ -1,8 +1,34 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "autodarts",
4
- "version": "0.0.14",
4
+ "version": "0.2.0",
5
5
  "news": {
6
+ "0.2.0": {
7
+ "en": "Added datapoint for bulls-hit\nAdded maximun triple-hit flag score\nUpdate config\nWarning in log cleared",
8
+ "de": "Datenpunkt für Bullen-Hit hinzugefügt\nZusätzlich maximun triple-hit flag score\nUpdate config\nWarnung im Protokoll gelöscht",
9
+ "ru": "Добавлена точка данных для быков-хит\nДобавлена тройная оценка Maximun\nОбновление конфигурации\nПредупреждение в журнале очищено",
10
+ "pt": "Ponto de dados adicionado para bulls-hit\nPontuação da bandeira máxima de três hit\nActualizar a configuração\nAviso no log apagado",
11
+ "nl": "Toegevoegd datapoint voor bulls-hit\nToegevoegd maximiun triple-hit vlag score\nConfiguratie bijwerken\nWaarschuwing in log gewist",
12
+ "fr": "Ajout du point de données pour bulls-hit\nAjout de maximun triple-hit drapeau score\nMettre à jour la configuration\nAvertissement dans le journal effacé",
13
+ "it": "Datapoint aggiunto per bulls-hit\nAggiunto maximun triple-hit flag punteggio\nAggiornamento configurazione\nAvviso in log sgomberato",
14
+ "es": "Punto de datos añadido para los toros\nAgregado maximun triple marca de bandera\nActualizar configuración\nAdvertencia en el registro despejado",
15
+ "pl": "Dodano punkt danych dla byków\nDodano wynik flagi maximun triplehit\nAktualizuj konfigurację\nOstrzeżenie w dzienniku wyczyszczonym",
16
+ "uk": "Додано точку даних для биків-хіт\nДодано максимальний потрійний-hit прапорець бал\nНалаштування оновлення\nПопередження в журналі",
17
+ "zh-cn": "给 bull- hit 添加数据点\n增加最大值的三重旗分\n更新配置\n清除日志中的警告"
18
+ },
19
+ "0.1.0": {
20
+ "en": "Added datapoints for visit score, current dart score, triple-hit flag with configurable minimum score, and camera configuration (cam0–cam2).\nCleaned up adapter logic and internal polling/timing.\nUpdated translations.",
21
+ "de": "Weitere Datenpunkte für Besuchscore, aktuelle Dart-Score, Tripel-hit-Flag mit konfigurierbaren minimalen Punktzahl und Kamerakonfiguration (cam0–cam2).\nAufgereinigte Adapterlogik und interne Abfrage/timing.\nAktualisierte Übersetzungen.",
22
+ "ru": "Добавлены точки данных для оценки посещений, текущая оценка дарта, флаг тройного удара с настраиваемым минимальным баллом и конфигурация камеры (cam0-cam2).\nОчищена адаптерная логика и внутренний опрос/настройка.\nОбновленные переводы.",
23
+ "pt": "Adicionados pontos de dados para a pontuação de visita, pontuação de dardo atual, bandeira de triplo hit com pontuação mínima configurável, e configuração da câmera (cam0–cam2).\nLimpei a lógica do adaptador e as pesquisas internas.\nTradução atualizada.",
24
+ "nl": "Toegevoegd datapoints voor bezoek score, huidige dart score, triple-hit vlag met configureerbare minimum score, en camera configuratie (cam0.\nOpgeruimd adapter logica en interne peiling / timing.\nBijgewerkte vertalingen.",
25
+ "fr": "Ajout de points de données pour le score de visite, le score de fléchette actuel, le drapeau triple-hit avec le score minimum configurable et la configuration de la caméra (cam0–cam2).\nNettoyer la logique de l'adaptateur et effectuer des sondages internes/timing.\nTraductions actualisées.",
26
+ "it": "Aggiunti i datapoint per il punteggio di visita, il punteggio di freccette corrente, la bandiera a triplo punto con il punteggio minimo configurabile e la configurazione della fotocamera (cam0–cam2).\nPulito logica adattatore e polling/timing interno.\nTraduzione aggiornata.",
27
+ "es": "Puntos de datos añadidos para la puntuación de la visita, puntaje del dardo actual, bandera triple con puntaje mínimo configurable, y configuración de la cámara (cam0–cam2).\nLógica del adaptador limpiado y polinización interna / estimulación.\nTraducciones actualizadas.",
28
+ "pl": "Dodano punkty datapointowe dla wyniku odwiedzin, aktualny wynik dart, flagę trójuderzeniową z konfigurowalnym minimalnym wynikiem oraz konfigurację kamery (cam0- cam2).\nOczyszczona logika adaptera i wewnętrzny sondaż / czas.\nAktualizacja tłumaczeń.",
29
+ "uk": "Додано точки даних для облікового запису, поточний запис dart, потрійний прапор з налаштуванням мінімального балу та конфігурації камери (cam0–cam2).\nЗнімання логіки адаптера та внутрішнього опитування / термінів.\nОновлені переклади.",
30
+ "zh-cn": "添加了访问分数的数据点,当前飞镖分数,三重击旗可配置最小分数,以及相机配置(cam0–cam2).\n清理适配器逻辑和内部投票/计时.\n最新译名."
31
+ },
6
32
  "0.0.14": {
7
33
  "en": "fix",
8
34
  "de": "fixieren",
@@ -67,32 +93,6 @@
67
93
  "pl": "fix - Kontrola adaptera",
68
94
  "uk": "виправити - Перевірювач адаптера",
69
95
  "zh-cn": "修补 - 适配器检查器"
70
- },
71
- "0.0.7": {
72
- "en": "fix - Adapter Checker",
73
- "de": "fix - Adapter Checker",
74
- "ru": "обсуждение Adapter Checker",
75
- "pt": "correção - Adapter Checker",
76
- "nl": "fix - Adapterchecker",
77
- "fr": "correction - Vérificateur d'adaptateur",
78
- "it": "correzione - Adattatore Checker",
79
- "es": "fijado - Adaptador Checker",
80
- "pl": "fix - Kontrola adaptera",
81
- "uk": "виправити - Перевірювач адаптера",
82
- "zh-cn": "修补 - 适配器检查器"
83
- },
84
- "0.0.6": {
85
- "en": "fix - Adapter Checker",
86
- "de": "fix - Adapter Checker",
87
- "ru": "обсуждение Adapter Checker",
88
- "pt": "correção - Adapter Checker",
89
- "nl": "fix - Adapterchecker",
90
- "fr": "correction - Vérificateur d'adaptateur",
91
- "it": "correzione - Adattatore Checker",
92
- "es": "fijado - Adaptador Checker",
93
- "pl": "fix - Kontrola adaptera",
94
- "uk": "виправити - Перевірювач адаптера",
95
- "zh-cn": "修补 - 适配器检查器"
96
96
  }
97
97
  },
98
98
  "titleLang": {
package/main.js CHANGED
@@ -11,13 +11,17 @@ class Autodarts extends utils.Adapter {
11
11
  });
12
12
 
13
13
  this.on("ready", this.onReady.bind(this));
14
+ this.on("stateChange", this.onStateChange.bind(this));
14
15
  this.on("unload", this.onUnload.bind(this));
15
16
 
16
17
  this.pollTimer = null;
17
18
  this.lastThrowsCount = 0; // Anzahl Darts im aktuellen Visit
18
19
  this.lastSignature = ""; // Verhindert doppelte Verarbeitung gleicher Würfe
19
20
  this.offline = false;
20
- this.versionTimer = null; // Timer für Versionsabfrage
21
+ this.versionTimer = null; // Timer für Versions- und Config-Abfrage
22
+
23
+ this.tripleMinScoreRuntime = null; // Laufzeitwert für Triple-Minschwelle
24
+ this.tripleMaxScoreRuntime = null; // Laufzeitwert für Triple-Maxschwelle
21
25
  }
22
26
 
23
27
  async onReady() {
@@ -27,6 +31,12 @@ class Autodarts extends utils.Adapter {
27
31
  this.config.host ??= "127.0.0.1";
28
32
  this.config.port ??= 3180;
29
33
  this.config.interval ??= 1000;
34
+ // eslint-disable-next-line jsdoc/check-tag-names
35
+ /** @ts-expect-error tripleMinScore is defined in io-package.json but not in AdapterConfig */
36
+ this.config.tripleMinScore ??= 1; // Mindestpunktzahl für Triple-Flag
37
+ // eslint-disable-next-line jsdoc/check-tag-names
38
+ /** @ts-expect-error tripleMaxScore is defined in io-package.json but not in AdapterConfig */
39
+ this.config.tripleMaxScore ??= 20; // Maximalpunktzahl für Triple-Flag
30
40
 
31
41
  // Visit-Struktur anlegen
32
42
  await this.setObjectNotExistsAsync("visit", {
@@ -59,6 +69,75 @@ class Autodarts extends utils.Adapter {
59
69
  native: {},
60
70
  });
61
71
 
72
+ // Throw-Channel und States
73
+ await this.setObjectNotExistsAsync("throw", {
74
+ type: "channel",
75
+ common: {
76
+ name: {
77
+ en: "Current throw",
78
+ de: "Aktueller Wurf",
79
+ },
80
+ },
81
+ native: {},
82
+ });
83
+
84
+ await this.setObjectNotExistsAsync("throw.current", {
85
+ type: "state",
86
+ common: {
87
+ name: {
88
+ en: "Current dart score",
89
+ de: "Punkte aktueller Dart",
90
+ },
91
+ type: "number",
92
+ role: "value",
93
+ read: true,
94
+ write: false,
95
+ desc: {
96
+ en: "Score of the last dart",
97
+ de: "Punktzahl des letzten Dart",
98
+ },
99
+ },
100
+ native: {},
101
+ });
102
+
103
+ await this.setObjectNotExistsAsync("throw.isTriple", {
104
+ type: "state",
105
+ common: {
106
+ name: {
107
+ en: "Triple hit",
108
+ de: "Triple getroffen",
109
+ },
110
+ type: "boolean",
111
+ role: "indicator",
112
+ read: true,
113
+ write: false,
114
+ desc: {
115
+ en: "true if the dart hit a triple segment (and passes score range)",
116
+ de: "true, wenn ein Dart ein Triple-Segment getroffen hat (und innerhalb der Punkterange liegt)",
117
+ },
118
+ },
119
+ native: {},
120
+ });
121
+
122
+ await this.setObjectNotExistsAsync("throw.isBulleye", {
123
+ type: "state",
124
+ common: {
125
+ name: {
126
+ en: "Bulleye hit",
127
+ de: "Bulleye getroffen",
128
+ },
129
+ type: "boolean",
130
+ role: "indicator",
131
+ read: true,
132
+ write: false,
133
+ desc: {
134
+ en: "true if the dart hit the bull or bullseye",
135
+ de: "true, wenn ein Dart Bull oder Bulleye getroffen hat",
136
+ },
137
+ },
138
+ native: {},
139
+ });
140
+
62
141
  // Online-Datenpunkt
63
142
  await this.setObjectNotExistsAsync("online", {
64
143
  type: "state",
@@ -110,6 +189,135 @@ class Autodarts extends utils.Adapter {
110
189
  native: {},
111
190
  });
112
191
 
192
+ // Kamera-Infos als JSON-States
193
+ await this.setObjectNotExistsAsync("system.cam0", {
194
+ type: "state",
195
+ common: {
196
+ name: {
197
+ en: "Camera 0 config",
198
+ de: "Kamera 0 Konfiguration",
199
+ },
200
+ type: "string",
201
+ role: "json",
202
+ read: true,
203
+ write: false,
204
+ desc: {
205
+ en: "JSON with camera 0 parameters (width, height, fps)",
206
+ de: "JSON mit Kamera-0-Parametern (width, height, fps)",
207
+ },
208
+ },
209
+ native: {},
210
+ });
211
+
212
+ await this.setObjectNotExistsAsync("system.cam1", {
213
+ type: "state",
214
+ common: {
215
+ name: {
216
+ en: "Camera 1 config",
217
+ de: "Kamera 1 Konfiguration",
218
+ },
219
+ type: "string",
220
+ role: "json",
221
+ read: true,
222
+ write: false,
223
+ desc: {
224
+ en: "JSON with camera 1 parameters (width, height, fps)",
225
+ de: "JSON mit Kamera-1-Parametern (width, height, fps)",
226
+ },
227
+ },
228
+ native: {},
229
+ });
230
+
231
+ await this.setObjectNotExistsAsync("system.cam2", {
232
+ type: "state",
233
+ common: {
234
+ name: {
235
+ en: "Camera 2 config",
236
+ de: "Kamera 2 Konfiguration",
237
+ },
238
+ type: "string",
239
+ role: "json",
240
+ read: true,
241
+ write: false,
242
+ desc: {
243
+ en: "JSON with camera 2 parameters (width, height, fps)",
244
+ de: "JSON mit Kamera-2-Parametern (width, height, fps)",
245
+ },
246
+ },
247
+ native: {},
248
+ });
249
+
250
+ // Config-Channel und States für tripleMinScore / tripleMaxScore (zur Laufzeit änderbar)
251
+ await this.setObjectNotExistsAsync("config", {
252
+ type: "channel",
253
+ common: {
254
+ name: {
255
+ en: "Runtime configuration",
256
+ de: "Laufzeitkonfiguration",
257
+ },
258
+ },
259
+ native: {},
260
+ });
261
+
262
+ await this.setObjectNotExistsAsync("config.tripleMinScore", {
263
+ type: "state",
264
+ common: {
265
+ name: {
266
+ en: "Triple minimum score",
267
+ de: "Triple Mindestpunktzahl",
268
+ },
269
+ type: "number",
270
+ role: "value",
271
+ read: true,
272
+ write: true,
273
+ desc: {
274
+ en: "Minimum score for triple flag (overrides adapter config while running)",
275
+ de: "Mindestpunktzahl für den Triple-Trigger (überschreibt Adapter-Config zur Laufzeit)",
276
+ },
277
+ },
278
+ native: {},
279
+ });
280
+
281
+ await this.setObjectNotExistsAsync("config.tripleMaxScore", {
282
+ type: "state",
283
+ common: {
284
+ name: {
285
+ en: "Triple maximum score",
286
+ de: "Triple Maximalpunktzahl",
287
+ },
288
+ type: "number",
289
+ role: "value",
290
+ read: true,
291
+ write: true,
292
+ desc: {
293
+ en: "Maximum score for triple flag (overrides adapter config while running)",
294
+ de: "Maximalpunktzahl für den Triple-Trigger (überschreibt Adapter-Config zur Laufzeit)",
295
+ },
296
+ },
297
+ native: {},
298
+ });
299
+
300
+ // Laufzeitwerte initial aus Adapter-Config setzen
301
+ // eslint-disable-next-line jsdoc/check-tag-names
302
+ /** @ts-expect-error tripleMinScore is defined in io-package.json but not in AdapterConfig */
303
+ this.tripleMinScoreRuntime = Number(this.config.tripleMinScore) || 1;
304
+ // eslint-disable-next-line jsdoc/check-tag-names
305
+ /** @ts-expect-error tripleMaxScore is defined in io-package.json but not in AdapterConfig */
306
+ this.tripleMaxScoreRuntime = Number(this.config.tripleMaxScore) || 20;
307
+
308
+ await this.setStateAsync("config.tripleMinScore", {
309
+ val: this.tripleMinScoreRuntime,
310
+ ack: true,
311
+ });
312
+ await this.setStateAsync("config.tripleMaxScore", {
313
+ val: this.tripleMaxScoreRuntime,
314
+ ack: true,
315
+ });
316
+
317
+ // Auf Änderungen am Config-State hören
318
+ this.subscribeStates("config.tripleMinScore");
319
+ this.subscribeStates("config.tripleMaxScore");
320
+
113
321
  // Zustand zurücksetzen
114
322
  this.lastThrowsCount = 0;
115
323
  this.lastSignature = "";
@@ -118,9 +326,16 @@ class Autodarts extends utils.Adapter {
118
326
  this.pollTimer = setInterval(() => this.fetchState(), this.config.interval);
119
327
  this.fetchState();
120
328
 
121
- // Boardmanager-Version abfragen und alle 5 Minuten aktualisieren
329
+ // Boardmanager-Version und Kameras abfragen und alle 5 Minuten aktualisieren
122
330
  this.fetchVersion();
123
- this.versionTimer = setInterval(() => this.fetchVersion(), 5 * 60 * 1000);
331
+ this.fetchConfig();
332
+ this.versionTimer = setInterval(
333
+ () => {
334
+ this.fetchVersion();
335
+ this.fetchConfig();
336
+ },
337
+ 5 * 60 * 1000,
338
+ );
124
339
  }
125
340
 
126
341
  /**
@@ -136,6 +351,51 @@ class Autodarts extends utils.Adapter {
136
351
  return (dart.segment.number || 0) * (dart.segment.multiplier || 0);
137
352
  }
138
353
 
354
+ /**
355
+ * Reaktion auf State-Änderungen (z. B. config.tripleMinScore / config.tripleMaxScore)
356
+ *
357
+ * @param {string} id Full state id
358
+ * @param {ioBroker.State | null | undefined} state New state value (ack=false on user write)
359
+ */
360
+ onStateChange(id, state) {
361
+ if (!state) {
362
+ return;
363
+ }
364
+
365
+ // Nur auf Schreibaktionen reagieren (ack === false)
366
+ if (state.ack) {
367
+ return;
368
+ }
369
+
370
+ const idShort = id.replace(`${this.namespace}.`, "");
371
+
372
+ if (idShort === "config.tripleMinScore") {
373
+ const val = Number(state.val);
374
+ if (!Number.isFinite(val) || val <= 0) {
375
+ this.log.warn(`Invalid tripleMinScore value: ${state.val}`);
376
+ return;
377
+ }
378
+
379
+ this.tripleMinScoreRuntime = val;
380
+ this.log.info(`Runtime tripleMinScore updated to ${val}`);
381
+
382
+ // Wert mit ack bestätigen
383
+ this.setState("config.tripleMinScore", { val, ack: true });
384
+ } else if (idShort === "config.tripleMaxScore") {
385
+ const val = Number(state.val);
386
+ if (!Number.isFinite(val) || val <= 0) {
387
+ this.log.warn(`Invalid tripleMaxScore value: ${state.val}`);
388
+ return;
389
+ }
390
+
391
+ this.tripleMaxScoreRuntime = val;
392
+ this.log.info(`Runtime tripleMaxScore updated to ${val}`);
393
+
394
+ // Wert mit ack bestätigen
395
+ this.setState("config.tripleMaxScore", { val, ack: true });
396
+ }
397
+ }
398
+
139
399
  /**
140
400
  * Autodarts API abfragen und Visit-Summe schreiben
141
401
  */
@@ -180,6 +440,51 @@ class Autodarts extends utils.Adapter {
180
440
  }
181
441
  this.lastSignature = signature;
182
442
 
443
+ // letzten Dart in States schreiben
444
+ const lastDart = currentThrows[currentThrows.length - 1];
445
+ const score = this.calcScore(lastDart);
446
+
447
+ // Konfigurierte Score-Range für Triple-Flag:
448
+ // zuerst Laufzeitwerte, Fallback auf Adapter-Config
449
+ let minScore = this.tripleMinScoreRuntime;
450
+ let maxScore = this.tripleMaxScoreRuntime;
451
+
452
+ if (!Number.isFinite(minScore)) {
453
+ // eslint-disable-next-line jsdoc/check-tag-names
454
+ /** @ts-expect-error tripleMinScore is defined in io-package.json but not in AdapterConfig */
455
+ minScore = Number(this.config.tripleMinScore) || 1;
456
+ }
457
+ if (!Number.isFinite(maxScore)) {
458
+ // eslint-disable-next-line jsdoc/check-tag-names
459
+ /** @ts-expect-error tripleMaxScore is defined in io-package.json but not in AdapterConfig */
460
+ maxScore = Number(this.config.tripleMaxScore) || 20;
461
+ }
462
+
463
+ if (minScore > maxScore) {
464
+ const tmp = minScore;
465
+ minScore = maxScore;
466
+ maxScore = tmp;
467
+ }
468
+
469
+ // Triple nur, wenn:
470
+ // - multiplier === 3
471
+ // - score >= minScore
472
+ // - score <= maxScore
473
+ const isTriple =
474
+ !!lastDart?.segment &&
475
+ lastDart.segment.multiplier === 3 &&
476
+ score >= minScore &&
477
+ score <= maxScore;
478
+
479
+ // Bulleye-Erkennung:
480
+ // je nach Autodarts-API typischerweise über segment.name ("BULL", "DBULL", "SBULL")
481
+ const segName = (lastDart?.segment?.name || "").toUpperCase();
482
+ const isBulleye = segName.includes("BULL") || lastDart?.segment?.number === 25; // Fallback
483
+
484
+ this.setState("throw.current", { val: score, ack: true });
485
+ this.setState("throw.isTriple", { val: isTriple, ack: true });
486
+ this.setState("throw.isBulleye", { val: isBulleye, ack: true });
487
+
183
488
  // Nur schreiben, wenn:
184
489
  // - genau 3 Darts geworfen wurden
185
490
  // - vorher weniger als 3 waren (Visit gerade abgeschlossen)
@@ -211,6 +516,10 @@ class Autodarts extends utils.Adapter {
211
516
 
212
517
  req.on("timeout", () => {
213
518
  req.destroy();
519
+ if (!this.offline) {
520
+ this.log.warn("Autodarts not reachable");
521
+ this.offline = true;
522
+ }
214
523
  this.setState("online", false, true); // Server offline bei Timeout
215
524
  });
216
525
 
@@ -243,18 +552,68 @@ class Autodarts extends utils.Adapter {
243
552
  });
244
553
 
245
554
  req.on("error", () => {
246
- this.log.warn("Version-API nicht erreichbar");
555
+ // Keine Log-Warnung, nur State leeren
247
556
  this.setState("system.boardVersion", { val: "", ack: true });
248
557
  });
249
558
 
250
559
  req.on("timeout", () => {
251
560
  req.destroy();
561
+ // Keine Log-Warnung, nur State leeren
252
562
  this.setState("system.boardVersion", { val: "", ack: true });
253
563
  });
254
564
 
255
565
  req.end();
256
566
  }
257
567
 
568
+ /**
569
+ * Board-Konfiguration abfragen (Kameras)
570
+ */
571
+ fetchConfig() {
572
+ const options = {
573
+ host: this.config.host,
574
+ port: this.config.port,
575
+ path: "/api/config",
576
+ method: "GET",
577
+ timeout: 1500,
578
+ };
579
+
580
+ const req = http.request(options, res => {
581
+ let data = "";
582
+ res.on("data", chunk => (data += chunk));
583
+ res.on("end", () => {
584
+ try {
585
+ const cfg = JSON.parse(data);
586
+
587
+ const cam = cfg.cam || {};
588
+ const camInfo = {
589
+ width: cam.width ?? 1280,
590
+ height: cam.height ?? 720,
591
+ fps: cam.fps ?? 20,
592
+ };
593
+
594
+ const json = JSON.stringify(camInfo);
595
+
596
+ this.setState("system.cam0", { val: json, ack: true });
597
+ this.setState("system.cam1", { val: json, ack: true });
598
+ this.setState("system.cam2", { val: json, ack: true });
599
+ } catch (e) {
600
+ this.log.warn(`Fehler beim Lesen der Config: ${e.message} | Daten: ${data.substring(0, 200)}...`);
601
+ }
602
+ });
603
+ });
604
+
605
+ req.on("error", () => {
606
+ // Keine Log-Warnung mehr
607
+ });
608
+
609
+ req.on("timeout", () => {
610
+ req.destroy();
611
+ // Keine Log-Warnung mehr
612
+ });
613
+
614
+ req.end();
615
+ }
616
+
258
617
  onUnload(callback) {
259
618
  try {
260
619
  if (this.pollTimer) {
@@ -264,8 +623,7 @@ class Autodarts extends utils.Adapter {
264
623
  clearInterval(this.versionTimer);
265
624
  }
266
625
  callback();
267
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
268
- } catch (e) {
626
+ } catch {
269
627
  callback();
270
628
  }
271
629
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.autodarts",
3
- "version": "0.0.14",
3
+ "version": "0.2.0",
4
4
  "description": "Autodarts Autoscoring",
5
5
  "author": "skvarel <skvarel@inventwo.com>",
6
6
  "contributors": [