Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/components/blocks/Status.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,11 @@
$: tiles = [
{ title: "elapsed", value: sec2time($elapsed)},
{ title: "delivered", value: $status_store.session_energy/1000, precision: 2, unit: $_("units.kwh") },
{ title: "current", value: $status_store.amp/1000, precision: 1, unit: $_("units.A") },
{ title: "current", value: $status_store.amp, precision: 1, unit: $_("units.A") },
{ title: "power", value: $status_store.power, unit: $_("units.W") },
{ title: "setpoint", value: $status_store.pilot, unit: $_("units.A") },
{ title: "selfprod", value: $status_store.charge_rate, unit: $_("units.A"), precision: 1, display: $config_store.divert_enabled },
//{ title: "available", value: $status_store.divert_available_current, unit: $_("units.A"), precision: 1, display: $config_store.divert_enabled },
{ title: "available", value: $status_store.divert_available_current, unit: $_("units.A"), precision: 1, display: $config_store.divert_enabled },
{ title: "shaper", value: $status_store.shaper_cur, unit: $_("units.A"), precision: 1, display: $config_store.current_shaper_enabled },
{ title: "battery", value: $status_store.battery_level, unit: "%", display: $status_store.battery_level?true:false},
{ title: "range", value: displayRange($status_store.battery_range), unit: $config_store.mqtt_vehicle_range_miles?$_("units.miles"):$_("units.km"), display: $status_store.battery_range?true:false},
Expand Down
91 changes: 63 additions & 28 deletions src/components/blocks/configuration/SelfProduction.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,11 @@
name: "Default",
desc: "Slowly decrease charge rate, using grid to compensate, but increase faster when energy is going back.",
id: 0,
divert_attack_smoothing_time: 20,
divert_attack_smoothing_time: 300,
divert_decay_smoothing_time: 600,
divert_min_charge_time: 600,
divert_PV_ratio: 1.1
divert_reserve_power_w: 200,
divert_hysteresis_power_w: 500
},
{
name: "No waste",
Expand All @@ -42,7 +43,8 @@
divert_attack_smoothing_time: 20,
divert_decay_smoothing_time: 600,
divert_min_charge_time: 600,
divert_PV_ratio: 0.5
divert_reserve_power_w: 50,
divert_hysteresis_power_w: 120
},
{
name: "No import",
Expand All @@ -51,15 +53,17 @@
divert_attack_smoothing_time: 300,
divert_decay_smoothing_time: 20,
divert_min_charge_time: 600,
divert_PV_ratio: 1.1
divert_reserve_power_w: 200,
divert_hysteresis_power_w: 600
},
{
name: "Custom",
id: 3,
divert_attack_smoothing_time: 20,
divert_attack_smoothing_time: 60,
divert_decay_smoothing_time: 600,
divert_min_charge_time: 600,
divert_PV_ratio: 1.1
divert_reserve_power_w: 200,
divert_hysteresis_power_w: 300
}
]

