Skip to content

Commit b4d153f

Browse files
authored
Merge pull request #2143 from vinceg0267/sofar-eps-feedin-cleanup
Sofar: Unlock EPS for Monophase (X1) and clean FeedIn selection
2 parents 8d7e451 + 976edb7 commit b4d153f

1 file changed

Lines changed: 34 additions & 6 deletions

File tree

custom_components/solax_modbus/plugin_sofar.py

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ def value_function_sync_rtc_ymd_sofar(initval: Any, descr: Any, datadict: dict[s
464464
native_min_value=0,
465465
native_max_value=21600,
466466
native_step=1,
467-
allowedtypes=HYBRID | X3 | EPS,
467+
allowedtypes=HYBRID | EPS,
468468
prevent_update=True,
469469
write_method=WRITE_DATA_LOCAL,
470470
entity_registry_enabled_default=False,
@@ -580,7 +580,19 @@ def value_function_sync_rtc_ymd_sofar(initval: Any, descr: Any, datadict: dict[s
580580
1: "Enabled - Feed-in limitation",
581581
2: "Enabled - 3-phase limit",
582582
},
583-
allowedtypes=HYBRID | PV,
583+
allowedtypes=HYBRID | PV | X3,
584+
write_method=WRITE_DATA_LOCAL,
585+
icon="mdi:transmission-tower-import",
586+
),
587+
SofarModbusSelectEntityDescription(
588+
name="FeedIn: Limitation Mode",
589+
key="feedin_limitation_mode",
590+
register_data_type=REGISTER_U16,
591+
option_dict={
592+
0: "Disabled",
593+
1: "Enabled - Feed-in limitation",
594+
},
595+
allowedtypes=HYBRID | PV | X1,
584596
write_method=WRITE_DATA_LOCAL,
585597
icon="mdi:transmission-tower-import",
586598
),
@@ -720,7 +732,7 @@ def value_function_sync_rtc_ymd_sofar(initval: Any, descr: Any, datadict: dict[s
720732
1: "Turn On, Prohibit Cold Start",
721733
2: "Turn On, Enable Cold Start",
722734
},
723-
allowedtypes=HYBRID | X3 | EPS,
735+
allowedtypes=HYBRID | EPS,
724736
icon="mdi:power-plug-off",
725737
),
726738
# Does not work. 0x1035, 0x1036, and 0x1037 have to be written in one single chunk
@@ -771,7 +783,23 @@ def value_function_sync_rtc_ymd_sofar(initval: Any, descr: Any, datadict: dict[s
771783
6: "Generator mode",
772784
7: "Feed-In Priority Mode",
773785
},
774-
allowedtypes=HYBRID,
786+
allowedtypes=HYBRID | X3,
787+
write_method=WRITE_MULTISINGLE_MODBUS,
788+
icon="mdi:battery-charging-60",
789+
),
790+
SofarModbusSelectEntityDescription(
791+
name="Energy Storage Mode",
792+
key="charger_use_mode",
793+
register=0x1110,
794+
option_dict={
795+
0: "Self Use",
796+
1: "Time of Use",
797+
2: "Timing Mode",
798+
3: "Passive Mode",
799+
4: "Peak Cut Mode",
800+
5: "Off-grid Mode",
801+
},
802+
allowedtypes=HYBRID | X1,
775803
write_method=WRITE_MULTISINGLE_MODBUS,
776804
icon="mdi:battery-charging-60",
777805
),
@@ -3314,15 +3342,15 @@ def value_function_sync_rtc_ymd_sofar(initval: Any, descr: Any, datadict: dict[s
33143342
2: "Turn On, Enable Cold Start",
33153343
},
33163344
entity_registry_enabled_default=False,
3317-
allowedtypes=HYBRID | X3 | EPS,
3345+
allowedtypes=HYBRID | EPS,
33183346
entity_category=EntityCategory.DIAGNOSTIC,
33193347
),
33203348
SofarModbusSensorEntityDescription(
33213349
name="EPS Wait Time",
33223350
key="passive_eps_wait_time",
33233351
register=0x102A,
33243352
entity_registry_enabled_default=False,
3325-
allowedtypes=HYBRID | X3 | EPS,
3353+
allowedtypes=HYBRID | EPS,
33263354
entity_category=EntityCategory.DIAGNOSTIC,
33273355
),
33283356
SofarModbusSensorEntityDescription(

0 commit comments

Comments
 (0)