Skip to content

Commit

Permalink
fix: Prevent resets of total entities
Browse files Browse the repository at this point in the history
  • Loading branch information
davidrapan committed Sep 18, 2024
1 parent 92771b0 commit 4fcaaf9
Show file tree
Hide file tree
Showing 24 changed files with 530 additions and 392 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ parameters:
rule: 3
registers: [0x0015, 0x0014]
icon: "mdi:solar-power"
validation:
min: 0.1

- name: "Today Production time"
class: ""
Expand Down
12 changes: 12 additions & 0 deletions custom_components/solarman/inverter_definitions/afore_hybrid.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ parameters:
rule: 1
registers: [0x07DC]
icon: "mdi:battery-plus"
validation:
min: 0.1

- name: "Total Battery Discharge"
class: "energy"
Expand All @@ -91,6 +93,8 @@ parameters:
rule: 1
registers: [0x07DE]
icon: "mdi:battery-minus"
validation:
min: 0.1

- name: "Today Battery Charge"
friendly_name: "Today's Battery Charge"
Expand Down Expand Up @@ -316,6 +320,8 @@ parameters:
rule: 1
registers: [0x03F7]
icon: mdi:solar-power
validation:
min: 0.1

- name: "Total Energy Export"
class: "energy"
Expand All @@ -325,6 +331,8 @@ parameters:
rule: 1
registers: [0x03FB]
icon: mdi:transmission-tower
validation:
min: 0.1

- name: "Total Energy Import"
class: "energy"
Expand All @@ -334,6 +342,8 @@ parameters:
rule: 1
registers: [0x03FD]
icon: mdi:transmission-tower
validation:
min: 0.1

- name: "Total Load Consumption"
class: "power"
Expand All @@ -342,3 +352,5 @@ parameters:
scale: 0.1
rule: 1
registers: [0x03FF]
validation:
min: 0.1
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ parameters:
registers: [0x004C]
icon: "mdi:home-lightning-bolt"

- name: "AC Output Frequency"
- name: "Output Frequency"
class: "frequency"
state_class: "measurement"
uom: "Hz"
Expand Down Expand Up @@ -274,7 +274,7 @@ parameters:
- key: 0x0004
value: "Fault"

- name: "Total AC Output Power (Active)"
- name: "Output Power"
class: "power"
state_class: "measurement"
uom: "W"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ parameters:
registers: [0x004C]
icon: "mdi:home-lightning-bolt"

- name: "AC Output Frequency"
- name: "Output Frequency"
class: "frequency"
state_class: "measurement"
uom: "Hz"
Expand Down Expand Up @@ -373,7 +373,7 @@ parameters:
- key: 0x0004
value: "Fault"

- name: "Total AC Output Power (Active)"
- name: "Output Power"
class: "power"
state_class: "measurement"
uom: "W"
Expand Down
14 changes: 14 additions & 0 deletions custom_components/solarman/inverter_definitions/deye_hybrid.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ parameters:
rule: 3
registers: [0x0060, 0x0061]
icon: "mdi:solar-power"
validation:
min: 0.1

- name: "Micro-inverter Power"
class: "power"
Expand All @@ -96,6 +98,8 @@ parameters:
rule: 3
registers: [0x0048, 0x0049]
icon: "mdi:battery-plus"
validation:
min: 0.1

- name: "Total Battery Discharge"
class: "energy"
Expand All @@ -105,6 +109,8 @@ parameters:
rule: 3
registers: [0x004A, 0x004B]
icon: "mdi:battery-minus"
validation:
min: 0.1

- name: "Today Battery Charge"
friendly_name: Today's Battery Charge
Expand Down Expand Up @@ -286,6 +292,8 @@ parameters:
rule: 1
registers: [0x004E, 0x0050]
icon: "mdi:transmission-tower-export"
validation:
min: 0.1

- name: Today Energy Export
alt: Today Energy Sold
Expand All @@ -307,6 +315,8 @@ parameters:
rule: 3
registers: [0x0051, 0x0052]
icon: "mdi:transmission-tower-import"
validation:
min: 0.1

- name: "Total Grid Production"
class: "energy"
Expand All @@ -316,6 +326,8 @@ parameters:
rule: 4
registers: [0x003F, 0x0040]
icon: "mdi:transmission-tower"
validation:
min: 0.1

- group: Upload
items:
Expand Down Expand Up @@ -367,6 +379,8 @@ parameters:
scale: 0.1
rule: 3
registers: [0x0055, 0x0056]
validation:
min: 0.1

- name: "SmartLoad"
update_interval: 30
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ parameters:
- key: 0x0004
value: "Fault"

- name: "Total Output AC Power"
- name: "Output AC Power"
class: "power"
state_class: "measurement"
uom: "W"
Expand Down
12 changes: 12 additions & 0 deletions custom_components/solarman/inverter_definitions/kstar_hybrid.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ parameters:
rule: 3
registers: [3042, 3041]
icon: "mdi:solar-power"
validation:
min: 0.1

- group: Power Grid
items:
Expand Down Expand Up @@ -195,6 +197,8 @@ parameters:
rule: 3
registers: [3115, 3114]
icon: "mdi:transmission-tower-export"
validation:
min: 0.1