Expand All @@ -69,7 +73,8 @@
charge_mode: {val: "eco", input: undefined, status: "", req: false},
mqtt_solar: {val: "", input: undefined, status: "", req: false},
mqtt_grid_ie: {val: "", input: undefined, status: "", req: false},
divert_PV_ratio: {val: "", input: undefined, status: "", req: true},
divert_reserve_power_w: {val: "", input: undefined, status: "", req: true},
divert_hysteresis_power_w: {val: "", input: undefined, status: "", req: true},
divert_attack_smoothing_time: {val: "", input: undefined, status: "", req: true},
divert_decay_smoothing_time: {val: "", input: undefined, status: "", req: true},
divert_min_charge_time: {val: "", input: undefined, status: "", req: true}
Expand All @@ -81,7 +86,8 @@
formdata.charge_mode.val = $config_store.charge_mode
formdata.mqtt_solar.val = $config_store.mqtt_solar
formdata.mqtt_grid_ie.val = $config_store.mqtt_grid_ie
formdata.divert_PV_ratio.val = $config_store.divert_PV_ratio
formdata.divert_reserve_power_w.val = $config_store.divert_reserve_power_w
formdata.divert_hysteresis_power_w.val = $config_store.divert_hysteresis_power_w
formdata.divert_attack_smoothing_time.val = $config_store.divert_attack_smoothing_time
formdata.divert_decay_smoothing_time.val = $config_store.divert_decay_smoothing_time
formdata.divert_min_charge_time.val = $config_store.divert_min_charge_time
Expand Down Expand Up @@ -113,7 +119,8 @@
$config_store.divert_attack_smoothing_time = presets[id].divert_attack_smoothing_time
$config_store.divert_decay_smoothing_time = presets[id].divert_decay_smoothing_time
$config_store.divert_min_charge_time = presets[id].divert_min_charge_time
$config_store.divert_PV_ratio = presets[id].divert_PV_ratio
$config_store.divert_reserve_power_w = presets[id].divert_reserve_power_w
$config_store.divert_hysteresis_power_w = presets[id].divert_hysteresis_power_w
updateFormData()
preset = get_preset()
await submitFormData({form: formdata, prop_enable: "divert_enabled", i18n_path: "config.selfprod.missing-"})
Expand All @@ -127,7 +134,8 @@
if ($config_store.divert_attack_smoothing_time == presets[i].divert_attack_smoothing_time
&& $config_store.divert_decay_smoothing_time == presets[i].divert_decay_smoothing_time
&& $config_store.divert_min_charge_time == presets[i].divert_min_charge_time
&& $config_store.divert_PV_ratio == presets[i].divert_PV_ratio)
&& $config_store.divert_reserve_power_w == presets[i].divert_reserve_power_w
&& $config_store.divert_hysteresis_power_w == presets[i].divert_hysteresis_power_w)
ps = i
}
return ps
Expand Down Expand Up @@ -173,19 +181,30 @@
<div class:is-hidden={!$config_store.divert_enabled} class="mt-2 mb-0 ml-1 is-flex is-flex-direction-row is-justify-content-left is-align-items-center is-flex-wrap-wrap is-size-7 has-text-weight-bold">
<div class="mr-2 is-inline-block">
{#if $config_store.divert_type == 0}
<span>{$_("config.selfprod.production")}:</span>
<span class="has-text-primary">{$status_store.solar}{$_("units.W")}</span>

<span>{$_("config.selfprod.production")}:</span>
<span class="has-text-primary">{$status_store.solar}{$_("units.W")}</span>
<span>{$_("config.selfprod.available")}</span>
<span class="{$status_store.divert_available_current < 6 ? "has-text-danger":"has-text-primary"}">{round($status_store.divert_available_current,1)} A</span>

{:else if $config_store.divert_type == 1}
<span>{$_("config.selfprod.grid")}</span>
<span class="{$status_store.grid_ie < 0 ? "has-text-primary":"has-text-danger"}">{$status_store.grid_ie}W</span>

<span>{$_("config.selfprod.grid")}</span>
<span class="{$status_store.divert_grid_ie_w < 0 ? "has-text-primary":"has-text-danger"}">{$status_store.divert_grid_ie_w} W ({round($status_store.divert_grid_ie_a,1)} A)</span>

<span>{$_("config.selfprod.available")}</span>
<span class="{$status_store.divert_available_current < 6 ? "has-text-danger":"has-text-primary"}">{round($status_store.divert_available_current,1)} A</span>

<span>{$_("config.selfprod.trigger")}</span>
<span class="{$status_store.divert_trigger_current < 6 ? "has-text-danger":"has-text-primary"}">{round($status_store.divert_trigger_current,1)} A</span>


{/if}
<span>|</span>
<span class="{$status_store.charge_rate < 6?"has-text-danger":"has-text-primary"}">{$status_store.charge_rate}A</span>
</div>
{#if $status_store.divert_active}
<div class="mr-2 has-text-dark" class:is-hidden={!$status_store.smoothed_available_current}>
<div class="mr-2 has-text-dark" class:is-hidden={!$status_store.divert_smoothed_available_current}>
<span>{$_("status-divert-smoothed")}:</span>
<span class="has-text-info">{round($status_store.smoothed_available_current,1)}A</span>
<span class="has-text-info">{round($status_store.divert_smoothed_available_current,1)}A</span>
</div>
{:else}
<div class="mx-1">
Expand Down Expand Up @@ -240,7 +259,7 @@
<div class:is-hidden={$config_store.divert_type==0} class="mb-2">
<InputForm
title="{$_("config.selfprod.feed")}*"
placeholder="/topic/grid_ie"
placeholder="/topic/grid_ie_w"
bind:this={formdata.mqtt_grid_ie.input}
bind:value={formdata.mqtt_grid_ie.val}
bind:status={formdata.mqtt_grid_ie.status}
Expand Down Expand Up @@ -272,17 +291,33 @@
</div>
<div class="mb-2" >
<InputForm
title="{$_("config.selfprod.powerratio")}*"
title="{$_("config.selfprod.reserve_power")}*"
type="number"
placeholder="200"
step="50"
min="0"
bind:this={formdata.divert_reserve_power_w.input}
bind:value={formdata.divert_reserve_power_w.val}
bind:status={formdata.divert_reserve_power_w.status}
onChange={()=>setProperty("divert_reserve_power_w")}
/>
<div class="is-size-7 has-text-left">{$_("config.selfprod.reserve_power-desc")}</div>
</div>
<div class="mb-2" >
<InputForm
title="{$_("config.selfprod.hysteresis_power")}*"
type="number"
placeholder="1.1"
step="0.01"
bind:this={formdata.divert_PV_ratio.input}
bind:value={formdata.divert_PV_ratio.val}
bind:status={formdata.divert_PV_ratio.status}
onChange={()=>setProperty("divert_PV_ratio")}
placeholder="600"
step="50"
min="0"
bind:this={formdata.divert_hysteresis_power_w.input}
bind:value={formdata.divert_hysteresis_power_w.val}
bind:status={formdata.divert_hysteresis_power_w.status}
onChange={()=>setProperty("divert_hysteresis_power_w")}
/>
<div class="is-size-7 has-text-left">{$_("config.selfprod.powerratio-desc")}</div>
<div class="is-size-7 has-text-left">{$_("config.selfprod.hysteresis_power-desc")}</div>
</div>

<div class="mb-2">
<InputForm
title="{$_("config.selfprod.minchargetime")}*"
Expand Down Expand Up @@ -332,4 +367,4 @@
</div>

</Box>
{/if}
{/if}
19 changes: 12 additions & 7 deletions src/components/ui/DivertShaperStatus.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,26 @@
{#if $config_store.divert_type == 0}
<div class="mr-1 is-inline-block has-text-dark">
<span>{$_("status-divert-production")}:</span>
<span class="{$status_store.solar < 6?"has-text-danger":"has-text-primary"}">{$status_store.solar}W</span>
<span class="{$status_store.divert_solar_w < 1440?"has-text-danger":"has-text-primary"}">{$status_store.divert_solar_w}W</span>
<span>|</span>
<span class="{$status_store.solar < 6?"has-text-danger":"has-text-primary"}">{$status_store.charge_rate}A</span>
<span class="{$status_store.divert_solar_a < 6?"has-text-danger":"has-text-primary"}">{$status_store.divert_charge_current}A</span>
</div>

{:else if $config_store.divert_type == 1}
<div class="mr-1 has-text-dark">
<span>{$_("status-divert-grid")}:</span>
<span class="{$status_store.grid_ie < 0 ? "has-text-primary":"has-text-danger"}">{$status_store.grid_ie}W</span>
<span class="{$status_store.grid_ie < 6?"has-text-danger":"has-text-primary"}">{$status_store.charge_rate}A</span>
<span class="{$status_store.divert_grid_ie_w > 0 ? "has-text-danger":"has-text-primary"}">{$status_store.divert_grid_ie_w} W</span>
<span class="{$status_store.divert_grid_ie_a > 0 ? "has-text-danger":"has-text-primary"}">{round($status_store.divert_grid_ie_a,1)} A</span>
</div>
{/if}
<div class="mr-2 has-text-dark" class:is-hidden={!$status_store.smoothed_available_current}>

<div class="mr-1 has-text-dark" class:is-hidden={!$status_store.divert_available_current}>
<span>{$_("status-current-available")}:</span>
<span class="has-text-info">{round($status_store.divert_available_current,1)} A</span>
</div>
<div class="mr-1 has-text-dark" class:is-hidden={!$status_store.divert_smoothed_available_current}>
<span>{$_("status-divert-smoothed")}:</span>
<span class="has-text-info">{round($status_store.smoothed_available_current,1)}A</span>
<span class="has-text-info">{round($status_store.divert_smoothed_available_current,1)} A</span>
</div>
{#if !$status_store.divert_active}
<div class="mx-1">
Expand All @@ -49,4 +54,4 @@
{#if $status_store.shaper_updated == false}
<div class="is-size-7 mr-2 has-text-danger">{$_("status-shaper-error")}</div>
{/if}
{/if}
{/if}
22 changes: 14 additions & 8 deletions src/lib/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"status-tile-power": "power",
"status-tile-setpoint": "setpoint",
"status-tile-shaper": "Shaper",
"status-tile-selfprod": "Production",
"status-tile-available": "Available",
"status-tile-divert-available": "Production Avl",
"status-tile-battery": "battery",
"status-tile-range": "range",
Expand All @@ -92,9 +92,9 @@
"status-task-timer-activate": "Activate at",
"status-task-timer-disable": "Disable at",
"status-divert-production": "Production",
"status-divert-grid": "Grid +Import/-Export",
"status-current-available": "Available Current",
"status-divert-smoothed": "Smoothed Current",
"status-divert-grid": "Grid +import / -export",
"status-current-available": "Available current",
"status-divert-smoothed": "Smoothed avl. current",
"status-shaper-houseload": "House Load",
"status-shaper-error": "Shaper: Live Power Load data has not been updated in time, EVSE has been disabled",
"wizard-reload": "Quitting wizard. Seems we couldn't get the new ip adress. Redirecting to hostname. When pressing OK, it will redirect in few seconds to ",
Expand Down Expand Up @@ -394,6 +394,8 @@
"production": "Production",
"excess": "Export",
"grid": "Grid +Import/-Export",
"available": "Available current",
"trigger": "Trigger current",
"modeboost": "ECO mode disabled",
"disabled": "Charge Paused",
"smoothed": "Smoothed",
Expand All @@ -402,8 +404,11 @@
"feed": "Feed",
"feed-prod-desc": "Self Production MQTT topic (in W) to modulate charge rate based on production",
"feed-excess-desc": "Grid (+I/-E) MQTT topic to modulate charge rate based on excess power",
"powerratio": "Required PV power ratio",
"powerratio-desc": "The fraction of PV current that suffices to start charging or increment current",
"reserve_power": "divert reserve power",
"reserve_power-desc": "Power that will not be used for charging to avoid going into import",
"hysteresis_power": "divert hysteresis power",
"hysteresis_power-desc": "Additional power to reach above available - reserve_power to start charging",

"smoothattack": "Divert smoothing attack (sec)",
"smoothattack-desc": "The time constant value used for the input filter when increasing power (in sec). Value of 0 means no filtering",
"smoothdecay": "Divert smoothing decay (sec)",
Expand All @@ -415,7 +420,8 @@
"help-3": "If EVSE is sleeping: charging will begin when solar PV / excess power > min charge rate.",
"help-4": "Charging will pause if the excess power drops below the min charge rate for a period of time.",
"help-5": "Note: It's assumed that EVSE power is included in the grid feed",
"missing-divert_PV_ratio": "PV power ratio is missing",
"missing-divert_reserve_power_w": "Divert reserve power is missing",
"missing-divert_hysteresis_power_w": "Divert hysteresis power is missing",
"missing-divert_attack_smoothing_time": "Divert smoothing attack is missing",
"missing-divert_decay_smoothing_time": "Divert smoothing decay is missing",
"missing-divert_min_charge_time": "Minimum Charge Time is missing",
Expand Down Expand Up @@ -510,4 +516,4 @@
"missing-ocpp_idtag": "missing Id Tag"
}
}
}
}
12 changes: 8 additions & 4 deletions src/lib/i18n/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -402,8 +402,11 @@
"feed": "Feed",
"feed-prod-desc": "Tema MQTT de producción propia (en W) para modular la tasa de carga en función de la producción",
"feed-excess-desc": "Grid (+I/-E) Tema MQTT para modular la tasa de carga en función del exceso de potencia",
"powerratio": "Relación de potencia fotovoltaica requerida",
"powerratio-desc": "La fracción de corriente fotovoltaica que es suficiente para comenzar a cargar o incrementar la corriente",
"reserve_power": "divert reserve power",
"reserve_power-desc": "Power that will not be used for charging to avoid going into import",
"hysteresis_power": "divert hysteresis power",
"hysteresis_power-desc": "Additional power to reach above available - reserve_power to start charging",

"smoothattack": "Divert smoothing attack (seg)",
"smoothattack-desc": "El valor de la constante de tiempo utilizado para el filtro de entrada al aumentar la potencia (en segundos). El valor de 0 significa que no hay filtrado",
"smoothdecay": "Divert smoothing decay (seg)",
Expand All @@ -415,7 +418,8 @@
"help-3": "Si EVSE está inactivo: la carga comenzará cuando la energía solar fotovoltaica/exceso de energía > tasa de carga mínima.",
"help-4": "La carga se detendrá si el exceso de energía cae por debajo de la tasa de carga mínima durante un período de tiempo.",
"help-5": "Nota: La energía EVSE está incluida en la alimentación de la red.",
"missing-divert_PV_ratio": "Falta la relación de potencia fotovoltaica",
"missing-divert_reserve_power_w": "Falta la reserva de potencia de diversión",
"missing-divert_hysteresis_power_w": "Falta la potencia de hysteresis de diversión",
"missing-divert_attack_smoothing_time": "Falta divert smoothing attack",
"missing-divert_decay_smoothing_time": "Falta divert smoothing decay",
"missing-divert_min_charge_time": "Falta el tiempo mínimo de carga",
Expand Down Expand Up @@ -510,4 +514,4 @@
"missing-ocpp_idtag": "falta ID-tag"
}
}
}
}
12 changes: 8 additions & 4 deletions src/lib/i18n/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -401,8 +401,10 @@
"feed": "Sujet MQTT",
"feed-prod-desc": "Sujet MQTT Auto production (en W) pour moduler la charge en fonction de la production",
"feed-excess-desc": "Sujet MQTT +Import/-Export pour moduler la charge en fonction de l'excès de puissance",
"powerratio": "Ratio de puissance PV requise",
"powerratio-desc": "Ratio de courant PV suffisant pour démarrer la charge ou augmenter le courant.",
"reserve_power": "divert reserve power",
"reserve_power-desc": "Power that will not be used for charging to avoid going into import",
"hysteresis_power": "divert hysteresis power",
"hysteresis_power-desc": "Additional power to reach above available - reserve_power to start charging",
"smoothattack": "Filtrage augmentation puissance (sec)",
"smoothattack-desc": "Constante de temps du filtre pour l'augmentation de la puissance. Une valeur 0 désactive le filtre",
"smoothdecay": "Filtrage diminution de la puissance (sec)",
Expand All @@ -414,7 +416,9 @@
"help-3": "Si l'EVSE est en pause: la charge débutera quand la production Solaire ou l'excédent de puissance > puissance de charge minimale (min charge rate)",
"help-4": "La charge se mettra en pause si l'excédent de puissance tombe sous la puissance de charge minimale.",
"help-5": "Note: La puissance consommée par l'EVSE est inclue dans le flux d'excédent/déficit",
"missing-divert_PV_ratio": "Ratio de puissance PV manquant",
"missing-divert_reserve_power_w": "Divert reserve power is missing",
"missing-divert_hysteresis_power_w": "Divert hysteresis power is missing",

"missing-divert_attack_smoothing_time": "Lissage augmentation de la puissance manquant",
"missing-divert_decay_smoothing_time": "Lissage diminution de la puissance manquant",
"missing-divert_min_charge_time": "Temps de charge minimum manquant",
Expand Down Expand Up @@ -508,4 +512,4 @@
"missing-ocpp_idtag": "Tag ID manquant"
}
}
}
}