From 770789857cb86b2a7329caa4edbdd0f1a823aed1 Mon Sep 17 00:00:00 2001 From: slipx06 Date: Sat, 15 Jul 2023 00:28:19 +0200 Subject: [PATCH] Update sunsynk-power-flow-card.js BREAKING CHANGE Update entity names and stub config --- dist/sunsynk-power-flow-card.js | 292 ++++++++++++++++---------------- 1 file changed, 146 insertions(+), 146 deletions(-) diff --git a/dist/sunsynk-power-flow-card.js b/dist/sunsynk-power-flow-card.js index 8d37633a..9c7b8fef 100644 --- a/dist/sunsynk-power-flow-card.js +++ b/dist/sunsynk-power-flow-card.js @@ -92,80 +92,80 @@ class SunsynkPowerFlowCard extends LitElement { show_nonessential: 'yes', }, entities: { - use_timer_248: 'switch.toggle_system_timer', - priority_load_243: 'switch.toggle_priority_load', - inverter_grid_voltage_154: 'sensor.grid_inverter_voltage', - inverter_load_freq_192: 'sensor.load_frequency', - inverter_out_164: 'sensor.inverter_output_current', - inverter_out_175: 'sensor.inverter_output_power', - grid_status_194: 'binary_sensor.grid_connected_status', + use_timer_248: 'switch.sunsynk_toggle_system_timer', + priority_load_243: 'switch.sunsynk_toggle_priority_load', + inverter_voltage_154: 'sensor.sunsynk_inverter_voltage', + load_frequency_192: 'sensor.sunsynk_load_frequency', + inverter_current_164: 'sensor.sunsynk_inverter_current', + inverter_power_175: 'sensor.sunsynk_inverter_power', + grid_connected_status_194: 'binary_sensor.sunsynk_grid_connected_status', inverter_status_59: 'sensor.overall_state', - batchargeday_70: 'sensor.battery_charge_day', - batdischargeday_71: 'sensor.battery_discharge_day', - battery_voltage_183: 'sensor.battery_voltage', - battery_soc_184: 'sensor.battery_soc', - battery_out_190: 'sensor.battery_output_power', - battery_current_191: 'sensor.battery_output_current', - inverter_load_grid_169: 'sensor.grid_power', - grid_buy_day_76: 'sensor.grid_import_day_buy', - grid_sell_day_77: 'sensor.grid_export_day_sell', - grid_external_power_172: 'sensor.grid_external_power', - loadday_84: 'sensor.daily_load_power_kwh', + day_battery_charge_70: 'sensor.battery_charge_day', + day_battery_discharge_71: 'sensor.battery_discharge_day', + battery_voltage_183: 'sensor.sunsynk_battery_voltage', + battery_soc_184: 'sensor.sunsynk_battery_soc', + battery_power_190: 'sensor.sunsynk_battery_power', + battery_current_191: 'sensor.sunsynk_battery_current', + grid_power_169: 'sensor.sunsynk_grid_power', + day_grid_import_76: 'sensor.sunsynk_day_grid_import', + day_grid_export_77: 'sensor.sunsynk_day_grid_export', + grid_ct_power_172: 'sensor.sunsynk_grid_ct_power', + day_load_energy_84: 'sensor.sunsynk_day_load_energy', essential_power: 'none', nonessential_power: 'none', - aux_power_166: 'sensor.aux_output_power', - solarday_108: 'sensor.daily_pv_power_kwh', - pv1_power_186: 'sensor.pv1_power', - pv2_power_187: 'sensor.pv2_power', - pv1_v_109: 'sensor.dc1_voltage', - pv1_i_110: 'sensor.dc1_current', - pv2_v_111: 'sensor.dc2_voltage', - pv2_i_112: 'sensor.dc2_current', + aux_power_166: 'sensor.sunsynk_aux_power', + day_pv_energy_108: 'sensor.sunsynk_day_pv_energy', + pv1_power_186: 'sensor.sunsynk_pv1_power', + pv2_power_187: 'sensor.sunsynk_pv2_power', + pv1_voltage_109: 'sensor.sunsynk_pv1_voltage', + pv1_current_110: 'sensor.sunsynk_pv1_current', + pv2_voltage_111: 'sensor.sunsynk_pv2_voltage', + pv2_current_112: 'sensor.sunsynk_pv2_current', } }; } render() { const config = this._config; - const stateObj = this.hass.states[config.entities.batdischargeday_71] || { state: '0' }; - const stateObj1 = this.hass.states[config.entities.batchargeday_70] || { state: '0' }; - const stateObj2 = this.hass.states[config.entities.loadday_84] || { state: '0' }; - const stateObj3 = this.hass.states[config.entities.grid_buy_day_76] || { state: '0' }; - const stateObj4 = this.hass.states[config.entities.solarday_108] || { state: '0' }; - const stateObj5 = this.hass.states[config.entities.inverter_grid_voltage_154] || { state: '0' }; - const stateObj6 = this.hass.states[config.entities.inverter_load_freq_192] || { state: '0' }; - const stateObj7 = this.hass.states[config.entities.inverter_out_164] || { state: '0' }; + const stateObj = this.hass.states[config.entities.day_battery_discharge_71] || { state: '0' }; + const stateObj1 = this.hass.states[config.entities.day_battery_charge_70] || { state: '0' }; + const stateObj2 = this.hass.states[config.entities.day_load_energy_84] || { state: '0' }; + const stateObj3 = this.hass.states[config.entities.day_grid_import_76] || { state: '0' }; + const stateObj4 = this.hass.states[config.entities.day_pv_energy_108] || { state: '0' }; + const stateObj5 = this.hass.states[config.entities.inverter_voltage_154] || { state: '0' }; + const stateObj6 = this.hass.states[config.entities.load_frequency_192] || { state: '0' }; + const stateObj7 = this.hass.states[config.entities.inverter_current_164] || { state: '0' }; const stateObj8 = this.hass.states[config.entities.pv2_power_187] || { state: '0' }; const stateObj9 = this.hass.states[config.entities.pv1_power_186] || { state: '0' }; const stateObj11 = this.hass.states[config.entities.battery_voltage_183] || { state: '0' }; const stateObj12 = this.hass.states[config.entities.battery_soc_184] || { state: '0' }; - const stateObj13 = this.hass.states[config.entities.battery_out_190] || { state: '0' }; + const stateObj13 = this.hass.states[config.entities.battery_power_190] || { state: '0' }; const stateObj14 = this.hass.states[config.entities.essential_power] || { state: '0' }; - const stateObj15 = this.hass.states[config.entities.grid_external_power_172] || { state: '0' }; - const stateObj16 = this.hass.states[config.entities.pv1_v_109] || { state: '0' }; - const stateObj17 = this.hass.states[config.entities.pv1_i_110] || { state: '0' }; - const stateObj18 = this.hass.states[config.entities.pv2_v_111] || { state: '0' }; - const stateObj19 = this.hass.states[config.entities.pv2_i_112] || { state: '0' }; - const stateObj20 = this.hass.states[config.entities.grid_status_194] || { state: 'on' }; + const stateObj15 = this.hass.states[config.entities.grid_ct_power_172] || { state: '0' }; + const stateObj16 = this.hass.states[config.entities.pv1_voltage_109] || { state: '0' }; + const stateObj17 = this.hass.states[config.entities.pv1_current_110] || { state: '0' }; + const stateObj18 = this.hass.states[config.entities.pv2_voltage_111] || { state: '0' }; + const stateObj19 = this.hass.states[config.entities.pv2_current_112] || { state: '0' }; + const stateObj20 = this.hass.states[config.entities.grid_connected_status_194] || { state: 'on' }; const stateObj21 = this.hass.states[config.entities.inverter_status_59] || { state: '' }; - const stateObj22 = this.hass.states[config.entities.inverter_out_175] || { state: '0' }; - const stateObj23 = this.hass.states[config.entities.inverter_load_grid_169] || { state: '0' }; + const stateObj22 = this.hass.states[config.entities.inverter_power_175] || { state: '0' }; + const stateObj23 = this.hass.states[config.entities.grid_power_169] || { state: '0' }; const stateObj24 = this.hass.states[config.entities.aux_power_166] || { state: '0' }; const stateObj25 = this.hass.states[config.entities.priority_load_243] || { state: 'undefined' }; const stateObj26 = this.hass.states[config.entities.use_timer_248] || { state: 'undefined' }; - const stateObj27 = this.hass.states[config.entities.pv3_v_113] || { state: '0' }; - const stateObj28 = this.hass.states[config.entities.pv3_i_114] || { state: '0' }; - const stateObj29 = this.hass.states[config.entities.pv4_v_115] || { state: '0' }; - const stateObj30 = this.hass.states[config.entities.pv4_i_116] || { state: '0' }; + const stateObj27 = this.hass.states[config.entities.pv3_voltage_113] || { state: '0' }; + const stateObj28 = this.hass.states[config.entities.pv3_current_114] || { state: '0' }; + const stateObj29 = this.hass.states[config.entities.pv4_voltage_115] || { state: '0' }; + const stateObj30 = this.hass.states[config.entities.pv4_current_116] || { state: '0' }; const stateObj31 = this.hass.states[config.entities.pv3_power_188] || { state: '0' }; const stateObj32 = this.hass.states[config.entities.pv4_power_189] || { state: '0' }; - const stateObj33 = this.hass.states[config.entities.grid_sell_day_77] || { state: '0' }; + const stateObj33 = this.hass.states[config.entities.day_grid_export_77] || { state: '0' }; const stateObj34 = this.hass.states[config.entities.nonessential_power] || { state: '0' }; const stateObj35 = this.hass.states[config.entities.battery_current_191] || { state: '0' }; const stateObj36 = this.hass.states[config.entities.remaining_solar] || { state: '0' }; - const stateObj37 = this.hass.states[config.entities.battery_temp] || { state: '' }; - const stateObj38 = this.hass.states[config.entities.inverter_dc_temp] || { state: '' }; - const stateObj39 = this.hass.states[config.entities.inverter_ac_temp] || { state: '' }; + const stateObj37 = this.hass.states[config.entities.battery_temp_182] || { state: '' }; + const stateObj38 = this.hass.states[config.entities.dc_transformer_temp_90] || { state: '' }; + const stateObj39 = this.hass.states[config.entities.radiator_temp_91] || { state: '' }; const stateObj40 = this.hass.states[config.entities.non_essential_load1] || { state: '0' }; const stateObj41 = this.hass.states[config.entities.non_essential_load2] || { state: '0' }; const stateObj42 = this.hass.states[config.entities.essential_load1] || { state: '0' }; @@ -227,12 +227,12 @@ class SunsynkPowerFlowCard extends LitElement { //totalsolar = pv1_power_186 + pv2_power_187 + pv3_power_188 + pv4_power_189 let totalsolar = (parseInt(stateObj8.state || 0) + parseInt(stateObj9.state || 0) + parseInt(stateObj31.state || 0) + parseInt(stateObj32.state || 0)); - //essential = inverter_out_175 + inverter_load_grid_169 - aux_power_166 + //essential = inverter_power_175 + grid_power_169 - aux_power_166 let essential = (config?.entities.essential_power === 'none' || !config?.entities.essential_power) ? parseInt(stateObj22.state) + parseInt(stateObj23.state) - parseInt(stateObj24.state) : parseInt(stateObj14.state); - //nonessential = grid_external_power_172 - inverter_load_grid_169 + //nonessential = grid_ct_power_172 - grid_power_169 let nonessential = (config?.entities.nonessential_power === 'none' || !config?.entities.nonessential_power) ? parseInt(stateObj15.state) - parseInt(stateObj23.state) : parseInt(stateObj34.state); @@ -661,7 +661,7 @@ class SunsynkPowerFlowCard extends LitElement { - this.handlePopup(e, config.entities.grid_status_194)}> + this.handlePopup(e, config.entities.grid_connected_status_194)}> @@ -824,28 +824,28 @@ class SunsynkPowerFlowCard extends LitElement { - this.handlePopup(e, config.entities.solarday_108)}> + this.handlePopup(e, config.entities.day_pv_energy_108)}> ${parseFloat(stateObj4.state).toFixed(1) ? parseFloat(stateObj4.state).toFixed(1) : '0'} kWh - this.handlePopup(e, config.entities.solarday_108)}> + this.handlePopup(e, config.entities.day_pv_energy_108)}> ${parseFloat(stateObj4.state).toFixed(1) ? parseFloat(stateObj4.state).toFixed(1) : '0'} kWh / ${remaining_solar} kWh - this.handlePopup(e, config.entities.loadday_84)}> + this.handlePopup(e, config.entities.day_load_energy_84)}> ${parseFloat(stateObj2.state).toFixed(1) ? parseFloat(stateObj2.state).toFixed(1) : '0'} kWh - this.handlePopup(e, config.entities.loadday_84)}> + this.handlePopup(e, config.entities.day_load_energy_84)}> ${parseFloat(stateObj2.state).toFixed(1) ? parseFloat(stateObj2.state).toFixed(1) : '0'} kWh - this.handlePopup(e, config.entities.batchargeday_70)}> + this.handlePopup(e, config.entities.day_battery_charge_70)}> ${parseFloat(stateObj1.state).toFixed(1) ? parseFloat(stateObj1.state).toFixed(1) : '0'} kWh - this.handlePopup(e, config.entities.batdischargeday_71)}> + this.handlePopup(e, config.entities.day_battery_discharge_71)}> ${parseFloat(stateObj.state).toFixed(1) ? parseFloat(stateObj.state).toFixed(1) : '0'} kWh - this.handlePopup(e, config.entities.grid_buy_day_76)}> + this.handlePopup(e, config.entities.day_grid_import_76)}> ${parseFloat(stateObj3.state).toFixed(1) ? parseFloat(stateObj3.state).toFixed(1) : '0'} kWh - this.handlePopup(e, config.entities.grid_sell_day_77)}> + this.handlePopup(e, config.entities.day_grid_export_77)}> ${parseFloat(stateObj33.state).toFixed(1) ? parseFloat(stateObj33.state).toFixed(1) : '0'} kWh ${config.entities.essential_power !== 'none' @@ -858,8 +858,8 @@ class SunsynkPowerFlowCard extends LitElement { ${nonessential ? nonessential : '0'} W ` : svg`${nonessential ? nonessential : '0'} W `} - this.handlePopup(e, config.entities.grid_external_power_172)}> - ${grid_power ? grid_power : '0'} W + this.handlePopup(e, config.entities.grid_ct_power_172)}> + ${grid_power ? grid_power : '0'} W ${config.entities.aux_power_166 !== 'none' ? svg` this.handlePopup(e, config.entities.aux_power_166)}> @@ -886,14 +886,14 @@ class SunsynkPowerFlowCard extends LitElement { ${stateObj32.state ? stateObj32.state : '0'} W ` : svg`${stateObj32.state ? stateObj32.state : '0'} W`} - this.handlePopup(e, config.entities.inverter_grid_voltage_154)}> - ${stateObj5.state ? stateObj5.state : '0'} V + this.handlePopup(e, config.entities.inverter_voltage_154)}> + ${stateObj5.state ? stateObj5.state : '0'} V - this.handlePopup(e, config.entities.inverter_load_freq_192)}> - ${stateObj6.state ? stateObj6.state : '0'} Hz + this.handlePopup(e, config.entities.load_frequency_192)}> + ${stateObj6.state ? stateObj6.state : '0'} Hz - this.handlePopup(e, config.entities.inverter_out_164)}> - ${stateObj7.state ? stateObj7.state : '0'} A + this.handlePopup(e, config.entities.inverter_current_164)}> + ${stateObj7.state ? stateObj7.state : '0'} A this.handlePopup(e, config.entities.battery_voltage_183)}> ${stateObj11.state ? stateObj11.state : '0'} V @@ -904,50 +904,50 @@ class SunsynkPowerFlowCard extends LitElement { this.handlePopup(e, config.entities.battery_soc_184)}> | ${inverter_prog.capacity ? inverter_prog.capacity : '0'} % - this.handlePopup(e, config.entities.battery_out_190)}> - ${battery_power < '0' ? battery_power *-1 : battery_power} W + this.handlePopup(e, config.entities.battery_power_190)}> + ${battery_power < '0' ? battery_power *-1 : battery_power} W this.handlePopup(e, config.entities.battery_current_191)}> ${stateObj35.state ? stateObj35.state : '0'} A - this.handlePopup(e, config.entities.inverter_out_175)}> - ${stateObj22.state ? stateObj22.state : '0'} W + this.handlePopup(e, config.entities.inverter_power_175)}> + ${stateObj22.state ? stateObj22.state : '0'} W - this.handlePopup(e, config.entities.inverter_load_grid_169)}> - ${stateObj23.state ? stateObj23.state : '0'} W + this.handlePopup(e, config.entities.grid_power_169)}> + ${stateObj23.state ? stateObj23.state : '0'} W - this.handlePopup(e, config.entities.pv1_v_109)}> - ${stateObj16.state ? stateObj16.state : '0'} V + this.handlePopup(e, config.entities.pv1_voltage_109)}> + ${stateObj16.state ? stateObj16.state : '0'} V - this.handlePopup(e, config.entities.pv1_i_110)}> - ${stateObj17.state ? stateObj17.state : '0'} A + this.handlePopup(e, config.entities.pv1_current_110)}> + ${stateObj17.state ? stateObj17.state : '0'} A - this.handlePopup(e, config.entities.pv2_v_111)}> - ${stateObj18.state ? stateObj18.state : '0'} V + this.handlePopup(e, config.entities.pv2_voltage_111)}> + ${stateObj18.state ? stateObj18.state : '0'} V - this.handlePopup(e, config.entities.pv2_i_112)}> - ${stateObj19.state ? stateObj19.state : '0'} A + this.handlePopup(e, config.entities.pv2_current_112)}> + ${stateObj19.state ? stateObj19.state : '0'} A - this.handlePopup(e, config.entities.pv3_v_113)}> - ${stateObj27.state ? stateObj27.state : '0'} V + this.handlePopup(e, config.entities.pv3_voltage_113)}> + ${stateObj27.state ? stateObj27.state : '0'} V - this.handlePopup(e, config.entities.pv3_i_114)}> - ${stateObj28.state ? stateObj28.state : '0'} A + this.handlePopup(e, config.entities.pv3_current_114)}> + ${stateObj28.state ? stateObj28.state : '0'} A - this.handlePopup(e, config.entities.pv4_v_115)}> - ${stateObj29.state ? stateObj29.state : '0'} V + this.handlePopup(e, config.entities.pv4_voltage_115)}> + ${stateObj29.state ? stateObj29.state : '0'} V - this.handlePopup(e, config.entities.pv4_i_116)}> - ${stateObj30.state ? stateObj30.state : '0'} A + this.handlePopup(e, config.entities.pv4_current_116)}> + ${stateObj30.state ? stateObj30.state : '0'} A - this.handlePopup(e, config.entities.battery_temp)}> - ${stateObj37.state ? stateObj37.state : ''}° + this.handlePopup(e, config.entities.battery_temp_182)}> + ${stateObj37.state ? stateObj37.state : ''}° - this.handlePopup(e, config.entities.inverter_ac_temp)}> - AC: ${stateObj39.state ? stateObj39.state : ''}° + this.handlePopup(e, config.entities.radiator_temp_91)}> + AC: ${stateObj39.state ? stateObj39.state : ''}° - this.handlePopup(e, config.entities.inverter_dc_temp)}> - DC: ${stateObj38.state ? stateObj38.state : ''}° + this.handlePopup(e, config.entities.dc_transformer_temp_90)}> + DC: ${stateObj38.state ? stateObj38.state : ''}° this.handlePopup(e, config.entities.energy_cost)}> ${stateObj43.state ? stateObj43.state : ''} @@ -1125,7 +1125,7 @@ class SunsynkPowerFlowCard extends LitElement { - this.handlePopup(e, config.entities.grid_status_194)}> + this.handlePopup(e, config.entities.grid_connected_status_194)}> @@ -1152,35 +1152,35 @@ class SunsynkPowerFlowCard extends LitElement { - this.handlePopup(e, config.entities.batchargeday_70)}> + this.handlePopup(e, config.entities.day_battery_charge_70)}> ${parseFloat(stateObj1.state).toFixed(1) ? parseFloat(stateObj1.state).toFixed(1) : '0'} kWh - this.handlePopup(e, config.entities.solarday_108)}> + this.handlePopup(e, config.entities.day_pv_energy_108)}> ${parseFloat(stateObj4.state).toFixed(1) ? parseFloat(stateObj4.state).toFixed(1) : '0'} kWh - this.handlePopup(e, config.entities.solarday_108)}> + this.handlePopup(e, config.entities.day_pv_energy_108)}> ${parseFloat(stateObj4.state).toFixed(1) ? parseFloat(stateObj4.state).toFixed(1) : '0'} kWh / ${remaining_solar} kWh - this.handlePopup(e, config.entities.batdischargeday_71)}> + this.handlePopup(e, config.entities.day_battery_discharge_71)}> ${parseFloat(stateObj.state).toFixed(1) ? parseFloat(stateObj.state).toFixed(1) : '0'} kWh - this.handlePopup(e, config.entities.loadday_84)}> + this.handlePopup(e, config.entities.day_load_energy_84)}> ${parseFloat(stateObj2.state).toFixed(1) ? parseFloat(stateObj2.state).toFixed(1) : '0'} kWh - this.handlePopup(e, config.entities.grid_buy_day_76)}> + this.handlePopup(e, config.entities.day_grid_import_76)}> ${parseFloat(stateObj3.state).toFixed(1) ? parseFloat(stateObj3.state).toFixed(1) : '0'} kWh - this.handlePopup(e, config.entities.grid_sell_day_77)}> + this.handlePopup(e, config.entities.day_grid_export_77)}> ${parseFloat(stateObj33.state).toFixed(1) ? parseFloat(stateObj33.state).toFixed(1) : '0'} kWh - this.handlePopup(e, config.entities.inverter_grid_voltage_154)}> - ${stateObj5.state ? stateObj5.state : '0'} V + this.handlePopup(e, config.entities.inverter_voltage_154)}> + ${stateObj5.state ? stateObj5.state : '0'} V - this.handlePopup(e, config.entities.inverter_load_freq_192)}> - ${stateObj6.state ? stateObj6.state : '0'} Hz + this.handlePopup(e, config.entities.load_frequency_192)}> + ${stateObj6.state ? stateObj6.state : '0'} Hz - this.handlePopup(e, config.entities.inverter_out_164)}> - ${stateObj7.state ? stateObj7.state : '0'} A + this.handlePopup(e, config.entities.inverter_current_164)}> + ${stateObj7.state ? stateObj7.state : '0'} A this.handlePopup(e, config.entities.battery_voltage_183)}> ${stateObj11.state ? stateObj11.state : '0'} V @@ -1191,47 +1191,47 @@ class SunsynkPowerFlowCard extends LitElement { this.handlePopup(e, config.entities.battery_soc_184)}> | ${inverter_prog.capacity ? inverter_prog.capacity : '0'} % - this.handlePopup(e, config.entities.battery_out_190)}> - ${battery_power < '0' ? battery_power *-1 : battery_power} W + this.handlePopup(e, config.entities.battery_power_190)}> + ${battery_power < '0' ? battery_power *-1 : battery_power} W this.handlePopup(e, config.entities.battery_current_191)}> ${stateObj35.state ? stateObj35.state : '0'} A - this.handlePopup(e, config.entities.grid_external_power_172)}> - ${grid_power ? grid_power : '0'} W + this.handlePopup(e, config.entities.grid_ct_power_172)}> + ${grid_power ? grid_power : '0'} W - this.handlePopup(e, config.entities.pv1_v_109)}> - ${stateObj16.state ? stateObj16.state : '0'} V + this.handlePopup(e, config.entities.pv1_voltage_109)}> + ${stateObj16.state ? stateObj16.state : '0'} V - this.handlePopup(e, config.entities.pv1_i_110)}> - ${stateObj17.state ? stateObj17.state : '0'} A + this.handlePopup(e, config.entities.pv1_current_110)}> + ${stateObj17.state ? stateObj17.state : '0'} A - this.handlePopup(e, config.entities.pv2_v_111)}> - ${stateObj18.state ? stateObj18.state : '0'} V + this.handlePopup(e, config.entities.pv2_voltage_111)}> + ${stateObj18.state ? stateObj18.state : '0'} V - this.handlePopup(e, config.entities.pv2_i_112)}> - ${stateObj19.state ? stateObj19.state : '0'} A + this.handlePopup(e, config.entities.pv2_current_112)}> + ${stateObj19.state ? stateObj19.state : '0'} A - this.handlePopup(e, config.entities.pv3_v_113)}> - ${stateObj27.state ? stateObj27.state : '0'} V + this.handlePopup(e, config.entities.pv3_voltage_113)}> + ${stateObj27.state ? stateObj27.state : '0'} V - this.handlePopup(e, config.entities.pv3_i_114)}> - ${stateObj28.state ? stateObj28.state : '0'} A + this.handlePopup(e, config.entities.pv3_current_114)}> + ${stateObj28.state ? stateObj28.state : '0'} A - this.handlePopup(e, config.entities.pv4_v_115)}> - ${stateObj29.state ? stateObj29.state : '0'} V + this.handlePopup(e, config.entities.pv4_voltage_115)}> + ${stateObj29.state ? stateObj29.state : '0'} V - this.handlePopup(e, config.entities.pv4_i_116)}> - ${stateObj30.state ? stateObj30.state : '0'} A + this.handlePopup(e, config.entities.pv4_current_116)}> + ${stateObj30.state ? stateObj30.state : '0'} A - this.handlePopup(e, config.entities.battery_temp)}> - ${stateObj37.state ? stateObj37.state : ''}° + this.handlePopup(e, config.entities.battery_temp_182)}> + ${stateObj37.state ? stateObj37.state : ''}° - this.handlePopup(e, config.entities.inverter_ac_temp)}> - AC: ${stateObj39.state ? stateObj39.state : ''}° + this.handlePopup(e, config.entities.radiator_temp_91)}> + AC: ${stateObj39.state ? stateObj39.state : ''}° - this.handlePopup(e, config.entities.inverter_dc_temp)}> - DC: ${stateObj38.state ? stateObj38.state : ''}° + this.handlePopup(e, config.entities.dc_transformer_temp_90)}> + DC: ${stateObj38.state ? stateObj38.state : ''}° this.handlePopup(e, config.entities.energy_cost)}> ${stateObj43.state ? stateObj43.state : ''} @@ -1284,8 +1284,8 @@ class SunsynkPowerFlowCard extends LitElement { if (!config.battery.shutdown_soc) { throw new Error('Please include the battery shutdown_soc attribate and value e.g shutdown_soc: 20'); } - if (config.battery.show_daily === 'yes' && (!config.entities.batchargeday_70 || !config.entities.batdischargeday_71) ) { - throw Error('Please include the batchargeday_70 and batdischargeday_71 attributes and entity IDs'); + if (config.battery.show_daily === 'yes' && (!config.entities.day_battery_charge_70 || !config.entities.day_battery_discharge_71) ) { + throw Error('Please include the day_battery_charge_70 and day_battery_discharge_71 attributes and entity IDs'); } } if (config.show_solar === 'yes' && !config.solar ) { @@ -1294,18 +1294,18 @@ class SunsynkPowerFlowCard extends LitElement { if (config.show_solar === 'yes' && !config.solar.mppts) { throw Error('Please include the solar mppts attribute and value; one,two,three or four e.g. mppts: two'); } - if (config && config.solar && config.show_solar === 'yes' && config.solar.show_daily === 'yes' && !config.entities.solarday_108 ) { - throw Error('Please include the solarday_108 attribute and entity ID'); + if (config && config.solar && config.show_solar === 'yes' && config.solar.show_daily === 'yes' && !config.entities.day_pv_energy_108 ) { + throw Error('Please include the day_pv_energy_108 attribute and entity ID'); } } - if ((config && config.grid && config.grid.show_daily_buy === 'yes' && !config.entities.grid_buy_day_76) || (config && config.grid && config.grid.show_daily_sell === 'yes' && !config.entities.grid_sell_day_77) ) { - throw Error('Please include the grid_buy_day_76 and grid_sell_day_77 attributes and entity IDs'); + if ((config && config.grid && config.grid.show_daily_buy === 'yes' && !config.entities.day_grid_import_76) || (config && config.grid && config.grid.show_daily_sell === 'yes' && !config.entities.day_grid_export_77) ) { + throw Error('Please include the day_grid_import_76 and day_grid_export_77 attributes and entity IDs'); } const all_attributes = [ - 'inverter_grid_voltage_154', 'inverter_load_freq_192', 'inverter_out_164', 'inverter_out_175', 'inverter_load_grid_169', - 'battery_voltage_183', 'battery_soc_184', 'battery_out_190', 'battery_current_191', 'grid_external_power_172', 'grid_status_194', 'inverter_status_59' + 'inverter_voltage_154', 'load_frequency_192', 'inverter_current_164', 'inverter_power_175', 'grid_power_169', + 'battery_voltage_183', 'battery_soc_184', 'battery_power_190', 'battery_current_191', 'grid_ct_power_172', 'grid_connected_status_194', 'inverter_status_59' ]; for (const attr of all_attributes) {