Skip to content

Commit

Permalink
Merge pull request #52 from molikk/essential-load-items-number-up-to-23
Browse files Browse the repository at this point in the history
essential load items number up to 23
  • Loading branch information
molikk authored Aug 6, 2024
2 parents d8bf8ed + 4db8b71 commit b950d73
Show file tree
Hide file tree
Showing 5 changed files with 88 additions and 17 deletions.
6 changes: 3 additions & 3 deletions dist/mlk-power-flow-card.js

Large diffs are not rendered by default.

90 changes: 77 additions & 13 deletions src/editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ export class ConfigurationCardEditor extends LitElement implements LovelaceCardE
},
{
type: 'expandable',
title: this._title('additional_load'),
title: this._title('additional_load1'),
schema: [
{
name: 'load',
Expand All @@ -286,7 +286,18 @@ export class ConfigurationCardEditor extends LitElement implements LovelaceCardE
{ name: 'load7_name', selector: { text: {} } },
{ name: 'load7_icon', selector: { icon: {} } },
{ name: 'load8_name', selector: { text: {} } },
{ name: 'load8_icon', selector: { icon: {} } },
{ name: 'load8_icon', selector: { icon: {} } }
],
},
],
},{
type: 'expandable',
title: this._title('additional_load2'),
schema: [
{
name: 'load',
type: 'grid',
schema: [
{ name: 'load9_name', selector: { text: {} } },
{ name: 'load9_icon', selector: { icon: {} } },
{ name: 'load10_name', selector: { text: {} } },
Expand All @@ -307,6 +318,16 @@ export class ConfigurationCardEditor extends LitElement implements LovelaceCardE
{ name: 'load17_icon', selector: { icon: {} } },
{ name: 'load18_name', selector: { text: {} } },
{ name: 'load18_icon', selector: { icon: {} } },
{ name: 'load19_name', selector: { text: {} } },
{ name: 'load19_icon', selector: { icon: {} } },
{ name: 'load20_name', selector: { text: {} } },
{ name: 'load20_icon', selector: { icon: {} } },
{ name: 'load21_name', selector: { text: {} } },
{ name: 'load21_icon', selector: { icon: {} } },
{ name: 'load22_name', selector: { text: {} } },
{ name: 'load22_icon', selector: { icon: {} } },
{ name: 'load23_name', selector: { text: {} } },
{ name: 'load23_icon', selector: { icon: {} } },
],
},
],
Expand Down Expand Up @@ -454,6 +475,7 @@ export class ConfigurationCardEditor extends LitElement implements LovelaceCardE
{ name: 'battery_temp_182', selector: { entity: { device_class: SensorDeviceClass.TEMPERATURE } } },
{ name: 'day_battery_charge_70', selector: { entity: { device_class: SensorDeviceClass.ENERGY } } },
{ name: 'day_battery_discharge_71', selector: { entity: { device_class: SensorDeviceClass.ENERGY } } },
{ name: 'battery_remaining_storage', selector: { entity: { device_class: SensorDeviceClass.ENERGY } } },
{ name: 'battery_rated_capacity', selector: { entity: {} } },
{ name: 'battery_soh', selector: { entity: {} } },
{ name: 'battery_current_direction', selector: { entity: {} } },
Expand Down Expand Up @@ -540,11 +562,14 @@ export class ConfigurationCardEditor extends LitElement implements LovelaceCardE
{ name: 'aux_load2', selector: { entity: { device_class: SensorDeviceClass.POWER } } },
{ name: 'aux_load2_extra', selector: { entity: { device_class: SensorDeviceClass.ENERGY } } },
{ name: 'aux_load2_toggle', selector: { entity: { domain: ['input_boolean', 'switch'] } } },
{ name: 'aux_load3', selector: { entity: { device_class: SensorDeviceClass.POWER } } },
{ name: 'aux_load3_extra', selector: { entity: { device_class: SensorDeviceClass.ENERGY } } },
{ name: 'aux_load3_toggle', selector: { entity: { domain: ['input_boolean', 'switch'] } } },
],
},
{
type: 'expandable',
title: this._title('ess_ld'),
title: this._title('ess_ld1'),
schema: [
{
name: 'entities',
Expand Down Expand Up @@ -574,6 +599,18 @@ export class ConfigurationCardEditor extends LitElement implements LovelaceCardE
{ name: 'essential_load8', selector: { entity: { device_class: SensorDeviceClass.POWER } } },
{ name: 'essential_load8_extra', selector: { entity: { device_class: SensorDeviceClass.ENERGY } } },
{ name: 'essential_load8_toggle', selector: { entity: { domain: ['input_boolean', 'switch'] } } },
],
},
],
},
{
type: 'expandable',
title: this._title('ess_ld2'),
schema: [
{
name: 'entities',
type: 'grid',
schema: [
{ name: 'essential_load9', selector: { entity: { device_class: SensorDeviceClass.POWER } } },
{ name: 'essential_load9_extra', selector: { entity: { device_class: SensorDeviceClass.ENERGY } } },
{ name: 'essential_load9_toggle', selector: { entity: { domain: ['input_boolean', 'switch'] } } },
Expand Down Expand Up @@ -604,6 +641,21 @@ export class ConfigurationCardEditor extends LitElement implements LovelaceCardE
{ name: 'essential_load18', selector: { entity: { device_class: SensorDeviceClass.POWER } } },
{ name: 'essential_load18_extra', selector: { entity: { device_class: SensorDeviceClass.ENERGY } } },
{ name: 'essential_load18_toggle', selector: { entity: { domain: ['input_boolean', 'switch'] } } },
{ name: 'essential_load19', selector: { entity: { device_class: SensorDeviceClass.POWER } } },
{ name: 'essential_load19_extra', selector: { entity: { device_class: SensorDeviceClass.ENERGY } } },
{ name: 'essential_load19_toggle', selector: { entity: { domain: ['input_boolean', 'switch'] } } },
{ name: 'essential_load20', selector: { entity: { device_class: SensorDeviceClass.POWER } } },
{ name: 'essential_load20_extra', selector: { entity: { device_class: SensorDeviceClass.ENERGY } } },
{ name: 'essential_load20_toggle', selector: { entity: { domain: ['input_boolean', 'switch'] } } },
{ name: 'essential_load21', selector: { entity: { device_class: SensorDeviceClass.POWER } } },
{ name: 'essential_load21_extra', selector: { entity: { device_class: SensorDeviceClass.ENERGY } } },
{ name: 'essential_load21_toggle', selector: { entity: { domain: ['input_boolean', 'switch'] } } },
{ name: 'essential_load22', selector: { entity: { device_class: SensorDeviceClass.POWER } } },
{ name: 'essential_load22_extra', selector: { entity: { device_class: SensorDeviceClass.ENERGY } } },
{ name: 'essential_load22_toggle', selector: { entity: { domain: ['input_boolean', 'switch'] } } },
{ name: 'essential_load23', selector: { entity: { device_class: SensorDeviceClass.POWER } } },
{ name: 'essential_load23_extra', selector: { entity: { device_class: SensorDeviceClass.ENERGY } } },
{ name: 'essential_load23_toggle', selector: { entity: { domain: ['input_boolean', 'switch'] } } },
],
},
],
Expand Down Expand Up @@ -632,23 +684,35 @@ export class ConfigurationCardEditor extends LitElement implements LovelaceCardE
{ name: 'grid_current_L3', selector: { entity: { device_class: SensorDeviceClass.CURRENT } } },
{ name: 'grid_ct_power_total', selector: { entity: { device_class: SensorDeviceClass.POWER } } },
{ name: 'grid_voltage', selector: { entity: { device_class: SensorDeviceClass.VOLTAGE } } },
{ name: 'nonessential_power', selector: { entity: { device_class: SensorDeviceClass.POWER } } },
{ name: 'non_essential_load1', selector: { entity: { device_class: SensorDeviceClass.POWER } } },
{ name: 'non_essential_load1_extra', selector: { entity: { device_class: SensorDeviceClass.ENERGY } } },
{ name: 'non_essential_load1_toggle', selector: { entity: { domain: ['input_boolean', 'switch'] } } },
{ name: 'non_essential_load2', selector: { entity: { device_class: SensorDeviceClass.POWER } } },
{ name: 'non_essential_load2_extra', selector: { entity: { device_class: SensorDeviceClass.ENERGY } } },
{ name: 'non_essential_load2_toggle', selector: { entity: { domain: ['input_boolean', 'switch'] } } },
{ name: 'non_essential_load3', selector: { entity: { device_class: SensorDeviceClass.POWER } } },
{ name: 'non_essential_load3_extra', selector: { entity: { device_class: SensorDeviceClass.ENERGY } } },
{ name: 'non_essential_load3_toggle', selector: { entity: { domain: ['input_boolean', 'switch'] } } },
{ name: 'grid_connected_status_194', selector: { entity: {} } },
{ name: 'energy_cost_buy', selector: { entity: {} } },
{ name: 'energy_cost_sell', selector: { entity: {} } },
{ name: 'prepaid_units', selector: { entity: {} } },
{ name: 'max_sell_power', selector: { entity: { device_class: SensorDeviceClass.POWER } } },
],
},
{
type: 'expandable',
title: this._title('ness_ld'),
schema: [
{
name: 'entities',
type: 'grid',
schema: [
{ name: 'nonessential_power', selector: { entity: { device_class: SensorDeviceClass.POWER } } },
{ name: 'non_essential_load1', selector: { entity: { device_class: SensorDeviceClass.POWER } } },
{ name: 'non_essential_load1_extra', selector: { entity: { device_class: SensorDeviceClass.ENERGY } } },
{ name: 'non_essential_load1_toggle', selector: { entity: { domain: ['input_boolean', 'switch'] } } },
{ name: 'non_essential_load2', selector: { entity: { device_class: SensorDeviceClass.POWER } } },
{ name: 'non_essential_load2_extra', selector: { entity: { device_class: SensorDeviceClass.ENERGY } } },
{ name: 'non_essential_load2_toggle', selector: { entity: { domain: ['input_boolean', 'switch'] } } },
{ name: 'non_essential_load3', selector: { entity: { device_class: SensorDeviceClass.POWER } } },
{ name: 'non_essential_load3_extra', selector: { entity: { device_class: SensorDeviceClass.ENERGY } } },
{ name: 'non_essential_load3_toggle', selector: { entity: { domain: ['input_boolean', 'switch'] } } },
],
},
],
},
],
},
],
Expand Down
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ export class PowerFlowCard extends LitElement {
const stateShutdownSOC = this.getEntity('battery.shutdown_soc', { state: config.battery.shutdown_soc?.toString() ?? '' });
const stateShutdownSOCOffGrid = this.getEntity('battery.shutdown_soc_offgrid', { state: config.battery.shutdown_soc_offgrid?.toString() ?? '' });
const stateBatterySOH = this.getEntity('entities.battery_soh', { state: '' });
const stateBatteryRemainingStorage = this.getEntity('entities.battery_remaining_storage', { state: '' });

//Load
const stateEssentialPower = this.getEntity('entities.essential_power');
Expand Down Expand Up @@ -1466,6 +1467,7 @@ export class PowerFlowCard extends LitElement {
dynamicColourNonEssentialLoad1,
dynamicColourNonEssentialLoad2,
dynamicColourNonEssentialLoad3,
stateBatteryRemainingStorage,
stateBatterySOH,
customGridIcon,
customGridIconColour,
Expand Down
6 changes: 5 additions & 1 deletion src/localize/languages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,8 @@
"aux_loads": "Aux Loads",
"essential_name": "Essential Name",
"additional_loads": "Additional Loads",
"additional_loads1": "Additional Loads 1-8",
"additional_loads2": "Additional Loads 9-23",
"export_colour": "Export Colour",
"nonessential_name": "Non Essential Name",
"nonessential_icon": "Non Essential Icon",
Expand All @@ -227,7 +229,9 @@
"inv": "Inverter Entities",
"inv_prog": "Programs Entities",
"ld": "Load Entities",
"ess_ld": "Essential Load Entities",
"ess_ld1": "Essential Load Entities 1-8",
"ess_ld2": "Essential Load Entities 9-23",
"ness_ld": "Essential Load Entities",
"gri": "Grid Entities",
"sensor": "Optional Sensors",
"max_power": "PV Max Power",
Expand Down
1 change: 1 addition & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,7 @@ export interface DataDto {
dynamicColourNonEssentialLoad1: string,
dynamicColourNonEssentialLoad2: string,
dynamicColourNonEssentialLoad3: string,
stateBatteryRemainingStorage: CustomEntity,
stateBatterySOH: CustomEntity,
customGridIcon: string,
customGridIconColour: string,
Expand Down

0 comments on commit b950d73

Please sign in to comment.