Skip to content

Commit

Permalink
Merge branch 'main' into feature/expose-topic-name-to-plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
kbialek committed Nov 1, 2024
2 parents dbae759 + cfde579 commit 05e3e82
Show file tree
Hide file tree
Showing 6 changed files with 149 additions and 10 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ METRIC_GROUPS = \
igen_dtsd422 \
deye_hybrid \
deye_hybrid_battery \
deye_hybrid_bms \
deye_hybrid_timeofuse \
settings \
settings_micro \
Expand Down
16 changes: 6 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,12 @@ When your inverter turns out to work well with an already exiting metrics group,
| Inverter model | Metric groups |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Deye SUN-4/5/6/7/8/10/12K-G05-P](https://deye.com/product/sun-4-5-6-7-8-10-12k-g05-4-12kw-three-phase-2-mppt/) | [string](docs/metric_group_string.md), [settings](docs/metric_group_settings.md) |
| [Deye SUN300/500G3-US-220/EU-230](https://deye.com/product/sun300-500g3-eu-230-300-500w-single-phase-1-mppt-micro-inverter-rapid-shutdown/) | [micro](docs/metric_group_micro.md), [settings_micro](docs/metric_group_settings_micro.md) |
| [Deye SUN600/800/1000G3-US-220/EU-230](https://deye.com/product/sun600-800-1000g3-eu-230-600-1000w-single-phase-2-mppt-micro-inverter-rapid-shutdown/) | [micro](docs/metric_group_micro.md), [settings_micro](docs/metric_group_settings_micro.md) |
| [Deye SUN-M60/80/100G3-EU-Q0](https://www.deyeinverter.com/product/microinverter-1/SUN600-800-1000G3US220-EU230-6001000W-Einphasig-2-MPPT-MikroWechselrichter-Schnelles-Herunterfahren.html) | [micro](docs/metric_group_micro.md), [settings](docs/metric_group_settings.md) |
| [Deye SUN1300-2000G3-US-220/EU-230](https://deye.com/product/sun1300-2000g3-eu-230-1300-2000w-single-phase-4-mppt-micro-inverter-rapid-shutdown/) | [micro](docs/metric_group_micro.md), [settings](docs/metric_group_settings.md) |
| [Deye SUN-5/6/8/10/12K-SG04LP3](https://deye.com/product/sun-5-6-8-10-12k-sg04lp3-5-12kw-three-phase-2-mppt-hybrid-inverter-low-voltage-battery/) | [deye_sg04lp3](docs/metric_group_deye_sg04lp3.md), [deye_sg04lp3_battery](docs/metric_group_deye_sg04lp3_battery.md), [deye_sg04lp3_ups](docs/metric_group_deye_sg04lp3_ups.md), [deye_sg04lp3_timeofuse](docs/metric_group_deye_sg04lp3_timeofuse.md), [deye_sg04lp3_generator](docs/metric_group_deye_sg04lp3_generator.md), [settings](docs/metric_group_settings.md) |
| [Deye SUN-5/6K-SG01LP1-US/EU](https://deye.com/product/sun-5-6k-sg01lp1-us-sun-7-6-8k-sg01lp1-us-eu-5-8kw-single-phase-2-mppt-hybrid-inverter-low-voltage-battery/) | [deye_hybrid](docs/metric_group_deye_hybrid.md), [deye_hybrid_battery](docs/metric_group_deye_hybrid_battery.md), [deye_hybrid_timeofuse](docs/metric_group_deye_hybrid_timeofuse.md), [settings](docs/metric_group_settings.md) |
| [Deye SUN-7.6/8K-SG01LP1-US/EU](https://deye.com/product/sun-5-6k-sg01lp1-us-sun-7-6-8k-sg01lp1-us-eu-5-8kw-single-phase-2-mppt-hybrid-inverter-low-voltage-battery/) | [deye_hybrid](docs/metric_group_deye_hybrid.md), [deye_hybrid_battery](docs/metric_group_deye_hybrid_battery.md), [deye_hybrid_timeofuse](docs/metric_group_deye_hybrid_timeofuse.md), [settings](docs/metric_group_settings.md) |
| [Deye SUN-12/14/16K-SG01LP1](https://deye.com/product/sun-12-14-16k-sg01lp1-12-16kw-single-phase-2-mppt-hybrid-inverter/) | [deye_hybrid](docs/metric_group_deye_hybrid.md), [deye_hybrid_battery](docs/metric_group_deye_hybrid_battery.md), [deye_hybrid_timeofuse](docs/metric_group_deye_hybrid_timeofuse.md), [settings](docs/metric_group_settings.md) |
| [Deye SUN-6/8/10/12/15/20K-SG01HP3-EU-AM2](https://deye.com/product/sun-6-8-10-12-15-20k-sg01hp3-eu-am2-6-20kw-three-phase-2-mppt-hybrid-inverter-low-voltage-battery/) | [deye_sg01hp3](docs/metric_group_deye_sg01hp3.md), [deye_sg01hp3_battery](docs/metric_group_deye_sg01hp3_battery.md), [deye_sg01hp3_bms](docs/metric_group_deye_sg01hp3_bms.md), [deye_sg01hp3_ups](docs/metric_group_deye_sg01hp3_ups.md), [settings](docs/metric_group_settings.md) |
| [Deye SUN-25/30/40/50K-SG01HP3-EU-BM2/3/4](https://deye.com/product/sun-25-30-40-50k-sg01hp3-eu-bm2-3-4-25-50kw-three-phase-2-mppt-hybrid-inverter-low-voltage-battery/) | [deye_sg01hp3](docs/metric_group_deye_sg01hp3.md), [deye_sg01hp3_battery](docs/metric_group_deye_sg01hp3_battery.md), [deye_sg01hp3_bms](docs/metric_group_deye_sg01hp3_bms.md), [deye_sg01hp3_ups](docs/metric_group_deye_sg01hp3_ups.md), [settings](docs/metric_group_settings.md) |
| [Deye Microinverters 300/500/600/800/1000/1300/2000]() | [micro](docs/metric_group_micro.md), [settings_micro](docs/metric_group_settings_micro.md) |
| [Deye Microinverters M60/M80/M100](https://deye.com/product/sun-m60-80-100g4-eu-q0/) | [micro](docs/metric_group_micro.md), [settings](docs/metric_group_settings.md) |
| [Deye Microinverters M130/M160/M180/M200/M220](https://deye.com/product/sun-m130-160-180-200-220g4-eu-q0/) | [micro](docs/metric_group_micro.md), [settings](docs/metric_group_settings.md) |
| [Deye SG04LP3](https://deye.com/product/sun-5-6-8-10-12k-sg04lp3-eu/) | [deye_sg04lp3](docs/metric_group_deye_sg04lp3.md), [deye_sg04lp3_battery](docs/metric_group_deye_sg04lp3_battery.md), [deye_sg04lp3_ups](docs/metric_group_deye_sg04lp3_ups.md), [deye_sg04lp3_timeofuse](docs/metric_group_deye_sg04lp3_timeofuse.md), [deye_sg04lp3_generator](docs/metric_group_deye_sg04lp3_generator.md), [settings](docs/metric_group_settings.md) |
| [Deye SG01LP1](https://deye.com/product/sun-7-6-8k-sg01lp1-eu/) | [deye_hybrid](docs/metric_group_deye_hybrid.md), [deye_hybrid_battery](docs/metric_group_deye_hybrid_battery.md), [deye_hybrid_bms](docs/metric_group_deye_hybrid_bms.md), [deye_hybrid_timeofuse](docs/metric_group_deye_hybrid_timeofuse.md), [settings](docs/metric_group_settings.md) |
| [Deye SG01HP3](https://deye.com/product/sun-5-6-8-10-12-15-20-25k-sg01hp3-eu-am2/) | [deye_sg01hp3](docs/metric_group_deye_sg01hp3.md), [deye_sg01hp3_battery](docs/metric_group_deye_sg01hp3_battery.md), [deye_sg01hp3_bms](docs/metric_group_deye_sg01hp3_bms.md), [deye_sg01hp3_ups](docs/metric_group_deye_sg01hp3_ups.md), [settings](docs/metric_group_settings.md) |

| Meter model | Metric groups |
| ------------------------------------------------------------------- | ------------------------------------------------- |
Expand Down
10 changes: 10 additions & 0 deletions docs/metric_group_deye_hybrid_bms.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
|Metric|MQTT topic suffix|Unit|Modbus address (dec)|Modbus address (hex)|Modbus data type|Scale factor|
|---|---|:-:|:-:|:-:|:-:|:-:|
|BMS1 Charging Voltage|`bms/1/charging_voltage`|V|312|138|U_WORD|0.01|
|BMS1 Discharge Voltage|`bms/1/discharge_voltage`|V|313|139|U_WORD|0.01|
|BMS1 Charge Current Limit|`bms/1/charge_current_limit`|A|314|13a|U_WORD|1|
|BMS1 Discharge Current Limit|`bms/1/discharge_current_limit`|A|315|13b|U_WORD|1|
|BMS1 SOC|`bms/1/soc`|%|316|13c|U_WORD|1|
|BMS1 Voltage|`bms/1/voltage`|V|317|13d|U_WORD|0.01|
|BMS1 Current|`bms/1/current`|A|318|13e|S_WORD|1|
|BMS1 Temp|`bms/1/temp`|°C|319|13f|U_WORD|0.1|
58 changes: 58 additions & 0 deletions ha_definitions/deye_hybrid_ha_custom.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
requests:
- start: 0x0106
end: 0x010b
mb_functioncode: 0x03
- start: 0x0138
end: 0x013f
mb_functioncode: 0x03

parameters:
- group: Time of Use
items:
Expand Down Expand Up @@ -54,3 +62,53 @@ parameters:
rule: 9
registers: [0x010B]
icon: 'mdi:timelapse'

- group: BMS
items:
- name: "BMS1 Charging Voltage"
uom: "V"
scale: 0.01
rule: 1
registers: [0x0138]

- name: "BMS1 Discharge Voltage"
uom: "V"
scale: 0.01
rule: 1
registers: [0x0139]

- name: "BMS1 Charge Current Limit"
uom: "A"
scale: 1
rule: 1
registers: [0x013a]

- name: "BMS1 Discharge Current Limit"
uom: "A"
scale: 1
rule: 1
registers: [0x013b]

- name: "BMS1 SOC"
uom: "%"
scale: 1
rule: 1
registers: [0x013c]

- name: "BMS1 Voltage"
uom: "V"
scale: 0.01
rule: 1
registers: [0x013d]

- name: "BMS1 Current"
uom: "A"
scale: 1
rule: 2
registers: [0x013e]

- name: "BMS1 Temp"
uom: "°C"
scale: 0.1
rule: 1
registers: [0x013f]
9 changes: 9 additions & 0 deletions ha_definitions/deye_hybrid_map.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,19 @@ topics:
277: timeofuse/enabled/4
278: timeofuse/enabled/5
279: timeofuse/enabled/6
312: bms/1/charging_voltage
313: bms/1/discharge_voltage
314: bms/1/charge_current_limit
315: bms/1/discharge_current_limit
316: bms/1/soc
317: bms/1/voltage
318: bms/1/current
319: bms/1/temp
groups:
solar: ''
grid: ''
inverter: ''
battery: battery
time of use: timeofuse
bms: bms

65 changes: 65 additions & 0 deletions src/deye_sensors_deye_hybrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,62 @@
groups=["deye_hybrid_timeofuse"],
)

deye_hybrid_bms_312 = SingleRegisterSensor(
"BMS1 Charging Voltage",
312,
0.01,
mqtt_topic_suffix="bms/1/charging_voltage",
unit="V",
signed=False,
groups=["deye_hybrid_bms"],
)

deye_hybrid_bms_313 = SingleRegisterSensor(
"BMS1 Discharge Voltage",
313,
0.01,
mqtt_topic_suffix="bms/1/discharge_voltage",
unit="V",
signed=False,
groups=["deye_hybrid_bms"],
)

deye_hybrid_bms_314 = SingleRegisterSensor(
"BMS1 Charge Current Limit",
314,
1,
mqtt_topic_suffix="bms/1/charge_current_limit",
unit="A",
signed=False,
groups=["deye_hybrid_bms"],
)

deye_hybrid_bms_315 = SingleRegisterSensor(
"BMS1 Discharge Current Limit",
315,
1,
mqtt_topic_suffix="bms/1/discharge_current_limit",
unit="A",
signed=False,
groups=["deye_hybrid_bms"],
)

deye_hybrid_bms_316 = SingleRegisterSensor(
"BMS1 SOC", 316, 1, mqtt_topic_suffix="bms/1/soc", unit="%", signed=False, groups=["deye_hybrid_bms"]
)

deye_hybrid_bms_317 = SingleRegisterSensor(
"BMS1 Voltage", 317, 0.01, mqtt_topic_suffix="bms/1/voltage", unit="V", signed=False, groups=["deye_hybrid_bms"]
)

deye_hybrid_bms_318 = SingleRegisterSensor(
"BMS1 Current", 318, 1, mqtt_topic_suffix="bms/1/current", unit="A", signed=True, groups=["deye_hybrid_bms"]
)

deye_hybrid_bms_319 = SingleRegisterSensor(
"BMS1 Temp", 319, 0.1, mqtt_topic_suffix="bms/1/temp", unit="°C", signed=False, groups=["deye_hybrid_bms"]
)

deye_hybrid_sensors = [
deye_hybrid_solar_186,
deye_hybrid_solar_187,
Expand Down Expand Up @@ -646,6 +702,14 @@
deye_hybrid_time_of_use_265,
deye_hybrid_time_of_use_266,
deye_hybrid_time_of_use_267,
deye_hybrid_bms_312,
deye_hybrid_bms_313,
deye_hybrid_bms_314,
deye_hybrid_bms_315,
deye_hybrid_bms_316,
deye_hybrid_bms_317,
deye_hybrid_bms_318,
deye_hybrid_bms_319,
]

deye_hybrid_register_ranges = [
Expand All @@ -655,4 +719,5 @@
SensorRegisterRange(group="deye_hybrid_battery", first_reg_address=150, last_reg_address=249),
SensorRegisterRange(group="deye_hybrid", first_reg_address=150, last_reg_address=249),
SensorRegisterRange(group="deye_hybrid_timeofuse", first_reg_address=250, last_reg_address=279),
SensorRegisterRange(group="deye_hybrid_bms", first_reg_address=312, last_reg_address=319),
]

0 comments on commit 05e3e82

Please sign in to comment.