-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathconfig_schema.json
More file actions
3281 lines (3281 loc) · 138 KB
/
Copy pathconfig_schema.json
File metadata and controls
3281 lines (3281 loc) · 138 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{
"$defs": {
"BatteryConfig": {
"additionalProperties": true,
"description": "Battery configuration for optimization.",
"properties": {
"name": {
"description": "Battery name/identifier",
"title": "Name",
"type": "string",
"x-help": "Unique name to identify this battery in logs and reports. Use a descriptive name like 'Home Battery' or 'Garage Battery'.",
"x-ui-section": "Power Configuration"
},
"entity actual level": {
"$ref": "#/$defs/EntityId",
"description": "HA entity for current battery SOC",
"x-help": "Home Assistant entity that reports the current State of Charge (SOC) percentage. Usually a sensor from your battery inverter.",
"x-ui-section": "Power Configuration",
"x-ui-widget-filter": "sensor",
"x-unit": "%",
"title": "Entity Actual Level"
},
"capacity": {
"description": "Battery capacity in kWh",
"exclusiveMinimum": 0,
"title": "Capacity",
"type": "number",
"x-help": "Total usable energy storage capacity of your battery. Check your battery specifications. For multiple batteries, sum their capacities.",
"x-ui-section": "Power Configuration",
"x-unit": "kWh",
"x-validation-hint": "Must be greater than 0"
},
"upper limit": {
"$ref": "#/$defs/FlexInt",
"default": 100,
"description": "Maximum SOC % (can be HA entity)",
"x-help": "Maximum State of Charge in percent. Battery will never charge above this level. Supports FlexValue pattern: use integer or HA entity ID.",
"x-ui-section": "Power Configuration",
"x-unit": "%",
"x-validation-hint": "0-100%, protects battery from overcharge",
"title": "Upper Limit"
},
"lower limit": {
"$ref": "#/$defs/FlexInt",
"default": 20,
"description": "Minimum SOC % (can be HA entity)",
"x-help": "Minimum State of Charge in percent. Battery will never discharge below this level. Supports FlexValue pattern: use integer or HA entity ID.",
"x-ui-section": "Power Configuration",
"x-unit": "%",
"x-validation-hint": "0-100%, protects battery from deep discharge",
"title": "Lower Limit"
},
"optimal lower level": {
"anyOf": [
{
"$ref": "#/$defs/FlexInt"
},
{
"type": "null"
}
],
"default": null,
"description": "Optimal lower SOC % for cost optimization",
"x-help": "Target SOC level for cost optimization. System will prefer this level over minimum. Supports FlexValue pattern.",
"x-ui-section": "Power Configuration",
"x-unit": "%",
"x-validation-hint": "Optional, should be >= lower_limit",
"title": "Optimal Lower Level"
},
"penalty low soc": {
"default": 0.0025,
"description": "Penalty cost per % per hour below optimal lower SOC",
"title": "Penalty Low Soc",
"type": "number",
"x-help": "Cost in euro per %·hour when SOC stays below optimal lower level. Higher values make the optimizer prioritize keeping SOC above the optimal level. Default 0.0025 euro/%·h.",
"x-ui-section": "Power Configuration",
"x-unit": "euro/%·h"
},
"entity min soc end opt": {
"anyOf": [
{
"$ref": "#/$defs/EntityId"
},
{
"type": "null"
}
],
"default": null,
"description": "HA entity for minimum SOC at end of optimization period",
"x-help": "Optional: Home Assistant entity specifying minimum battery level required at end of optimization window. Useful for ensuring battery charge overnight.",
"x-ui-section": "Power Configuration",
"x-ui-widget-filter": "sensor,input_number",
"title": "Entity Min Soc End Opt"
},
"entity max soc end opt": {
"anyOf": [
{
"$ref": "#/$defs/EntityId"
},
{
"type": "null"
}
],
"default": null,
"description": "HA entity for maximum SOC at end of optimization period",
"x-help": "Optional: Home Assistant entity specifying maximum battery level at end of optimization window. Rarely needed but available for advanced scenarios.",
"x-ui-section": "Power Configuration",
"x-ui-widget-filter": "sensor,input_number",
"title": "Entity Max Soc End Opt"
},
"charge stages": {
"description": "Charge power/efficiency curve",
"items": {
"$ref": "#/$defs/BatteryStage"
},
"minItems": 1,
"title": "Charge Stages",
"type": "array",
"x-help": "Power stages for charging with corresponding efficiencies. Defines charge curve from AC grid to battery. At least one stage required. When a 0 W stage is missed this is supplied by the program.",
"x-ui-section": "Power Configuration",
"x-validation-hint": "At least 1 stage required, ordered by power"
},
"discharge stages": {
"description": "Discharge power/efficiency curve",
"items": {
"$ref": "#/$defs/BatteryStage"
},
"minItems": 1,
"title": "Discharge Stages",
"type": "array",
"x-help": "Power stages for discharging with corresponding efficiencies. Defines discharge curve from battery to AC grid. At least one stage required. When a 0 W stage is missed this is supplied by the program.",
"x-ui-section": "Power Configuration",
"x-validation-hint": "At least 1 stage required, ordered by power"
},
"reduced hours": {
"anyOf": [
{
"additionalProperties": {
"type": "integer"
},
"type": "object"
},
{
"type": "null"
}
],
"default": null,
"description": "Hour -> max power mapping for reduced power hours",
"title": "Reduced Hours",
"x-help": "Optional: Restrict battery power during specific hours. Example: {'22': 1000, '23': 1000} limits to 1000W from 22:00-23:59. Useful for noise reduction at night.",
"x-ui-section": "Power Configuration",
"x-validation-hint": "Keys are hour strings (0-23), values are watts"
},
"reduce_power_low_soc": {
"description": "SOC thresholds and power limits for low SOC power reduction",
"items": {
"$ref": "#/$defs/SocPowerLimit"
},
"title": "Reduce Power Low Soc",
"type": "array",
"x-help": "Optional: List of SOC/power pairs to reduce battery power at low state of charge. Protects battery by limiting power when nearly empty.",
"x-ui-section": "Power Configuration"
},
"reduce_power_high_soc": {
"description": "SOC thresholds and power limits for high SOC power reduction",
"items": {
"$ref": "#/$defs/SocPowerLimit"
},
"title": "Reduce Power High Soc",
"type": "array",
"x-help": "Optional: List of SOC/power pairs to reduce battery power at high state of charge. Protects battery by limiting power when nearly full.",
"x-ui-section": "Power Configuration"
},
"minimum power": {
"description": "Minimum power in watts",
"minimum": 0,
"title": "Minimum Power",
"type": "integer",
"x-help": "Minimum power threshold in watts. Operations below this power level will be rounded to zero. Prevents inefficient micro-charging/discharging.",
"x-ui-section": "Power Configuration",
"x-unit": "W",
"x-validation-hint": "Must be >= 0, typically 50-200W"
},
"dc_to_bat efficiency": {
"description": "DC to battery efficiency",
"maximum": 1,
"minimum": 0,
"title": "Dc To Bat Efficiency",
"type": "number",
"x-help": "Efficiency of DC-coupled solar to battery conversion. Typically 0.95-0.98 for modern DC-coupled systems. Only relevant if DC-coupled solar is configured.",
"x-ui-section": "Power Configuration",
"x-unit": "ratio",
"x-validation-hint": "0.0-1.0, typically 0.95-0.98"
},
"dc_to_bat max power": {
"anyOf": [
{
"$ref": "#/$defs/FlexFloat"
},
{
"type": "null"
}
],
"default": null,
"description": "DC to battery max power in watts",
"x-help": "Maximum power for DC-coupled solar charging in watts. Determines how much DC solar power can flow directly to battery.",
"x-ui-section": "Power Configuration",
"x-unit": "W",
"x-validation-hint": "Must be > 0",
"title": "Dc To Bat Max Power"
},
"bat_to_dc efficiency": {
"description": "Battery to DC efficiency",
"maximum": 1,
"minimum": 0,
"title": "Bat To Dc Efficiency",
"type": "number",
"x-help": "Efficiency of battery to DC bus conversion. Typically 0.95-0.98. Only relevant for DC-coupled loads or reverse DC flow scenarios.",
"x-ui-section": "Power Configuration",
"x-unit": "ratio",
"x-validation-hint": "0.0-1.0, typically 0.95-0.98"
},
"bat_to_dc max power": {
"anyOf": [
{
"$ref": "#/$defs/FlexFloat"
},
{
"type": "null"
}
],
"default": null,
"description": "Battery to DC max power in watts",
"x-help": "Maximum power for battery to DC bus conversion in watts. Rarely used in typical residential setups.",
"x-ui-section": "Power Configuration",
"x-unit": "W",
"x-validation-hint": "Must be > 0",
"title": "Bat To Dc Max Power"
},
"cycle cost": {
"description": "Cost per battery cycle in euros",
"minimum": 0,
"title": "Cycle Cost",
"type": "number",
"x-help": "Degradation cost per full charge-discharge cycle in euros. Used to factor battery wear into optimization. Calculate as: (battery_cost / warranted_cycles). Example: €5000 battery with 6000 cycles = €0.83/cycle.",
"x-ui-section": "Power Configuration",
"x-unit": "€",
"x-validation-hint": "Must be >= 0, typically €0.50-€1.50 per cycle"
},
"entity set power feedin": {
"anyOf": [
{
"$ref": "#/$defs/EntityId"
},
{
"type": "null"
}
],
"default": null,
"description": "HA entity to set power feed-in to grid",
"x-help": "Optional: Home Assistant entity to control grid feed-in power. Used by scheduler to execute optimized battery operations.",
"x-ui-section": "Power Configuration",
"x-ui-widget-filter": "number,input_number",
"title": "Entity Set Power Feedin"
},
"entity set operating mode": {
"anyOf": [
{
"$ref": "#/$defs/EntityId"
},
{
"type": "null"
}
],
"default": null,
"description": "HA entity to set battery operating mode",
"x-help": "Optional: Home Assistant entity to control battery operating mode (e.g., auto/manual/off). System will switch modes as needed for optimization.",
"x-ui-section": "Power Configuration",
"x-ui-widget-filter": "select,input_select,switch",
"title": "Entity Set Operating Mode"
},
"entity set operating mode on": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": "Aan",
"description": "Value for operating mode ON",
"title": "Entity Set Operating Mode On",
"x-help": "Value to send to operating mode entity for 'ON' state. Example: 'auto', 'enabled', 'on'. Must match actual entity values.",
"x-ui-section": "Power Configuration"
},
"entity set operating mode off": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": "Uit",
"description": "Value for operating mode OFF",
"title": "Entity Set Operating Mode Off",
"x-help": "Value to send to operating mode entity for 'OFF' state. Example: 'manual', 'disabled', 'off'. Must match actual entity values.",
"x-ui-section": "Power Configuration"
},
"entity stop inverter": {
"anyOf": [
{
"$ref": "#/$defs/EntityId"
},
{
"type": "null"
}
],
"default": null,
"description": "HA entity to stop inverter",
"x-help": "Optional: Home Assistant entity to stop the battery inverter. Usefull in situations when the battery is idle and you don't want idle-conusmptions of the battery.",
"x-ui-section": "Power Configuration",
"x-ui-widget-filter": "switch,button",
"title": "Entity Stop Inverter"
},
"entity from battery": {
"anyOf": [
{
"$ref": "#/$defs/EntityId"
},
{
"type": "null"
}
],
"default": null,
"description": "HA entity for power from battery",
"x-help": "Optional: Home Assistant entity to save the average power flow from/to battery in watts. Used for battery systems who wants to stear this power in/out.",
"x-ui-section": "Power Configuration",
"x-ui-widget-filter": "sensor",
"x-unit": "W",
"title": "Entity From Battery"
},
"entity from pv": {
"anyOf": [
{
"$ref": "#/$defs/EntityId"
},
{
"type": "null"
}
],
"default": null,
"description": "HA entity for power from PV",
"x-help": "Optional: Home Assistant entity to save the average calculated DC-coupled solar power in watts. Only relevant for DC-coupled solar installations.",
"x-ui-section": "Power Configuration",
"x-ui-widget-filter": "sensor",
"x-unit": "W",
"title": "Entity From Pv"
},
"entity from ac": {
"anyOf": [
{
"$ref": "#/$defs/EntityId"
},
{
"type": "null"
}
],
"default": null,
"description": "HA entity for power from AC",
"x-help": "Optional: Home Assistant entity to save the calculated average grid power in watts. For battery systems that want to stear the power in/out.",
"x-ui-section": "Power Configuration",
"x-ui-widget-filter": "sensor",
"x-unit": "W",
"title": "Entity From Ac"
},
"entity calculated soc": {
"anyOf": [
{
"$ref": "#/$defs/EntityId"
},
{
"type": "null"
}
],
"default": null,
"description": "HA entity for saving calculated SOC",
"x-help": "Optional: Home Assistant entity to save the calculated State of Charge at the end of the first interval. For battery systems that will stear at SoC-values",
"x-order": 1,
"x-ui-section": "Power Configuration",
"x-ui-widget-filter": "sensor",
"x-unit": "%",
"title": "Entity Calculated Soc"
},
"solar": {
"description": "DC-coupled solar panels attached to this battery",
"items": {
"$ref": "#/$defs/SolarConfig"
},
"title": "Solar",
"type": "array",
"x-help": "Optional: Configure DC-coupled solar panels directly connected to this battery inverter. DC coupling is more efficient than AC coupling. Leave empty for AC-coupled or grid-only batteries.",
"x-order": 1000,
"x-ui-section": "Battery Connected Solar"
}
},
"required": [
"name",
"entity actual level",
"capacity",
"charge stages",
"discharge stages",
"minimum power",
"dc_to_bat efficiency",
"bat_to_dc efficiency",
"cycle cost"
],
"title": "BatteryConfig",
"type": "object",
"x-docs-url": "https://github.com/corneel27/day-ahead/wiki/Battery-Configuration",
"x-help": "# Battery Configuration\n\nConfigure your home battery storage system for optimal energy management and cost savings.\n\n## Key Settings\n- **Capacity**: Total storage capacity in kWh\n- **SOC Limits**: Upper and lower charge limits to protect battery health\n- **Power Stages**: Define charging/discharging efficiency curves\n- **Control Entities**: Home Assistant entities to control the battery\n\n## Tips\n- Set upper_limit to 80-90% for longer battery life\n- Configure charge/discharge stages for accurate optimization\n- Monitor battery degradation with cycle_cost setting\n",
"x-icon": "battery-charging",
"x-order": 1,
"x-ui-group": "Energy"
},
"BatteryStage": {
"additionalProperties": true,
"description": "Single charge/discharge stage with power and efficiency.",
"properties": {
"power": {
"description": "Power level in Watts",
"minimum": 0,
"title": "Power",
"type": "number",
"x-help": "Power level for this charge/discharge stage. Stages define how battery efficiency changes at different power levels.",
"x-ui-section": "Power Configuration",
"x-unit": "W",
"x-validation-hint": "Must be 0 or greater, stages should be sorted by power"
},
"efficiency": {
"description": "Efficiency at this power level (0-1)",
"maximum": 1,
"minimum": 0,
"title": "Efficiency",
"type": "number",
"x-help": "Energy conversion efficiency at this power level. Value between 0 and 1, where 1 = 100% efficient.",
"x-ui-section": "Power Configuration",
"x-unit": "ratio (0-1)",
"x-validation-hint": "Must be between 0 and 1"
}
},
"required": [
"power",
"efficiency"
],
"title": "BatteryStage",
"type": "object",
"x-help": "Defines power and efficiency at a specific operating point. Multiple stages create a power/efficiency curve.",
"x-ui-section": "Power Configuration"
},
"BoilerDisabled": {
"additionalProperties": true,
"description": "Hot water boiler disabled — only boiler_present is required.",
"properties": {
"boiler present": {
"const": false,
"default": false,
"description": "Whether boiler is present/enabled",
"title": "Boiler Present",
"type": "boolean",
"x-help": "Set to false to disable boiler optimization entirely. No other fields are required.",
"x-ui-section": "General"
}
},
"title": "BoilerDisabled",
"type": "object",
"x-icon": "water-boiler",
"x-order": 5,
"x-ui-group": "Heating"
},
"BoilerEnabled": {
"additionalProperties": true,
"description": "Hot water boiler enabled — all operational fields required.",
"properties": {
"boiler present": {
"const": true,
"default": true,
"description": "Whether boiler is present/enabled",
"title": "Boiler Present",
"type": "boolean",
"x-help": "Enable hot water boiler optimization. Set to true to include boiler in optimization, false to disable.",
"x-ui-section": "General"
},
"entity actual temp.": {
"$ref": "#/$defs/EntityId",
"description": "HA entity for actual water temperature",
"x-help": "Home Assistant sensor showing current hot water temperature in °C. Required for thermal state tracking and heating decisions.",
"x-ui-section": "Sensors",
"x-ui-widget-filter": "sensor",
"x-unit": "°C",
"title": "Entity Actual Temp."
},
"entity setpoint": {
"$ref": "#/$defs/EntityId",
"description": "HA entity for temperature setpoint",
"x-help": "Home Assistant entity for target water temperature. System will heat water to this temperature. Typical: 55-65°C for domestic hot water.",
"x-ui-section": "Configuration",
"x-ui-widget-filter": "input_number,number,sensor",
"x-unit": "°C",
"title": "Entity Setpoint"
},
"entity hysterese": {
"$ref": "#/$defs/EntityId",
"description": "HA entity for temperature hysteresis",
"x-help": "Home Assistant entity for temperature hysteresis in °C. Prevents excessive cycling. If setpoint=60°C and hysteresis=5°C, heating starts at 55°C.",
"x-ui-section": "Configuration",
"x-ui-widget-filter": "input_number,number,sensor",
"x-unit": "°C",
"title": "Entity Hysterese"
},
"entity boiler enabled": {
"anyOf": [
{
"$ref": "#/$defs/EntityId"
},
{
"type": "null"
}
],
"default": null,
"description": "HA entity for boiler enabled status",
"x-help": "Optional: Home Assistant binary sensor indicating if boiler is enabled. System will only optimize when boiler is enabled.",
"x-ui-section": "Sensors",
"x-ui-widget-filter": "binary_sensor",
"title": "Entity Boiler Enabled"
},
"entity instant start": {
"anyOf": [
{
"$ref": "#/$defs/EntityId"
},
{
"type": "null"
}
],
"default": null,
"description": "HA entity for instant start",
"x-help": "Optional: Home Assistant entity to trigger immediate boiler heating. Overrides optimized schedule for on-demand hot water.",
"x-ui-section": "Controls",
"x-ui-widget-filter": "switch,input_boolean,button",
"title": "Entity Instant Start"
},
"cop": {
"$ref": "#/$defs/FlexFloat",
"default": 3.0,
"description": "Coefficient of Performance",
"x-help": "Coefficient of Performance if using heat pump water heater. For resistive heating element, use 1.0. For heat pump water heater, typically 2.5-4.0.",
"x-ui-section": "Physical Properties",
"x-unit": "ratio",
"x-validation-hint": "Must be > 0, use 1.0 for resistive, 2.5-4.0 for heat pump",
"title": "Cop"
},
"cooling rate": {
"$ref": "#/$defs/FlexFloat",
"description": "Cooling rate in degrees per hour",
"x-help": "Rate at which water temperature drops when not heating, in °C per hour. Depends on insulation quality. Typical: 0.5-2.0°C/h for well-insulated boilers.",
"x-ui-section": "Physical Properties",
"x-unit": "°C/h",
"x-validation-hint": "Must be >= 0, typically 0.5-2.0°C/h",
"title": "Cooling Rate"
},
"volume": {
"default": 200.0,
"description": "Water volume in liters",
"exclusiveMinimum": 0,
"title": "Volume",
"type": "number",
"x-help": "Hot water tank volume in liters. Affects thermal inertia and heating time. Typical residential: 100-300 liters.",
"x-ui-section": "Physical Properties",
"x-unit": "L",
"x-validation-hint": "Must be > 0, typically 100-300L"
},
"heating allowed below": {
"$ref": "#/$defs/FlexFloat",
"description": "Temperature below which heating is allowed",
"x-help": "Maximum temperature for starting heating cycle. Heating only occurs when water is below this temperature. Typically same as or slightly above setpoint.",
"x-ui-section": "Configuration",
"x-unit": "°C",
"x-validation-hint": "Should be >= setpoint",
"title": "Heating Allowed Below"
},
"elec. power": {
"default": 1000.0,
"description": "Electrical power in watts",
"exclusiveMinimum": 0,
"title": "Elec. Power",
"type": "number",
"x-help": "Electrical power consumption of heating element or heat pump compressor in watts. Typical: 1000-3000W for resistive, 400-800W for heat pump water heater.",
"x-ui-section": "Physical Properties",
"x-unit": "W",
"x-validation-hint": "Must be > 0, typically 1000-3000W"
},
"activate service": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Service type to activate boiler (e.g., 'press', 'switch')",
"title": "Activate Service",
"x-help": "Home Assistant service type to trigger boiler heating. Use 'press' for button entities, 'switch' for switch entities, or custom service names.",
"x-ui-section": "Controls"
},
"activate entity": {
"anyOf": [
{
"$ref": "#/$defs/EntityId"
},
{
"type": "null"
}
],
"default": null,
"description": "HA entity to activate boiler",
"x-help": "Home Assistant entity used to activate boiler heating. System will trigger this entity using activate_service when heating is needed.",
"x-ui-section": "Controls",
"x-ui-widget-filter": "button,switch",
"title": "Activate Entity"
},
"boiler heated by heatpump": {
"default": true,
"description": "Whether the boiler is heated by a heat pump",
"title": "Boiler Heated By Heatpump",
"type": "boolean",
"x-help": "Set to true if the boiler is heated by a heat pump (COP > 1). Set to false for direct electric resistive heating. Affects optimization calculations.",
"x-ui-section": "Configuration"
},
"switch entity": {
"anyOf": [
{
"$ref": "#/$defs/EntityId"
},
{
"type": "null"
}
],
"default": null,
"description": "HA entity to switch boiler on/off",
"x-help": "Optional: Home Assistant switch entity to directly control boiler power. Alternative to activate_entity for simple on/off control.",
"x-ui-section": "Controls",
"x-ui-widget-filter": "switch",
"title": "Switch Entity"
}
},
"required": [
"entity actual temp.",
"entity setpoint",
"entity hysterese",
"cooling rate",
"heating allowed below"
],
"title": "BoilerConfig",
"type": "object",
"x-docs-url": "https://github.com/corneel27/day-ahead/wiki/Boiler-Configuration",
"x-help": "# Hot Water Boiler Configuration\n\nOptimize hot water heating based on electricity prices, usage patterns, and thermal characteristics.\n\n## How It Works\n\nThe system models boiler as a thermal battery:\n- Water stores heat energy based on volume and temperature\n- Heat is lost over time based on cooling_rate\n- System schedules heating during cheap electricity periods\n- Ensures hot water availability when needed\n\n## Key Parameters\n\n### Temperature Control\n- **setpoint**: Target temperature (typically 55-65°C)\n- **hysterese**: Dead band to prevent cycling (typically 3-5°C)\n- **heating_allowed_below**: Max temp to start heating\n\n### Physical Properties\n- **volume**: Tank size affects how much heat can be stored\n- **cooling_rate**: Heat loss rate (better insulation = lower rate)\n- **elec_power**: Heating power affects heating duration\n- **cop**: Efficiency (1.0 for resistive, 2.5-4.0 for heat pump)\n\n### Activation\n- **activate_entity**: Button/switch to trigger heating\n- **activate_service**: Service type ('press' or 'switch')\n\n## Tips\n- Larger volume = more thermal storage capacity\n- Better insulation = lower cooling_rate = more flexibility\n- Heat pump water heaters (COP > 1.0) much more efficient than resistive\n- Schedule heating during solar production or cheap grid periods\n- Instant start available for emergency hot water needs\n",
"x-icon": "water-boiler",
"x-order": 5,
"x-ui-group": "Heating",
"x-ui-section": "Boiler"
},
"DashboardConfig": {
"additionalProperties": true,
"description": "Dashboard web UI configuration.",
"properties": {
"port": {
"default": 5000,
"description": "Web UI port number",
"maximum": 65535,
"minimum": 1024,
"title": "Port",
"type": "integer",
"x-help": "Port number for DAO web dashboard. Access at http://homeassistant.local:PORT. Must be between 1024-65535 (non-privileged ports).",
"x-unit": "port",
"x-validation-hint": "1024-65535, default 5000"
}
},
"title": "DashboardConfig",
"type": "object",
"x-docs-url": "https://github.com/corneel27/day-ahead/wiki/Dashboard",
"x-help": "# Dashboard Configuration\n\nConfigure web dashboard for monitoring and controlling Day Ahead Optimizer.\n\n## Dashboard Features\n\n- View optimization results\n- Monitor device schedules\n- Check price forecasts\n- Review historical data\n- Trigger manual optimization\n- View graphs and reports\n\n## Access\n\nAccess dashboard at:\n- **Local**: http://homeassistant.local:PORT\n- **IP**: http://YOUR_HA_IP:PORT\n\n## Port Selection\n\n- Default: 5000\n- Must be unused port\n- Check no conflicts with other services\n- Must be >= 1024 (non-privileged)\n\n## Tips\n\n- Add to Home Assistant sidebar via iframe card\n- Enable Ingress for secure access\n- Use reverse proxy for external access\n- Dashboard updates after each optimization\n",
"x-icon": "view-dashboard",
"x-order": 16,
"x-ui-group": "Integration",
"x-ui-section": "Dashboard"
},
"DatabaseConfig": {
"additionalProperties": true,
"description": "Day Ahead database configuration (database da).\n\nCan be either SQLite, MySQL/MariaDB, or PostgreSQL.",
"properties": {
"engine": {
"default": "sqlite",
"description": "Database engine type",
"enum": [
"sqlite",
"mysql",
"postgresql"
],
"title": "Engine",
"type": "string",
"x-help": "Database engine for Day Ahead optimizer data. SQLite is simplest (no server needed), MySQL/PostgreSQL for advanced setups or shared databases.",
"x-ui-section": "DAO Database"
},
"db_path": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Database path for SQLite (e.g., '../data')",
"title": "Db Path",
"x-help": "Directory path for SQLite database file. Relative to add-on root. Example: '../data' stores in persistent data folder. Only for SQLite.",
"x-ui-rules": {
"condition": {
"schema": {
"enum": [
"sqlite"
]
},
"scope": "#/properties/engine"
},
"effect": "SHOW"
},
"x-ui-section": "DAO Database",
"x-validation-hint": "Required for SQLite (or use database field)"
},
"database": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Database filename for SQLite or database name for MySQL",
"title": "Database",
"x-help": "For SQLite: filename (e.g., 'day_ahead.db'). For MySQL/PostgreSQL: database name. At least one of db_path or database required for SQLite.",
"x-ui-section": "DAO Database",
"x-validation-hint": "Filename for SQLite, database name for MySQL/PostgreSQL"
},
"server": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "MySQL server hostname (required for mysql)",
"title": "Server",
"x-help": "Hostname or IP of MySQL/PostgreSQL server. Required for server-based engines. Examples: 'localhost', '192.168.1.100'.",
"x-ui-rules": {
"condition": {
"schema": {
"enum": [
"mysql",
"postgresql"
]
},
"scope": "#/properties/engine"
},
"effect": "SHOW"
},
"x-ui-section": "DAO Database",
"x-validation-hint": "Required for mysql/postgresql engines"
},
"port": {
"anyOf": [
{
"maximum": 65535,
"minimum": 1,
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"description": "MySQL/PostgreSQL server port (required for mysql/postgresql)",
"title": "Port",
"x-help": "Database server port. Required for MySQL/PostgreSQL. Standard ports: 3306 (MySQL), 5432 (PostgreSQL).",
"x-ui-rules": {
"condition": {
"schema": {
"enum": [
"mysql",
"postgresql"
]
},
"scope": "#/properties/engine"
},
"effect": "SHOW"
},
"x-ui-section": "DAO Database",
"x-validation-hint": "1-65535, required for mysql/postgresql"
},
"username": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "MySQL username (required for mysql)",
"title": "Username",
"x-help": "Database username for authentication. Required for MySQL/PostgreSQL.",
"x-ui-rules": {
"condition": {
"schema": {
"enum": [
"mysql",
"postgresql"
]
},
"scope": "#/properties/engine"
},
"effect": "SHOW"
},
"x-ui-section": "DAO Database",
"x-validation-hint": "Required for mysql/postgresql engines"
},
"password": {
"anyOf": [
{
"$ref": "#/$defs/SecretStr"
},
{
"type": "null"
}
],
"default": null,
"description": "MySQL password (can use !secret)",
"x-help": "Database password. Use secrets.json with '!secret password_key' for security. Never store passwords directly in config.",
"x-ui-rules": {
"condition": {
"schema": {
"enum": [
"mysql",
"postgresql"
]
},
"scope": "#/properties/engine"
},
"effect": "SHOW"
},
"x-ui-section": "DAO Database",
"x-validation-hint": "Use !secret for passwords",
"title": "Password"
},
"time_zone": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Database timezone",
"title": "Time Zone",
"x-help": "Optional: Timezone for database timestamps. Examples: 'Europe/Amsterdam', 'UTC'. Usually not needed if database and system timezones match.",
"x-ui-section": "DAO Database"
}
},
"title": "DatabaseConfig",
"type": "object",
"x-docs-url": "https://github.com/corneel27/day-ahead/wiki/Database-Configuration",
"x-help": "# Day Ahead Database Configuration\n\nDatabase for storing Day Ahead optimizer calculations, schedules, and results.\n\n## Engine Options\n\n### SQLite (Recommended for most users)\n- **Pros**: No server setup, simple, included with Home Assistant\n- **Cons**: Single-user, not suitable for multiple HA instances\n- **Config**: Specify db_path and/or database filename\n\n### MySQL/MariaDB\n- **Pros**: Multi-user, robust, good performance\n- **Cons**: Requires separate database server\n- **Config**: server, port, username, password, database name\n\n### PostgreSQL\n- **Pros**: Advanced features, excellent for large datasets\n- **Cons**: Requires separate database server, more complex\n- **Config**: server, port, username, password, database name\n\n## Security\n\n**Never store passwords in options.json!**\n\nUse secrets.json:\n```json\n{\n \"db_password\": \"actual_password_here\"\n}\n```\n\nThen in options.json:\n```json\n\"password\": \"!secret db_password\"\n```\n\n## Tips\n\n- SQLite for single HA instance (simplest)\n- MySQL for shared database or multiple instances\n- Use strong passwords for server-based databases\n- Ensure database is backed up (contains optimization history)\n- Check database size periodically (can grow with history)\n",
"x-icon": "database",
"x-order": 10,
"x-ui-group": "Integration"
},
"EVChargeScheduler": {
"additionalProperties": true,
"description": "EV charge scheduling configuration.",
"properties": {
"entity set level": {
"$ref": "#/$defs/EntityId",
"description": "HA entity to set target charge level",
"x-help": "Home Assistant entity to set the target battery level for scheduled charging. System will optimize when to charge to reach this level.",
"x-ui-section": "General",
"x-ui-widget-filter": "input_number,number",
"x-unit": "%",
"title": "Entity Set Level"
},
"level margin": {
"default": 0,
"description": "Margin in % for charge level completion",
"minimum": 0,
"title": "Level Margin",
"type": "integer",
"x-help": "Acceptable margin below target level. Example: target=80%, margin=5% means 75-80% is acceptable. Provides flexibility in optimization.",
"x-ui-section": "General",
"x-unit": "%",
"x-validation-hint": "Must be >= 0, typically 5-10%"
},
"entity ready datetime": {
"$ref": "#/$defs/EntityId",
"description": "HA entity for ready datetime (when charging should complete)",
"x-help": "Home Assistant datetime entity specifying when vehicle must be charged. System will optimize charging schedule to minimize cost while meeting deadline.",
"x-ui-section": "General",
"x-ui-widget-filter": "input_datetime,datetime",
"title": "Entity Ready Datetime"
}
},
"required": [
"entity set level",
"entity ready datetime"
],
"title": "EVChargeScheduler",
"type": "object",
"x-help": "Advanced scheduler that optimizes charging to reach target level by specific deadline, minimizing cost by charging during cheapest hours.",
"x-ui-section": "General"
},
"EVChargeStage": {
"additionalProperties": true,
"description": "Single EV charging stage with amperage and efficiency.",
"properties": {
"ampere": {
"description": "Charging current in amperes",
"minimum": 0,
"title": "Ampere",
"type": "number",
"x-help": "Charging current in amperes for this stage. Typical values: 6A (1.4kW), 10A (2.3kW), 16A (3.7kW), 32A (7.4kW) for single-phase.",
"x-ui-section": "General",
"x-unit": "A",
"x-validation-hint": "Must be >= 0, typically 6-32A"
},
"efficiency": {
"description": "Charging efficiency at this amperage (0-1)",
"maximum": 1,
"minimum": 0,
"title": "Efficiency",
"type": "number",
"x-help": "Charging efficiency ratio at this amperage level. Accounts for charger losses, cable losses, and battery acceptance. Typically 0.85-0.95.",
"x-ui-section": "General",
"x-unit": "ratio",
"x-validation-hint": "0.0-1.0, typically 0.85-0.95"
}
},
"required": [
"ampere",
"efficiency"
],
"title": "EVChargeStage",
"type": "object",
"x-help": "Define charging curve by specifying amperage and efficiency pairs. Multiple stages allow accurate modeling of variable efficiency.",
"x-ui-section": "General"
},
"EVConfig": {
"additionalProperties": true,
"description": "Electric Vehicle configuration.",
"properties": {
"name": {
"description": "EV name/identifier",
"title": "Name",
"type": "string",
"x-help": "Unique name for this electric vehicle. Use descriptive names like 'Tesla Model 3' or 'Polestar 2' for multiple vehicles.",
"x-ui-section": "General"
},
"capacity": {
"description": "Battery capacity in kWh",
"exclusiveMinimum": 0,
"title": "Capacity",
"type": "number",
"x-help": "Usable battery capacity in kilowatt-hours. Check vehicle specifications (often less than advertised total capacity).",
"x-ui-section": "General",
"x-unit": "kWh",
"x-validation-hint": "Must be > 0, typically 40-100 kWh"
},
"switch cost": {
"anyOf": [
{