iobroker.tibberlink 5.0.1 → 5.0.3

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
@@ -164,6 +164,18 @@ If you enjoyed this project — or just feeling generous, consider buying me a b
164
164
  Placeholder for the next version (at the beginning of the line):
165
165
  ### **WORK IN PROGRESS**
166
166
  -->
167
+ ### 5.0.3 (2025-09-17)
168
+
169
+ - (HombachC) fix jsonconfig schema definition (#762)
170
+ - (HombachC) optimize cron jobs
171
+ - (HombachC) update axios
172
+
173
+ ### 5.0.2 (2025-08-29)
174
+
175
+ - (HombachC) min admin 7.6.17 as recommended (#754)
176
+ - (HombachC) update adapter-core
177
+ - (HombachC) bump typescript
178
+ - (HombachC) bump dependencies
167
179
 
168
180
  ### 5.0.1 (2025-08-15)
169
181
 
@@ -186,19 +198,6 @@ If you enjoyed this project — or just feeling generous, consider buying me a b
186
198
  - (HombachC) remove tests for node.js 18
187
199
  - (HombachC) optimize asynchron code
188
200
 
189
- ### 4.5.3 (2025-05-17)
190
-
191
- - (HombachC) optimize shutdown-logic (#707)
192
- - (HombachC) update tibber-api
193
- - (HombachC) bump dependencies
194
-
195
- ### 4.5.2 (2025-04-18)
196
-
197
- - (HombachC) fix jsonConfig error (#686)
198
- - (HombachC) bump dependencies
199
- - (HombachC) add statevalue range to projectUtils
200
- - (HombachC) code optimizations
201
-
202
201
  ### Old Changes see [CHANGELOG OLD](CHANGELOG_OLD.md)
203
202
 
204
203
  ## License
@@ -466,7 +466,407 @@
466
466
  "md": 12,
467
467
  "lg": 12,
468
468
  "xl": 12,
469
- "#include": "CalculatorTab.jsonConfig.json"
469
+ "items": {
470
+ "UseCalculator": {
471
+ "type": "checkbox",
472
+ "label": "LBL_UseCalculator",
473
+ "xs": 12,
474
+ "sm": 12,
475
+ "md": 12,
476
+ "lg": 12,
477
+ "xl": 12
478
+ },
479
+
480
+ "CalculatorList": {
481
+ "type": "accordion",
482
+ "titleAttr": "chName",
483
+ "label": "LBL_CalculatorList",
484
+ "hidden": "!data.UseCalculator",
485
+ "xs": 12,
486
+ "sm": 12,
487
+ "md": 12,
488
+ "lg": 12,
489
+ "xl": 12,
490
+ "items": [
491
+ {
492
+ "type": "selectSendTo",
493
+ "label": "LBL_item_chHomeID",
494
+ "tooltip": "TTIP_item_chHomeID",
495
+ "attr": "chHomeID",
496
+ "default": "No Home selected",
497
+ "command": "HomesForCalculator",
498
+ "xs": 12,
499
+ "sm": 12,
500
+ "md": 6,
501
+ "lg": 6,
502
+ "xl": 6
503
+ },
504
+ {
505
+ "type": "select",
506
+ "label": "LBL_item_chType",
507
+ "tooltip": "TTIP_item_chType",
508
+ "attr": "chType",
509
+ "options": [
510
+ {
511
+ "label": "LBL_item_chType_option_1",
512
+ "value": 1
513
+ },
514
+ {
515
+ "label": "LBL_item_chType_option_4",
516
+ "value": 4
517
+ },
518
+ {
519
+ "label": "LBL_item_chType_option_2",
520
+ "value": 2
521
+ },
522
+ {
523
+ "label": "LBL_item_chType_option_5",
524
+ "value": 5
525
+ },
526
+ {
527
+ "label": "LBL_item_chType_option_3",
528
+ "value": 3
529
+ },
530
+ {
531
+ "label": "LBL_item_chType_option_6",
532
+ "value": 6
533
+ },
534
+ {
535
+ "label": "LBL_item_chType_option_8",
536
+ "value": 8
537
+ },
538
+ {
539
+ "label": "LBL_item_chType_option_9",
540
+ "value": 9
541
+ },
542
+ {
543
+ "label": "LBL_item_chType_option_7",
544
+ "value": 7
545
+ },
546
+ {
547
+ "label": "LBL_item_chType_option_10",
548
+ "value": 10
549
+ }
550
+ ],
551
+ "xs": 12,
552
+ "sm": 12,
553
+ "md": 6,
554
+ "lg": 6,
555
+ "xl": 6
556
+ },
557
+
558
+ {
559
+ "type": "text",
560
+ "label": "LBL_item_chName",
561
+ "tooltip": "TTIP_item_chName",
562
+ "maxLength": 25,
563
+ "attr": "chName",
564
+ "validator": "if(data.name === '' || data.name === null){return false;}else{const myRegEx = /^([0-9a-z_ ])*$/i; return myRegEx.test(data.name);}",
565
+ "validatorNoSaveOnError": true,
566
+ "default": "channel name",
567
+ "xs": 12,
568
+ "sm": 12,
569
+ "md": 12,
570
+ "lg": 12,
571
+ "xl": 12
572
+ },
573
+
574
+ {
575
+ "type": "objectId",
576
+ "label": "LBL_item_chTargetState",
577
+ "tooltip": "TTIP_item_chTargetState",
578
+ "attr": "chTargetState",
579
+ "default": "",
580
+ "xs": 12,
581
+ "sm": 12,
582
+ "md": 12,
583
+ "lg": 12,
584
+ "xl": 12
585
+ },
586
+
587
+ {
588
+ "type": "text",
589
+ "label": "LBL_item_chValueOn",
590
+ "tooltip": "TTIP_item_chValueOn",
591
+ "maxLength": 20,
592
+ "attr": "chValueOn",
593
+ "default": "true",
594
+ "xs": 12,
595
+ "sm": 12,
596
+ "md": 6,
597
+ "lg": 6,
598
+ "xl": 6
599
+ },
600
+ {
601
+ "type": "text",
602
+ "label": "LBL_item_chValueOff",
603
+ "tooltip": "TTIP_item_chValueOff",
604
+ "maxLength": 20,
605
+ "attr": "chValueOff",
606
+ "default": "false",
607
+ "xs": 12,
608
+ "sm": 12,
609
+ "md": 6,
610
+ "lg": 6,
611
+ "xl": 6
612
+ },
613
+
614
+ {
615
+ "type": "objectId",
616
+ "label": "LBL_item_chTargetState2",
617
+ "tooltip": "TTIP_item_chTargetState2",
618
+ "attr": "chTargetState2",
619
+ "hidden": "data.chType !== 7 && data.chType !== 10",
620
+ "xs": 12,
621
+ "sm": 12,
622
+ "md": 12,
623
+ "lg": 12,
624
+ "xl": 12
625
+ },
626
+
627
+ {
628
+ "type": "text",
629
+ "label": "LBL_item_chValueOn2",
630
+ "tooltip": "TTIP_item_chValueOn2",
631
+ "maxLength": 20,
632
+ "attr": "chValueOn2",
633
+ "default": "true",
634
+ "hidden": "data.chType !== 7 && data.chType !== 10",
635
+ "xs": 12,
636
+ "sm": 12,
637
+ "md": 6,
638
+ "lg": 6,
639
+ "xl": 6
640
+ },
641
+ {
642
+ "type": "text",
643
+ "label": "LBL_item_chValueOff2",
644
+ "tooltip": "TTIP_item_chValueOff2",
645
+ "maxLength": 20,
646
+ "attr": "chValueOff2",
647
+ "default": "false",
648
+ "hidden": "data.chType !== 7 && data.chType !== 10",
649
+ "xs": 12,
650
+ "sm": 12,
651
+ "md": 6,
652
+ "lg": 6,
653
+ "xl": 6
654
+ },
655
+ {
656
+ "type": "checkbox",
657
+ "label": "LBL_chGraphEnabled",
658
+ "tooltip": "TTIP_chGraphEnabled",
659
+ "attr": "chGraphEnabled",
660
+ "default": "false",
661
+ "xs": 12,
662
+ "sm": 12,
663
+ "md": 6,
664
+ "lg": 4,
665
+ "xl": 4,
666
+ "newLine": true
667
+ }
668
+ ]
669
+ },
670
+
671
+ "_calculatorhelp1": {
672
+ "type": "staticText",
673
+ "hidden": "!data.UseCalculator",
674
+ "label": "LBL_calculatorhelp1",
675
+ "xs": 12,
676
+ "sm": 12,
677
+ "md": 12,
678
+ "lg": 12,
679
+ "xl": 12,
680
+ "newLine": true
681
+ },
682
+ "_calculatorhelp2": {
683
+ "type": "staticText",
684
+ "hidden": "!data.UseCalculator",
685
+ "label": "LBL_calculatorhelp2",
686
+ "xs": 12,
687
+ "sm": 12,
688
+ "md": 12,
689
+ "lg": 12,
690
+ "xl": 12,
691
+ "newLine": true
692
+ },
693
+ "_calculatorhelp3": {
694
+ "type": "staticText",
695
+ "hidden": "!data.UseCalculator",
696
+ "label": "LBL_calculatorhelp3",
697
+ "xs": 12,
698
+ "sm": 12,
699
+ "md": 12,
700
+ "lg": 12,
701
+ "xl": 12,
702
+ "newLine": true
703
+ },
704
+ "_calculatorhelp4": {
705
+ "type": "staticText",
706
+ "hidden": "!data.UseCalculator",
707
+ "label": "LBL_calculatorhelp4",
708
+ "xs": 12,
709
+ "sm": 12,
710
+ "md": 12,
711
+ "lg": 12,
712
+ "xl": 12,
713
+ "newLine": true
714
+ },
715
+ "_calculatorhelp5": {
716
+ "type": "staticText",
717
+ "hidden": "!data.UseCalculator",
718
+ "label": "LBL_calculatorhelp5",
719
+ "xs": 12,
720
+ "sm": 12,
721
+ "md": 12,
722
+ "lg": 12,
723
+ "xl": 12,
724
+ "newLine": true
725
+ },
726
+ "_calculatorhelp6": {
727
+ "type": "staticText",
728
+ "hidden": "!data.UseCalculator",
729
+ "label": "LBL_calculatorhelp6",
730
+ "xs": 12,
731
+ "sm": 12,
732
+ "md": 12,
733
+ "lg": 12,
734
+ "xl": 12,
735
+ "newLine": true
736
+ },
737
+ "_calculatorhelp7": {
738
+ "type": "staticText",
739
+ "hidden": "!data.UseCalculator",
740
+ "label": "LBL_calculatorhelp7",
741
+ "xs": 12,
742
+ "sm": 12,
743
+ "md": 12,
744
+ "lg": 12,
745
+ "xl": 12,
746
+ "newLine": true
747
+ },
748
+ "_calculatorhelp8": {
749
+ "type": "staticText",
750
+ "hidden": "!data.UseCalculator",
751
+ "label": "LBL_calculatorhelp8",
752
+ "xs": 12,
753
+ "sm": 12,
754
+ "md": 12,
755
+ "lg": 12,
756
+ "xl": 12,
757
+ "newLine": true
758
+ },
759
+ "_calculatorhelp9": {
760
+ "type": "staticText",
761
+ "hidden": "!data.UseCalculator",
762
+ "label": "LBL_calculatorhelp9",
763
+ "xs": 12,
764
+ "sm": 12,
765
+ "md": 12,
766
+ "lg": 12,
767
+ "xl": 12,
768
+ "newLine": true
769
+ },
770
+ "_calculatorhelp10": {
771
+ "type": "staticText",
772
+ "hidden": "!data.UseCalculator",
773
+ "label": "LBL_calculatorhelp10",
774
+ "xs": 12,
775
+ "sm": 12,
776
+ "md": 12,
777
+ "lg": 12,
778
+ "xl": 12,
779
+ "newLine": true
780
+ },
781
+ "_calculatorhelp11": {
782
+ "type": "staticText",
783
+ "hidden": "!data.UseCalculator",
784
+ "label": "LBL_calculatorhelp11",
785
+ "xs": 12,
786
+ "sm": 12,
787
+ "md": 12,
788
+ "lg": 12,
789
+ "xl": 12,
790
+ "newLine": true
791
+ },
792
+ "_calculatorhelp12": {
793
+ "type": "staticText",
794
+ "hidden": "!data.UseCalculator",
795
+ "label": "LBL_calculatorhelp12",
796
+ "xs": 12,
797
+ "sm": 12,
798
+ "md": 12,
799
+ "lg": 12,
800
+ "xl": 12,
801
+ "newLine": true
802
+ },
803
+ "_calculatorhelp13": {
804
+ "type": "staticText",
805
+ "hidden": "!data.UseCalculator",
806
+ "label": "LBL_calculatorhelp13",
807
+ "xs": 12,
808
+ "sm": 12,
809
+ "md": 12,
810
+ "lg": 12,
811
+ "xl": 12,
812
+ "newLine": true
813
+ },
814
+ "_calculatorhelp14": {
815
+ "type": "staticText",
816
+ "hidden": "!data.UseCalculator",
817
+ "label": "LBL_calculatorhelp14",
818
+ "xs": 12,
819
+ "sm": 12,
820
+ "md": 12,
821
+ "lg": 12,
822
+ "xl": 12,
823
+ "newLine": true
824
+ },
825
+ "_calculatorhelp15": {
826
+ "type": "staticText",
827
+ "hidden": "!data.UseCalculator",
828
+ "label": "LBL_calculatorhelp15",
829
+ "xs": 12,
830
+ "sm": 12,
831
+ "md": 12,
832
+ "lg": 12,
833
+ "xl": 12,
834
+ "newLine": true
835
+ },
836
+ "_calculatorhelp16": {
837
+ "type": "staticText",
838
+ "hidden": "!data.UseCalculator",
839
+ "label": "LBL_calculatorhelp16",
840
+ "xs": 12,
841
+ "sm": 12,
842
+ "md": 12,
843
+ "lg": 12,
844
+ "xl": 12,
845
+ "newLine": true
846
+ },
847
+ "_calculatorhelp17": {
848
+ "type": "staticText",
849
+ "hidden": "!data.UseCalculator",
850
+ "label": "LBL_calculatorhelp15",
851
+ "xs": 12,
852
+ "sm": 12,
853
+ "md": 12,
854
+ "lg": 12,
855
+ "xl": 12,
856
+ "newLine": true
857
+ },
858
+ "_calculatorhelp18": {
859
+ "type": "staticText",
860
+ "hidden": "!data.UseCalculator",
861
+ "label": "LBL_calculatorhelp16",
862
+ "xs": 12,
863
+ "sm": 12,
864
+ "md": 12,
865
+ "lg": 12,
866
+ "xl": 12,
867
+ "newLine": true
868
+ }
869
+ }
470
870
  },
471
871
 
472
872
  "_GraphsTab": {
@@ -593,7 +993,118 @@
593
993
  "_LocalPulseTab": {
594
994
  "type": "panel",
595
995
  "label": "LBL_LocalPulseTab",
596
- "#include": "LocalPulseTab.jsonConfig.json"
996
+ "items": {
997
+ "UseLocalPulseData": {
998
+ "type": "checkbox",
999
+ "label": "LBL_item_UseLocalPulseData",
1000
+ "xs": 12,
1001
+ "sm": 12,
1002
+ "md": 12,
1003
+ "lg": 12,
1004
+ "xl": 12,
1005
+ "newLine": true
1006
+ },
1007
+ "_localpulsehelp1": {
1008
+ "type": "staticText",
1009
+ "label": "LBL_item_localpulsehelp1",
1010
+ "xs": 12,
1011
+ "sm": 12,
1012
+ "md": 12,
1013
+ "lg": 12,
1014
+ "xl": 12,
1015
+ "newLine": true
1016
+ },
1017
+ "_localpulsehelp2": {
1018
+ "type": "staticText",
1019
+ "label": "LBL_item_localpulsehelp2",
1020
+ "xs": 12,
1021
+ "sm": 12,
1022
+ "md": 12,
1023
+ "lg": 12,
1024
+ "xl": 12,
1025
+ "newLine": true
1026
+ },
1027
+ "_localpulsehelp3": {
1028
+ "type": "staticText",
1029
+ "label": "LBL_item_localpulsehelp3",
1030
+ "xs": 12,
1031
+ "sm": 12,
1032
+ "md": 12,
1033
+ "lg": 12,
1034
+ "xl": 12,
1035
+ "newLine": true
1036
+ },
1037
+ "_localpulsehelp4": {
1038
+ "type": "staticLink",
1039
+ "label": "LBL_item_localpulsehelp4",
1040
+ "href": "https://github.com/marq24/ha-tibber-pulse-local",
1041
+ "button": false,
1042
+ "variant": "text",
1043
+ "xs": 12,
1044
+ "sm": 12,
1045
+ "md": 12,
1046
+ "lg": 12,
1047
+ "xl": 12,
1048
+ "newLine": false
1049
+ },
1050
+
1051
+ "PulseList": {
1052
+ "type": "table",
1053
+ "label": "LBL_PulseList",
1054
+ "hidden": "!data.UseLocalPulseData",
1055
+ "xs": 12,
1056
+ "sm": 12,
1057
+ "md": 12,
1058
+ "lg": 12,
1059
+ "xl": 12,
1060
+ "items": [
1061
+ {
1062
+ "type": "text",
1063
+ "label": "LBL_item_tibberBridgeUrl",
1064
+ "tooltip": "TTIP_item_tibberBridgeUrl",
1065
+ "maxLength": 30,
1066
+ "attr": "tibberBridgeUrl",
1067
+ "filter": false,
1068
+ "sort": false,
1069
+ "width": "40%",
1070
+ "default": "tibber-host"
1071
+ },
1072
+ {
1073
+ "type": "text",
1074
+ "label": "LBL_item_tibberBridgePassword",
1075
+ "tooltip": "TTIP_item_tibberBridgePassword",
1076
+ "maxLength": 20,
1077
+ "attr": "tibberBridgePassword",
1078
+ "filter": false,
1079
+ "sort": false,
1080
+ "width": "40%",
1081
+ "default": "xxxx-xxxx"
1082
+ },
1083
+ {
1084
+ "type": "number",
1085
+ "label": "LBL_item_tibberPulseLocalNodeId",
1086
+ "tooltip": "TTIP_item_tibberPulseLocalNodeId",
1087
+ "attr": "tibberPulseLocalNodeId",
1088
+ "min": 0,
1089
+ "max": 99,
1090
+ "step": 1,
1091
+ "width": "10%",
1092
+ "default": 1
1093
+ },
1094
+ {
1095
+ "type": "number",
1096
+ "label": "LBL_item_tibberBridgeRawDataInterval",
1097
+ "tooltip": "TTIP_item_tibberBridgeRawDataInterval",
1098
+ "attr": "tibberBridgeRawDataInterval",
1099
+ "min": 1000,
1100
+ "max": 100000,
1101
+ "step": 100,
1102
+ "width": "10%",
1103
+ "default": 2000
1104
+ }
1105
+ ]
1106
+ }
1107
+ }
597
1108
  }
598
1109
  }
599
1110
  }
package/build/main.js CHANGED
@@ -188,14 +188,16 @@ class Tibberlink extends utils.Adapter {
188
188
  void tibberAPICaller.updateConsumptionAllHomes();
189
189
  void this.tibberCharts.generateFlexChartJSONAllHomes(this.homeInfoList);
190
190
  const jobCurrentPrice = cron_1.CronJob.from({
191
- cronTime: "20 57 * * * *",
191
+ cronTime: "20 58 * * * *",
192
192
  onTick: async () => {
193
193
  let okPrice = false;
194
+ let attempt = 0;
194
195
  do {
195
- await this.delay(this.getRandomDelay(3, 5));
196
+ attempt++;
197
+ await this.delay(this.getRandomDelay(2, 4));
196
198
  okPrice = await tibberAPICaller.updateCurrentPriceAllHomes(this.homeInfoList);
197
- this.log.debug(`Cron job CurrentPrice - okPrice: ${okPrice}`);
198
- } while (!okPrice);
199
+ this.log.debug(`Cron job CurrentPrice - attempt ${attempt}, okPrice: ${okPrice}`);
200
+ } while (!okPrice && attempt < 4);
199
201
  void tibberAPICaller.updateConsumptionAllHomes();
200
202
  await tibberCalculator.startCalculatorTasks();
201
203
  void this.tibberCharts.generateFlexChartJSONAllHomes(this.homeInfoList);
@@ -211,12 +213,14 @@ class Tibberlink extends utils.Adapter {
211
213
  cronTime: "20 56 23 * * *",
212
214
  onTick: async () => {
213
215
  let okPrice = false;
216
+ let attempt = 0;
214
217
  do {
218
+ attempt++;
215
219
  await this.delay(this.getRandomDelay(4, 6));
216
220
  await tibberAPICaller.updatePricesTomorrowAllHomes(this.homeInfoList);
217
221
  okPrice = await tibberAPICaller.updatePricesTodayAllHomes(this.homeInfoList);
218
- this.log.debug(`Cron job PricesToday - okPrice: ${okPrice}`);
219
- } while (!okPrice);
222
+ this.log.debug(`Cron job PricesToday - attempt ${attempt}, okPrice: ${okPrice}`);
223
+ } while (!okPrice && attempt < 10);
220
224
  void tibberCalculator.startCalculatorTasks();
221
225
  void this.tibberCharts.generateFlexChartJSONAllHomes(this.homeInfoList);
222
226
  },
@@ -231,11 +235,13 @@ class Tibberlink extends utils.Adapter {
231
235
  cronTime: "20 56 12 * * *",
232
236
  onTick: async () => {
233
237
  let okPrice = false;
238
+ let attempt = 0;
234
239
  do {
240
+ attempt++;
235
241
  await this.delay(this.getRandomDelay(4, 6));
236
242
  okPrice = await tibberAPICaller.updatePricesTomorrowAllHomes(this.homeInfoList);
237
- this.log.debug(`Cron job PricesTomorrow - okPrice: ${okPrice}`);
238
- } while (!okPrice);
243
+ this.log.debug(`Cron job PricesTomorrow - attempt ${attempt}, okPrice: ${okPrice}`);
244
+ } while (!okPrice && attempt < 8);
239
245
  void tibberCalculator.startCalculatorTasks();
240
246
  void this.tibberCharts.generateFlexChartJSONAllHomes(this.homeInfoList);
241
247
  },
@@ -351,19 +357,23 @@ class Tibberlink extends utils.Adapter {
351
357
  }
352
358
  async jobPricesTodayLOOP(tibberAPICaller) {
353
359
  let okPrice = false;
360
+ let attempt = 0;
354
361
  do {
362
+ attempt++;
355
363
  okPrice = await tibberAPICaller.updatePricesTodayAllHomes(this.homeInfoList, true);
356
- this.log.debug(`Loop job PricesToday - okPrice: ${okPrice}`);
364
+ this.log.debug(`Loop job PricesToday - attempt ${attempt}, okPrice: ${okPrice}`);
357
365
  await this.delay(this.getRandomDelay(4, 6));
358
- } while (!okPrice);
366
+ } while (!okPrice && attempt < 10);
359
367
  }
360
368
  async jobPricesTomorrowLOOP(tibberAPICaller) {
361
369
  let okPrice = false;
370
+ let attempt = 0;
362
371
  do {
372
+ attempt++;
363
373
  okPrice = await tibberAPICaller.updatePricesTomorrowAllHomes(this.homeInfoList, true);
364
- this.log.debug(`Loop job PricesTomorrow - okPrice: ${okPrice}`);
374
+ this.log.debug(`Loop job PricesTomorrow - attempt ${attempt}, okPrice: ${okPrice}`);
365
375
  await this.delay(this.getRandomDelay(4, 6));
366
- } while (!okPrice);
376
+ } while (!okPrice && attempt < 8);
367
377
  }
368
378
  getRandomDelay = (minMinutes, maxMinutes) => {
369
379
  if (minMinutes >= maxMinutes) {