{"id":462,"date":"2026-09-12T10:20:00","date_gmt":"2026-09-12T08:20:00","guid":{"rendered":"https:\/\/www.lukaswojcik.com\/?p=462"},"modified":"2026-10-26T11:13:16","modified_gmt":"2026-10-26T10:13:16","slug":"automating-solar-energy-in-home-assistant-dynamic-surplus-charging","status":"publish","type":"post","link":"https:\/\/www.lukaswojcik.com\/blog\/en\/smart-home\/tutorials-en-smart-home\/automating-solar-energy-in-home-assistant-dynamic-surplus-charging\/","title":{"rendered":"Automating Solar Energy in Home Assistant: Dynamic Surplus Charging"},"content":{"rendered":"<p>Surplus charging starts or increases a suitable device\u2019s charging when photovoltaic production leaves power available. Home Assistant can combine meter readings, device status and charging commands. The achievable savings depend on tariffs, losses and demand; a high self-consumption percentage alone does not establish profitability. This guide separates a measurement example from the additional control logic required for actual charging.<\/p>\n<h2>1. The balance at the grid connection<\/h2>\n<p>A grid meter records the remaining import or export after household loads and any active battery charging. Positive export does not prove that all exported electricity came from solar panels: battery discharge or another generator can also contribute. The sign convention and measurement location therefore need explicit documentation.<\/p>\n<p>The example below expects two non-negative, current power readings in watts from the same grid connection: export and import. Both readings need comparable timestamps. Watts describe power at that moment; kilowatt-hours record energy over time. Cumulative kWh counters are unsuitable. With an existing signed power sensor, a documented sign conversion is sufficient; subtracting import again would count the same flow twice.<\/p>\n<figure class=\"lw-diagram\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.lukaswojcik.com\/blog\/wp-content\/uploads\/diagrams\/dia-462-solar-20261024.png\" width=\"1120\" height=\"580\" alt=\"Grid balance, measurement quality and control loop\"><figcaption>Export can exist below a start threshold. Measurement, permission and regulation are separate steps.<\/figcaption><\/figure>\n<h2>2. A signed template sensor<\/h2>\n<p>This <code>configuration.yaml<\/code> example preserves negative values for grid import. Clamping import to zero would hide information required for reducing a load. Entity names are placeholders; the resulting entity ID also needs verification in Home Assistant.<\/p>\n<figure style=\"--cbb-digits:2\" class=\"cbb cbb--wrap cbb--numbers wp-block-code-beautifier-block-code\" data-lang=\"yaml\"><figcaption class=\"cbb-head\"><span class=\"cbb-lang\">YAML<\/span><span class=\"cbb-actions\"><button type=\"button\" class=\"cbb-button cbb-button--wrap\" data-cbb-action=\"wrap\" aria-pressed=\"true\" title=\"Wrap long lines\"><svg aria-hidden=\"true\" focusable=\"false\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\"><path d=\"M2 4h12M2 8h9.5a2.5 2.5 0 0 1 0 5H8m0 0 1.5-1.5M8 13l1.5 1.5M2 12h3\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"\/><\/svg><span class=\"cbb-sr\">Wrap long lines<\/span><\/button><button type=\"button\" class=\"cbb-button cbb-button--copy\" data-cbb-action=\"copy\" data-cbb-done=\"Copied\" data-cbb-failed=\"Press Ctrl+C to copy\"><svg aria-hidden=\"true\" focusable=\"false\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\"><rect x=\"5.5\" y=\"5.5\" width=\"8\" height=\"8.5\" rx=\"1.5\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\"\/><path d=\"M10.5 3.5V3A1.5 1.5 0 0 0 9 1.5H4A1.5 1.5 0 0 0 2.5 3v6.5A1.5 1.5 0 0 0 4 11h.5\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\"\/><\/svg><span class=\"cbb-button-label\" aria-live=\"polite\">Copy<\/span><\/button><\/span><\/figcaption><pre class=\"cbb-pre\" tabindex=\"0\"><code class=\"cbb-code language-yaml\" style=\"counter-reset:cbb-line 0;\"><span class=\"cbb-line\"><span class=\"cbb-attr\">template<\/span>:\n<\/span><span class=\"cbb-line\">  <span class=\"cbb-operator\">-<\/span> <span class=\"cbb-attr\">sensor<\/span>:\n<\/span><span class=\"cbb-line\">      <span class=\"cbb-operator\">-<\/span> <span class=\"cbb-attr\">name<\/span>: <span class=\"cbb-string\">\"Grid Export Balance\"<\/span>\n<\/span><span class=\"cbb-line\">        <span class=\"cbb-attr\">unique_id<\/span>: <span class=\"cbb-string\">\"grid_export_balance_example\"<\/span>\n<\/span><span class=\"cbb-line\">        <span class=\"cbb-attr\">unit_of_measurement<\/span>: <span class=\"cbb-string\">\"W\"<\/span>\n<\/span><span class=\"cbb-line\">        <span class=\"cbb-attr\">device_class<\/span>: power\n<\/span><span class=\"cbb-line\">        <span class=\"cbb-attr\">state_class<\/span>: measurement\n<\/span><span class=\"cbb-line\">        <span class=\"cbb-attr\">availability<\/span>: <span class=\"cbb-meta\">&gt;<\/span>\n<\/span><span class=\"cbb-line\">          {% set e = states(<span class=\"cbb-string\">'sensor.grid_meter_export_power'<\/span>) %}\n<\/span><span class=\"cbb-line\">          {% set i = states(<span class=\"cbb-string\">'sensor.grid_meter_import_power'<\/span>) %}\n<\/span><span class=\"cbb-line\">          <span class=\"cbb-variable\">{{ is_number(e) and is_number(i)<\/span>\n<\/span><span class=\"cbb-line\"><span class=\"cbb-variable\">             and e | float(0) &gt;= 0 and i | float(0) &gt;= 0 }}<\/span>\n<\/span><span class=\"cbb-line\">        <span class=\"cbb-attr\">state<\/span>: <span class=\"cbb-meta\">&gt;<\/span>\n<\/span><span class=\"cbb-line\">          <span class=\"cbb-variable\">{{ (states('sensor.grid_meter_export_power') | float(0)<\/span>\n<\/span><span class=\"cbb-line\"><span class=\"cbb-variable\">              - states('sensor.grid_meter_import_power') | float(0)) | round(0) }}<\/span><\/span><\/code><\/pre><\/figure>\n<p><code>availability<\/code> rejects missing, non-numeric and negative input readings. The fallback conversions do not make invalid readings valid. Numeric values can still be stale: device availability and a reliable reporting heartbeat require separate monitoring. An unchanged value is not automatically stale. The template performs subtraction and rounding, with no low-pass filter.<\/p>\n<p>Filtering, hysteresis and delays serve different purposes. A low-pass filter or moving average smooths measurements but adds delay. Hysteresis uses different start and stop thresholds; a minimum duration postpones switching. None of these mechanisms guarantees zero grid import during a sudden load change.<\/p>\n<h2>3. Threshold observation before hardware control<\/h2>\n<p>The following YAML belongs in the YAML editor of a single automation. It creates a notification after the measured balance crosses above 1,500 W and remains there for five minutes. It sends no charging command and is not a dynamic controller.<\/p>\n<figure style=\"--cbb-digits:2\" class=\"cbb cbb--wrap cbb--numbers wp-block-code-beautifier-block-code\" data-lang=\"yaml\"><figcaption class=\"cbb-head\"><span class=\"cbb-lang\">YAML<\/span><span class=\"cbb-actions\"><button type=\"button\" class=\"cbb-button cbb-button--wrap\" data-cbb-action=\"wrap\" aria-pressed=\"true\" title=\"Wrap long lines\"><svg aria-hidden=\"true\" focusable=\"false\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\"><path d=\"M2 4h12M2 8h9.5a2.5 2.5 0 0 1 0 5H8m0 0 1.5-1.5M8 13l1.5 1.5M2 12h3\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"\/><\/svg><span class=\"cbb-sr\">Wrap long lines<\/span><\/button><button type=\"button\" class=\"cbb-button cbb-button--copy\" data-cbb-action=\"copy\" data-cbb-done=\"Copied\" data-cbb-failed=\"Press Ctrl+C to copy\"><svg aria-hidden=\"true\" focusable=\"false\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\"><rect x=\"5.5\" y=\"5.5\" width=\"8\" height=\"8.5\" rx=\"1.5\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\"\/><path d=\"M10.5 3.5V3A1.5 1.5 0 0 0 9 1.5H4A1.5 1.5 0 0 0 2.5 3v6.5A1.5 1.5 0 0 0 4 11h.5\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\"\/><\/svg><span class=\"cbb-button-label\" aria-live=\"polite\">Copy<\/span><\/button><\/span><\/figcaption><pre class=\"cbb-pre\" tabindex=\"0\"><code class=\"cbb-code language-yaml\" style=\"counter-reset:cbb-line 0;\"><span class=\"cbb-line\"><span class=\"cbb-attr\">alias<\/span>: <span class=\"cbb-string\">\"Solar surplus diagnostic\"<\/span>\n<\/span><span class=\"cbb-line\"><span class=\"cbb-attr\">triggers<\/span>:\n<\/span><span class=\"cbb-line\">  <span class=\"cbb-operator\">-<\/span> <span class=\"cbb-attr\">trigger<\/span>: numeric_state\n<\/span><span class=\"cbb-line\">    <span class=\"cbb-attr\">entity_id<\/span>: sensor.grid_export_balance\n<\/span><span class=\"cbb-line\">    <span class=\"cbb-attr\">above<\/span>: <span class=\"cbb-number\">1500<\/span>\n<\/span><span class=\"cbb-line\">    <span class=\"cbb-attr\">for<\/span>:\n<\/span><span class=\"cbb-line\">      <span class=\"cbb-attr\">minutes<\/span>: <span class=\"cbb-number\">5<\/span>\n<\/span><span class=\"cbb-line\"><span class=\"cbb-attr\">actions<\/span>:\n<\/span><span class=\"cbb-line\">  <span class=\"cbb-operator\">-<\/span> <span class=\"cbb-attr\">action<\/span>: persistent_notification.create\n<\/span><span class=\"cbb-line\">    <span class=\"cbb-attr\">data<\/span>:\n<\/span><span class=\"cbb-line\">      <span class=\"cbb-attr\">notification_id<\/span>: solar_surplus_diagnostic\n<\/span><span class=\"cbb-line\">      <span class=\"cbb-attr\">title<\/span>: <span class=\"cbb-string\">\"Solar surplus diagnostic\"<\/span>\n<\/span><span class=\"cbb-line\">      <span class=\"cbb-attr\">message<\/span>: <span class=\"cbb-string\">\"Grid export balance above 1500 W for five minutes. No charging command sent.\"<\/span>\n<\/span><span class=\"cbb-line\"><span class=\"cbb-attr\">mode<\/span>: single<\/span><\/code><\/pre><\/figure>\n<p>A numeric-state trigger reacts to entry into a range, not continuously while a value remains in that range. The notification remains a historical message, not a live charging permission. A Home Assistant restart or automation reload resets a pending <code>for<\/code> period. Persistent timing requires separate state handling.<\/p>\n<h2>4. The control loop for actual charging<\/h2>\n<p>A real controller needs repeated evaluation, current measurements, device readiness, an explicit stop path and a fallback for missing telemetry or failed commands. The update interval must match meter and device response times. A single coordinator should allocate capacity between battery, vehicle and heating; competing controllers can otherwise counteract each other. Battery-first is a policy choice, not a universal rule.<\/p>\n<p>AC means alternating current, as used on the household supply side. For one controllable AC load, a useful starting relationship is: target load power = current measured load power + signed grid export balance \u2212 desired export reserve. All terms must refer to the same AC boundary. For example, 2,000 W already consumed by the load plus 500 W exported, less a 100 W reserve, gives a provisional 2,400 W target. With 300 W imported instead, the provisional target is 1,600 W. Device limits, ramps, minimum operating power and stop rules still apply; this calculation is not a complete regulator.<\/p>\n<p>DC means direct current, as used on the battery side. A DC battery-current command cannot be obtained reliably from an arbitrary fixed 50 V. Actual voltage, conversion efficiency, inverter semantics and battery-management limits matter. A 40 A limit is 2 kW only at 50 V, and a 10% reserve cannot guarantee avoidance of imports. Heating equipment likewise needs its supported control interface and minimum run times.<\/p>\n<h2>Questions and answers<\/h2>\n<h3>Is 1,500 W enough for an EV charger?<\/h3>\n<p>At 230 V and 6 A, nominal single-phase power is 1,380 W; three phases require about 4,140 W. Actual limits depend on vehicle and charger. A threshold near 1,500 W offers little single-phase reserve and is insufficient for solar-only three-phase charging at that current. Phase switching requires explicit hardware support and a suitable switching procedure.<\/p>\n<h3>Does this guarantee 80\u201390% self-consumption?<\/h3>\n<p>No. Array size, demand, storage, season and charging availability determine the outcome. Evaluation should compare imported and exported energy, charging interruptions and costs over representative periods. Hardware protections and safe device behavior must remain effective when Home Assistant is unavailable.<\/p><div class=\"lw-quellen\"><h2>Sources<\/h2><ul><li><a href=\"https:\/\/www.home-assistant.io\/docs\/\" target=\"_blank\" rel=\"noopener noreferrer\">Home Assistant documentation<\/a><\/li><li><a href=\"https:\/\/www.home-assistant.io\/integrations\/template\/\" target=\"_blank\" rel=\"noopener noreferrer\">Template<\/a><\/li><li><a href=\"https:\/\/www.home-assistant.io\/docs\/automation\/trigger\/\" target=\"_blank\" rel=\"noopener noreferrer\">Automation triggers<\/a><\/li><li><a href=\"https:\/\/www.home-assistant.io\/integrations\/filter\/\" target=\"_blank\" rel=\"noopener noreferrer\">Filter<\/a><\/li><li><a href=\"https:\/\/www.home-assistant.io\/integrations\/persistent_notification\/\" target=\"_blank\" rel=\"noopener noreferrer\">Persistent Notification<\/a><\/li><li><a href=\"https:\/\/docs.evcc.io\/en\/features\/solar-charging\/\" target=\"_blank\" rel=\"noopener noreferrer\">evcc: Solar Surplus Charging<\/a><\/li><li><a href=\"https:\/\/www.home-assistant.io\/triggers\/numeric_state\/\" target=\"_blank\" rel=\"noopener noreferrer\">Numeric state crossed threshold<\/a><\/li><\/ul><\/div>","protected":false},"excerpt":{"rendered":"<p>Solar surplus charging with Home Assistant: measuring the grid balance, testing a notification threshold and defining the additional control logic needed for batteries and flexible loads.<\/p>\n","protected":false},"author":1,"featured_media":18846,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[92624],"tags":[91371,91365,91362,91626,91359,91219],"class_list":["post-462","post","type-post","status-publish","format-standard","hentry","category-tutorials-en-smart-home","tag-energy-management","tag-home-assistant","tag-photovoltaics","tag-smart-home-de","tag-solar-energy","tag-tutorial"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Automating Solar Energy in Home Assistant: Dynamic Surplus Charging | Lukas Wojcik<\/title>\n<meta name=\"description\" content=\"Use solar surplus in Home Assistant: sensor readings, template configuration and stepped control of batteries and appliances.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.lukaswojcik.com\/blog\/en\/smart-home\/tutorials-en-smart-home\/automating-solar-energy-in-home-assistant-dynamic-surplus-charging\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Automating Solar Energy in Home Assistant: Dynamic Surplus Charging | Lukas Wojcik\" \/>\n<meta property=\"og:description\" content=\"Use solar surplus in Home Assistant: sensor readings, template configuration and stepped control of batteries and appliances.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.lukaswojcik.com\/blog\/en\/smart-home\/tutorials-en-smart-home\/automating-solar-energy-in-home-assistant-dynamic-surplus-charging\/\" \/>\n<meta property=\"og:site_name\" content=\"Lukas Wojcik - Blog\" \/>\n<meta property=\"article:published_time\" content=\"2026-09-12T08:20:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-10-26T10:13:16+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.lukaswojcik.com\/blog\/wp-content\/uploads\/2026\/09\/hero-462-automating-solar-energy-in-home-assi-k.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Lukas Wojcik\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Lukas Wojcik\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/en\\\/smart-home\\\/tutorials-en-smart-home\\\/automating-solar-energy-in-home-assistant-dynamic-surplus-charging\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/en\\\/smart-home\\\/tutorials-en-smart-home\\\/automating-solar-energy-in-home-assistant-dynamic-surplus-charging\\\/\"},\"author\":{\"name\":\"Lukas Wojcik\",\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/#\\\/schema\\\/person\\\/895f7604f9b6b71aad9bba33af28d0f9\"},\"headline\":\"Automating Solar Energy in Home Assistant: Dynamic Surplus Charging\",\"datePublished\":\"2026-09-12T08:20:00+00:00\",\"dateModified\":\"2026-10-26T10:13:16+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/en\\\/smart-home\\\/tutorials-en-smart-home\\\/automating-solar-energy-in-home-assistant-dynamic-surplus-charging\\\/\"},\"wordCount\":759,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/#\\\/schema\\\/person\\\/895f7604f9b6b71aad9bba33af28d0f9\"},\"image\":{\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/en\\\/smart-home\\\/tutorials-en-smart-home\\\/automating-solar-energy-in-home-assistant-dynamic-surplus-charging\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/hero-462-automating-solar-energy-in-home-assi-k.png\",\"keywords\":[\"Energy Management\",\"Home Assistant\",\"Photovoltaics\",\"Smart Home\",\"Solar Energy\",\"Tutorial\"],\"articleSection\":[\"Tutorials\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/en\\\/smart-home\\\/tutorials-en-smart-home\\\/automating-solar-energy-in-home-assistant-dynamic-surplus-charging\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/en\\\/smart-home\\\/tutorials-en-smart-home\\\/automating-solar-energy-in-home-assistant-dynamic-surplus-charging\\\/\",\"url\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/en\\\/smart-home\\\/tutorials-en-smart-home\\\/automating-solar-energy-in-home-assistant-dynamic-surplus-charging\\\/\",\"name\":\"Automating Solar Energy in Home Assistant: Dynamic Surplus Charging | Lukas Wojcik\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/en\\\/smart-home\\\/tutorials-en-smart-home\\\/automating-solar-energy-in-home-assistant-dynamic-surplus-charging\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/en\\\/smart-home\\\/tutorials-en-smart-home\\\/automating-solar-energy-in-home-assistant-dynamic-surplus-charging\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/hero-462-automating-solar-energy-in-home-assi-k.png\",\"datePublished\":\"2026-09-12T08:20:00+00:00\",\"dateModified\":\"2026-10-26T10:13:16+00:00\",\"description\":\"Use solar surplus in Home Assistant: sensor readings, template configuration and stepped control of batteries and appliances.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/en\\\/smart-home\\\/tutorials-en-smart-home\\\/automating-solar-energy-in-home-assistant-dynamic-surplus-charging\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/en\\\/smart-home\\\/tutorials-en-smart-home\\\/automating-solar-energy-in-home-assistant-dynamic-surplus-charging\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/en\\\/smart-home\\\/tutorials-en-smart-home\\\/automating-solar-energy-in-home-assistant-dynamic-surplus-charging\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/hero-462-automating-solar-energy-in-home-assi-k.png\",\"contentUrl\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/hero-462-automating-solar-energy-in-home-assi-k.png\",\"width\":1200,\"height\":630,\"caption\":\"Automating Solar Energy in Home Assistant: Dynamic Surplus Charging\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/en\\\/smart-home\\\/tutorials-en-smart-home\\\/automating-solar-energy-in-home-assistant-dynamic-surplus-charging\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Automating Solar Energy in Home Assistant: Dynamic Surplus Charging\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/\",\"name\":\"Lukas Wojcik - Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/#\\\/schema\\\/person\\\/895f7604f9b6b71aad9bba33af28d0f9\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/#\\\/schema\\\/person\\\/895f7604f9b6b71aad9bba33af28d0f9\",\"name\":\"Lukas Wojcik\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/07\\\/lw-x2.jpg\",\"url\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/07\\\/lw-x2.jpg\",\"contentUrl\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/07\\\/lw-x2.jpg\",\"width\":424,\"height\":636,\"caption\":\"Lukas Wojcik\"},\"logo\":{\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/07\\\/lw-x2.jpg\"},\"sameAs\":[\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Automating Solar Energy in Home Assistant: Dynamic Surplus Charging | Lukas Wojcik","description":"Use solar surplus in Home Assistant: sensor readings, template configuration and stepped control of batteries and appliances.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.lukaswojcik.com\/blog\/en\/smart-home\/tutorials-en-smart-home\/automating-solar-energy-in-home-assistant-dynamic-surplus-charging\/","og_locale":"en_US","og_type":"article","og_title":"Automating Solar Energy in Home Assistant: Dynamic Surplus Charging | Lukas Wojcik","og_description":"Use solar surplus in Home Assistant: sensor readings, template configuration and stepped control of batteries and appliances.","og_url":"https:\/\/www.lukaswojcik.com\/blog\/en\/smart-home\/tutorials-en-smart-home\/automating-solar-energy-in-home-assistant-dynamic-surplus-charging\/","og_site_name":"Lukas Wojcik - Blog","article_published_time":"2026-09-12T08:20:00+00:00","article_modified_time":"2026-10-26T10:13:16+00:00","og_image":[{"width":1200,"height":630,"url":"https:\/\/www.lukaswojcik.com\/blog\/wp-content\/uploads\/2026\/09\/hero-462-automating-solar-energy-in-home-assi-k.png","type":"image\/png"}],"author":"Lukas Wojcik","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Lukas Wojcik","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.lukaswojcik.com\/blog\/en\/smart-home\/tutorials-en-smart-home\/automating-solar-energy-in-home-assistant-dynamic-surplus-charging\/#article","isPartOf":{"@id":"https:\/\/www.lukaswojcik.com\/blog\/en\/smart-home\/tutorials-en-smart-home\/automating-solar-energy-in-home-assistant-dynamic-surplus-charging\/"},"author":{"name":"Lukas Wojcik","@id":"https:\/\/www.lukaswojcik.com\/blog\/#\/schema\/person\/895f7604f9b6b71aad9bba33af28d0f9"},"headline":"Automating Solar Energy in Home Assistant: Dynamic Surplus Charging","datePublished":"2026-09-12T08:20:00+00:00","dateModified":"2026-10-26T10:13:16+00:00","mainEntityOfPage":{"@id":"https:\/\/www.lukaswojcik.com\/blog\/en\/smart-home\/tutorials-en-smart-home\/automating-solar-energy-in-home-assistant-dynamic-surplus-charging\/"},"wordCount":759,"commentCount":0,"publisher":{"@id":"https:\/\/www.lukaswojcik.com\/blog\/#\/schema\/person\/895f7604f9b6b71aad9bba33af28d0f9"},"image":{"@id":"https:\/\/www.lukaswojcik.com\/blog\/en\/smart-home\/tutorials-en-smart-home\/automating-solar-energy-in-home-assistant-dynamic-surplus-charging\/#primaryimage"},"thumbnailUrl":"https:\/\/www.lukaswojcik.com\/blog\/wp-content\/uploads\/2026\/09\/hero-462-automating-solar-energy-in-home-assi-k.png","keywords":["Energy Management","Home Assistant","Photovoltaics","Smart Home","Solar Energy","Tutorial"],"articleSection":["Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.lukaswojcik.com\/blog\/en\/smart-home\/tutorials-en-smart-home\/automating-solar-energy-in-home-assistant-dynamic-surplus-charging\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.lukaswojcik.com\/blog\/en\/smart-home\/tutorials-en-smart-home\/automating-solar-energy-in-home-assistant-dynamic-surplus-charging\/","url":"https:\/\/www.lukaswojcik.com\/blog\/en\/smart-home\/tutorials-en-smart-home\/automating-solar-energy-in-home-assistant-dynamic-surplus-charging\/","name":"Automating Solar Energy in Home Assistant: Dynamic Surplus Charging | Lukas Wojcik","isPartOf":{"@id":"https:\/\/www.lukaswojcik.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.lukaswojcik.com\/blog\/en\/smart-home\/tutorials-en-smart-home\/automating-solar-energy-in-home-assistant-dynamic-surplus-charging\/#primaryimage"},"image":{"@id":"https:\/\/www.lukaswojcik.com\/blog\/en\/smart-home\/tutorials-en-smart-home\/automating-solar-energy-in-home-assistant-dynamic-surplus-charging\/#primaryimage"},"thumbnailUrl":"https:\/\/www.lukaswojcik.com\/blog\/wp-content\/uploads\/2026\/09\/hero-462-automating-solar-energy-in-home-assi-k.png","datePublished":"2026-09-12T08:20:00+00:00","dateModified":"2026-10-26T10:13:16+00:00","description":"Use solar surplus in Home Assistant: sensor readings, template configuration and stepped control of batteries and appliances.","breadcrumb":{"@id":"https:\/\/www.lukaswojcik.com\/blog\/en\/smart-home\/tutorials-en-smart-home\/automating-solar-energy-in-home-assistant-dynamic-surplus-charging\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.lukaswojcik.com\/blog\/en\/smart-home\/tutorials-en-smart-home\/automating-solar-energy-in-home-assistant-dynamic-surplus-charging\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.lukaswojcik.com\/blog\/en\/smart-home\/tutorials-en-smart-home\/automating-solar-energy-in-home-assistant-dynamic-surplus-charging\/#primaryimage","url":"https:\/\/www.lukaswojcik.com\/blog\/wp-content\/uploads\/2026\/09\/hero-462-automating-solar-energy-in-home-assi-k.png","contentUrl":"https:\/\/www.lukaswojcik.com\/blog\/wp-content\/uploads\/2026\/09\/hero-462-automating-solar-energy-in-home-assi-k.png","width":1200,"height":630,"caption":"Automating Solar Energy in Home Assistant: Dynamic Surplus Charging"},{"@type":"BreadcrumbList","@id":"https:\/\/www.lukaswojcik.com\/blog\/en\/smart-home\/tutorials-en-smart-home\/automating-solar-energy-in-home-assistant-dynamic-surplus-charging\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.lukaswojcik.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Automating Solar Energy in Home Assistant: Dynamic Surplus Charging"}]},{"@type":"WebSite","@id":"https:\/\/www.lukaswojcik.com\/blog\/#website","url":"https:\/\/www.lukaswojcik.com\/blog\/","name":"Lukas Wojcik - Blog","description":"","publisher":{"@id":"https:\/\/www.lukaswojcik.com\/blog\/#\/schema\/person\/895f7604f9b6b71aad9bba33af28d0f9"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.lukaswojcik.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/www.lukaswojcik.com\/blog\/#\/schema\/person\/895f7604f9b6b71aad9bba33af28d0f9","name":"Lukas Wojcik","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.lukaswojcik.com\/blog\/wp-content\/uploads\/2026\/07\/lw-x2.jpg","url":"https:\/\/www.lukaswojcik.com\/blog\/wp-content\/uploads\/2026\/07\/lw-x2.jpg","contentUrl":"https:\/\/www.lukaswojcik.com\/blog\/wp-content\/uploads\/2026\/07\/lw-x2.jpg","width":424,"height":636,"caption":"Lukas Wojcik"},"logo":{"@id":"https:\/\/www.lukaswojcik.com\/blog\/wp-content\/uploads\/2026\/07\/lw-x2.jpg"},"sameAs":["https:\/\/www.lukaswojcik.com\/blog"]}]}},"_links":{"self":[{"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/posts\/462","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/comments?post=462"}],"version-history":[{"count":9,"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/posts\/462\/revisions"}],"predecessor-version":[{"id":26436,"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/posts\/462\/revisions\/26436"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/media\/18846"}],"wp:attachment":[{"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/media?parent=462"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/categories?post=462"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/tags?post=462"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}