- name: Today Energy Export
alt: Daily Energy Feed-In
Expand Down Expand Up @@ -240,6 +244,8 @@ parameters:
rule: 3
registers: [3122, 3121]
icon: "mdi:transmission-tower-import"
validation:
min: 0.1

- group: Electricity Consumption
items:
Expand Down Expand Up @@ -296,6 +302,8 @@ parameters:
rule: 3
registers: [3153, 3152]
icon: "mdi:home-lightning-bolt"
validation:
min: 0.1

- group: Battery
items:
Expand Down Expand Up @@ -407,6 +415,8 @@ parameters:
rule: 3
registers: [3293, 3292]
icon: "mdi:battery-minus-variant"
validation:
min: 0.1

- name: "Today Battery Discharge"
alt: Battery Daily Discharge
Expand All @@ -430,6 +440,8 @@ parameters:
rule: 3
registers: [3300, 3299]
icon: "mdi:battery-minus-variant"
validation:
min: 0.1

- name: "Today Battery Charge"
alt: Battery Daily Charge
Expand Down
18 changes: 15 additions & 3 deletions custom_components/solarman/inverter_definitions/megarevo_r-3h.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,8 @@ parameters:
registers: [0x311B]
icon: "mdi:thermometer"

- name: "Today PV Production"
friendly_name: Today's PV Production
- name: "Today Production"
friendly_name: Today's Production
class: "energy"
state_class: "total_increasing"
uom: "kWh"
Expand Down Expand Up @@ -213,14 +213,16 @@ parameters:
registers: [0x316F]
icon: "mdi:battery-minus"

- name: "Total PV Production"
- name: "Total Production"
class: "energy"
state_class: "total_increasing"
uom: "kWh"
scale: 0.001
rule: 3
registers: [0x3165]
icon: "mdi:solar-power"
validation:
min: 0.1

- name: "Total Energy Import"
class: "energy"
Expand All @@ -230,6 +232,8 @@ parameters:
rule: 3
registers: [0x317D]
icon: "mdi:transmission-tower-export"
validation:
min: 0.1

- name: "Total Energy Export"
class: "energy"
Expand All @@ -239,6 +243,8 @@ parameters:
rule: 3
registers: [0x3167]
icon: "mdi:transmission-tower-import"
validation:
min: 0.1

- name: "Total Load Consumption"
class: "energy"
Expand All @@ -247,6 +253,8 @@ parameters:
scale: 0.001
rule: 3
registers: [0x3169]
validation:
min: 0.1

- name: "Total Battery Charge"
class: "energy"
Expand All @@ -256,6 +264,8 @@ parameters:
rule: 3
registers: [0x317F]
icon: "mdi:battery-plus"
validation:
min: 0.1

- name: "Total Battery Discharge"
class: "energy"
Expand All @@ -265,6 +275,8 @@ parameters:
rule: 3
registers: [0x3181]
icon: "mdi:battery-minus"
validation:
min: 0.1

- name: "DC Temperature"
class: "temperature"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ parameters:
rule: 1
registers: [5164]
icon: "mdi:battery-plus"
validation:
min: 0.1

- name: "Total Battery Discharge"
class: "energy"
Expand All @@ -83,6 +85,8 @@ parameters:
rule: 1
registers: [5166]
icon: "mdi:battery-minus"
validation:
min: 0.1

- name: "Battery Voltage"
class: "voltage"
Expand Down
12 changes: 12 additions & 0 deletions custom_components/solarman/inverter_definitions/sofar_g3hyd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -815,6 +815,8 @@ parameters:
rule: 3
registers: [0x0687, 0x0686]
icon: "mdi:solar-power"
validation:
min: 0.1
- name: "Today Load Consumption"
friendly_name: Today's Load Consumption
class: "energy"
Expand All @@ -832,6 +834,8 @@ parameters:
rule: 3
registers: [0x068B, 0x068A]
icon: "mdi:solar-power"
validation:
min: 0.1
- name: Today Energy Import
alt: Daily Energy Bought
friendly_name: Today's Energy Import
Expand All @@ -851,6 +855,8 @@ parameters:
rule: 3
registers: [0x068F, 0x068E]
icon: "mdi:transmission-tower-export"
validation:
min: 0.1
- name: "Today Energy Export"
alt: Daily Energy Sold
friendly_name: Today's Energy Export
Expand All @@ -870,6 +876,8 @@ parameters:
rule: 3
registers: [0x0693, 0x0692]
icon: "mdi:transmission-tower-import"
validation:
min: 0.1
- name: "Today Battery Charge"
friendly_name: Today's Battery Charge
class: "energy"
Expand All @@ -887,6 +895,8 @@ parameters:
rule: 3
registers: [0x0697, 0x0696]
icon: "mdi:battery-plus"
validation:
min: 0.1
- name: "Today Battery Discharge"
friendly_name: Today's Battery Discharge
class: "energy"
Expand All @@ -904,6 +914,8 @@ parameters:
rule: 3
registers: [0x069b, 0x069A]
icon: "mdi:battery-minus"
validation:
min: 0.1

- group: Alert
items:
Expand Down
Loading

0 comments on commit 4fcaaf9

Please sign in to comment.