<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>MQTT API on GbbOptimizer — Manual</title><link>https://krzysztofhajdamowicz.github.io/rewrite-GbbOptimizer-manual/en/mqtt-api/</link><description>Recent content in MQTT API on GbbOptimizer — Manual</description><generator>Hugo</generator><language>en</language><atom:link href="https://krzysztofhajdamowicz.github.io/rewrite-GbbOptimizer-manual/en/mqtt-api/index.xml" rel="self" type="application/rss+xml"/><item><title>Signals</title><link>https://krzysztofhajdamowicz.github.io/rewrite-GbbOptimizer-manual/en/mqtt-api/signals/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://krzysztofhajdamowicz.github.io/rewrite-GbbOptimizer-manual/en/mqtt-api/signals/</guid><description>&lt;h1 id="mqtt-signals"&gt;MQTT Signals&lt;a class="anchor" href="#mqtt-signals"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;GbbOptimizer sends signals to external programs (e.g. Home Assistant) every hour, based on the forecast for the current hour.&lt;/p&gt;
&lt;p&gt;MQTT connection parameters (address, port, TLS, ClientID) — see &lt;a href="https://krzysztofhajdamowicz.github.io/rewrite-GbbOptimizer-manual/en/mqtt-api/request-response/"&gt;Request / Response&lt;/a&gt;.&lt;/p&gt;
&lt;blockquote class='book-hint note'&gt;
&lt;ul&gt;
&lt;li&gt;Signals must first be enabled in the &lt;a href="https://krzysztofhajdamowicz.github.io/rewrite-GbbOptimizer-manual/en/configuration/discharging/"&gt;Discharge&lt;/a&gt; module&lt;/li&gt;
&lt;li&gt;A given signal is not sent if the &amp;ldquo;X&amp;rdquo; parameter is not defined (field empty)&lt;/li&gt;
&lt;/ul&gt;&lt;/blockquote&gt;&lt;h2 id="binary-signals"&gt;Binary Signals&lt;a class="anchor" href="#binary-signals"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;External programs can subscribe to the following topics:&lt;/p&gt;
&lt;div class="mqtt-topic-card mqtt-direction--publish"&gt;
 &lt;div class="mqtt-topic-header"&gt;
 &lt;span class="mqtt-badge mqtt-direction--publish"&gt;PUB&lt;/span&gt;
 &lt;code class="mqtt-topic-path"&gt;{PlantId}/signals/SOCHigherEqThanX&lt;/code&gt;&lt;span class="mqtt-badge mqtt-qos"&gt;QoS 0&lt;/span&gt;&lt;/div&gt;
 &lt;p class="mqtt-topic-description"&gt;&amp;#34;1&amp;#34; if SOC ≥ X, otherwise &amp;#34;0&amp;#34;&lt;/p&gt;</description></item><item><title>Request / Response</title><link>https://krzysztofhajdamowicz.github.io/rewrite-GbbOptimizer-manual/en/mqtt-api/request-response/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://krzysztofhajdamowicz.github.io/rewrite-GbbOptimizer-manual/en/mqtt-api/request-response/</guid><description>&lt;h1 id="mqtt-request-and-response"&gt;MQTT Request and Response&lt;a class="anchor" href="#mqtt-request-and-response"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;GbbOptimizer supports request/response queries over MQTT. An external program sends a request and GbbOptimizer replies with data.&lt;/p&gt;
&lt;h2 id="connection"&gt;Connection&lt;a class="anchor" href="#connection"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The external program should connect to MQTT with the following parameters:&lt;/p&gt;
&lt;table&gt;
 &lt;thead&gt;
 &lt;tr&gt;
 &lt;th&gt;Parameter&lt;/th&gt;
 &lt;th&gt;Value&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
 &lt;td&gt;Address&lt;/td&gt;
 &lt;td&gt;See &lt;a href="https://krzysztofhajdamowicz.github.io/rewrite-GbbOptimizer-manual/en/references/mqtt-servers/"&gt;MQTT servers&lt;/a&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;Port&lt;/td&gt;
 &lt;td&gt;8883&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;Username&lt;/td&gt;
 &lt;td&gt;&lt;code&gt;{PlantId}&lt;/code&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;Password&lt;/td&gt;
 &lt;td&gt;&lt;code&gt;{PlantToken}&lt;/code&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;UseTLS&lt;/td&gt;
 &lt;td&gt;true&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;ClientID&lt;/td&gt;
 &lt;td&gt;must end with &lt;code&gt;_{PlantId}&lt;/code&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 id="topics"&gt;Topics&lt;a class="anchor" href="#topics"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;table&gt;
 &lt;thead&gt;
 &lt;tr&gt;
 &lt;th&gt;Direction&lt;/th&gt;
 &lt;th&gt;Topic&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
 &lt;td&gt;Request →&lt;/td&gt;
 &lt;td&gt;&lt;code&gt;{PlantId}/ha_gbb/dataserver/serverrequest&lt;/code&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;← Response&lt;/td&gt;
 &lt;td&gt;&lt;code&gt;{PlantId}/ha_gbb/dataserver/serverresponse&lt;/code&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;
&lt;blockquote class='book-hint note'&gt;
&lt;p&gt;For backward compatibility the program also handles &lt;code&gt;{PlantId}/dataserver/serverrequest&lt;/code&gt; and &lt;code&gt;{PlantId}/dataserver/serverresponse&lt;/code&gt; (not recommended).&lt;/p&gt;</description></item><item><title>Data Commands</title><link>https://krzysztofhajdamowicz.github.io/rewrite-GbbOptimizer-manual/en/mqtt-api/data-commands/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://krzysztofhajdamowicz.github.io/rewrite-GbbOptimizer-manual/en/mqtt-api/data-commands/</guid><description>&lt;h1 id="mqtt-data-commands"&gt;MQTT Data Commands&lt;a class="anchor" href="#mqtt-data-commands"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;Commands that allow external programs to modify data in GbbOptimizer. Each command sends data to a dedicated topic and receives a result on &lt;code&gt;{PlantId}/ha_gbb/api/result&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id="command-result"&gt;Command Result&lt;a class="anchor" href="#command-result"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;div class="mqtt-topic-card mqtt-direction--publish"&gt;
 &lt;div class="mqtt-topic-header"&gt;
 &lt;span class="mqtt-badge mqtt-direction--publish"&gt;PUB&lt;/span&gt;
 &lt;code class="mqtt-topic-path"&gt;{PlantId}/ha_gbb/api/result&lt;/code&gt;&lt;/div&gt;
 &lt;p class="mqtt-topic-description"&gt;Result of each data command — OK or error description&lt;/p&gt;&lt;/div&gt;

&lt;table&gt;
 &lt;thead&gt;
 &lt;tr&gt;
 &lt;th&gt;Field&lt;/th&gt;
 &lt;th&gt;Type&lt;/th&gt;
 &lt;th&gt;Description&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;OrderId&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;string?&lt;/td&gt;
 &lt;td&gt;Copied from the request&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;Result&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;string&lt;/td&gt;
 &lt;td&gt;&lt;code&gt;&amp;quot;OK&amp;quot;&lt;/code&gt; or error description&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;Data&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;object&lt;/td&gt;
 &lt;td&gt;Data from the original request&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;
&lt;hr&gt;
&lt;details class="mqtt-endpoint" id="endpoint-setmanualprices"&gt;
 &lt;summary class="mqtt-endpoint-summary"&gt;&lt;span class="mqtt-badge mqtt-direction--subscribe"&gt;SUB&lt;/span&gt;&lt;span class="mqtt-endpoint-name"&gt;SetManualPrices&lt;/span&gt;
 &lt;span class="mqtt-endpoint-description"&gt;Set manual energy prices&lt;/span&gt;&lt;/summary&gt;
 &lt;div class="mqtt-endpoint-body"&gt;
 &lt;div class="mqtt-topic-row"&gt;&lt;span class="mqtt-badge mqtt-direction--subscribe"&gt;SUB&lt;/span&gt;&lt;code class="mqtt-topic-path"&gt;{PlantId}/ha_gbb/api/setmanualprices&lt;/code&gt;
 &lt;/div&gt;&lt;div class="mqtt-endpoint-content"&gt;
 &lt;table&gt;
 &lt;thead&gt;
 &lt;tr&gt;
 &lt;th&gt;Field&lt;/th&gt;
 &lt;th&gt;&lt;/th&gt;
 &lt;th&gt;Type&lt;/th&gt;
 &lt;th&gt;Required&lt;/th&gt;
 &lt;th&gt;Description&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;OrderId&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;&lt;/td&gt;
 &lt;td&gt;string&lt;/td&gt;
 &lt;td&gt;no&lt;/td&gt;
 &lt;td&gt;Text copied to the response&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;Data&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;&lt;/td&gt;
 &lt;td&gt;array&lt;/td&gt;
 &lt;td&gt;yes&lt;/td&gt;
 &lt;td&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;/td&gt;
 &lt;td&gt;&lt;code&gt;Date&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;date&lt;/td&gt;
 &lt;td&gt;yes&lt;/td&gt;
 &lt;td&gt;Price date&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;/td&gt;
 &lt;td&gt;&lt;code&gt;StartHour&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;int (0-23)&lt;/td&gt;
 &lt;td&gt;yes&lt;/td&gt;
 &lt;td&gt;Start hour&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;/td&gt;
 &lt;td&gt;&lt;code&gt;StartMinute&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;int (0-59)&lt;/td&gt;
 &lt;td&gt;no&lt;/td&gt;
 &lt;td&gt;Minute (default 0)&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;/td&gt;
 &lt;td&gt;&lt;code&gt;PurchasePrice&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;decimal&lt;/td&gt;
 &lt;td&gt;no&lt;/td&gt;
 &lt;td&gt;Purchase price&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;/td&gt;
 &lt;td&gt;&lt;code&gt;TransferPrice&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;decimal&lt;/td&gt;
 &lt;td&gt;no&lt;/td&gt;
 &lt;td&gt;Transfer price&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;/td&gt;
 &lt;td&gt;&lt;code&gt;SalePrice&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;decimal&lt;/td&gt;
 &lt;td&gt;no&lt;/td&gt;
 &lt;td&gt;Sale price&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Home Assistant Topics</title><link>https://krzysztofhajdamowicz.github.io/rewrite-GbbOptimizer-manual/en/mqtt-api/ha-topics/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://krzysztofhajdamowicz.github.io/rewrite-GbbOptimizer-manual/en/mqtt-api/ha-topics/</guid><description>&lt;h1 id="mqtt-topics-for-home-assistant"&gt;MQTT Topics for Home Assistant&lt;a class="anchor" href="#mqtt-topics-for-home-assistant"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;Topics used for communication between GbbOptimizer and Home Assistant / GbbConnect.&lt;/p&gt;
&lt;h2 id="data-from-home-assistant-to-gbboptimizer"&gt;Data from Home Assistant to GbbOptimizer&lt;a class="anchor" href="#data-from-home-assistant-to-gbboptimizer"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;div class="mqtt-topic-card mqtt-direction--subscribe"&gt;
 &lt;div class="mqtt-topic-header"&gt;
 &lt;span class="mqtt-badge mqtt-direction--subscribe"&gt;SUB&lt;/span&gt;
 &lt;code class="mqtt-topic-path"&gt;{PlantId}/ha_gbb/sensor&lt;/code&gt;&lt;span class="mqtt-badge mqtt-qos"&gt;QoS 0&lt;/span&gt;&lt;/div&gt;
 &lt;p class="mqtt-topic-description"&gt;HA sensor data — cumulative counters&lt;/p&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Required fields:&lt;/strong&gt;&lt;/p&gt;
&lt;table&gt;
 &lt;thead&gt;
 &lt;tr&gt;
 &lt;th&gt;Field&lt;/th&gt;
 &lt;th&gt;Type&lt;/th&gt;
 &lt;th&gt;Description&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;soc_perc&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;decimal&lt;/td&gt;
 &lt;td&gt;Battery SOC (%). Use &lt;code&gt;V&lt;/code&gt; if &amp;ldquo;Control via V&amp;rdquo; is checked&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;loads_total_kWh&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;decimal&lt;/td&gt;
 &lt;td&gt;Consumption — cumulative counter&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;fromgrid_total_kWh&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;decimal&lt;/td&gt;
 &lt;td&gt;Grid import — cumulative counter&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;togrid_total_kWh&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;decimal&lt;/td&gt;
 &lt;td&gt;Grid export — cumulative counter&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;pv_total_kWh&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;decimal&lt;/td&gt;
 &lt;td&gt;PV production — cumulative counter&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;strong&gt;Optional fields:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>ModbusInMqtt</title><link>https://krzysztofhajdamowicz.github.io/rewrite-GbbOptimizer-manual/en/mqtt-api/modbus-in-mqtt/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://krzysztofhajdamowicz.github.io/rewrite-GbbOptimizer-manual/en/mqtt-api/modbus-in-mqtt/</guid><description>&lt;h1 id="modbusinmqtt-protocol"&gt;ModbusInMqtt Protocol&lt;a class="anchor" href="#modbusinmqtt-protocol"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;Communication protocol between GbbOptimizer and &lt;a href="https://krzysztofhajdamowicz.github.io/rewrite-GbbOptimizer-manual/en/references/glossary/#gbbconnect2" class="glossary-term" title="Local software for direct inverter connection"&gt;GbbConnect2&lt;/a&gt; — transferring Modbus commands over MQTT.&lt;/p&gt;
&lt;h2 id="gbboptimizer--gbbconnect2"&gt;GbbOptimizer → GbbConnect2&lt;a class="anchor" href="#gbboptimizer--gbbconnect2"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;div class="mqtt-topic-card mqtt-direction--publish"&gt;
 &lt;div class="mqtt-topic-header"&gt;
 &lt;span class="mqtt-badge mqtt-direction--publish"&gt;PUB&lt;/span&gt;
 &lt;code class="mqtt-topic-path"&gt;{PlantId}/ModbusInMqtt/toDevice&lt;/code&gt;&lt;/div&gt;
 &lt;p class="mqtt-topic-description"&gt;Modbus commands sent to GbbConnect2&lt;/p&gt;&lt;/div&gt;

&lt;table&gt;
 &lt;thead&gt;
 &lt;tr&gt;
 &lt;th&gt;Field&lt;/th&gt;
 &lt;th&gt;&lt;/th&gt;
 &lt;th&gt;Type&lt;/th&gt;
 &lt;th&gt;Required&lt;/th&gt;
 &lt;th&gt;Description&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;OrderId&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;&lt;/td&gt;
 &lt;td&gt;string&lt;/td&gt;
 &lt;td&gt;no&lt;/td&gt;
 &lt;td&gt;Text copied to the response&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;Lines&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;&lt;/td&gt;
 &lt;td&gt;array&lt;/td&gt;
 &lt;td&gt;yes&lt;/td&gt;
 &lt;td&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;/td&gt;
 &lt;td&gt;&lt;code&gt;LineNo&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;int&lt;/td&gt;
 &lt;td&gt;yes&lt;/td&gt;
 &lt;td&gt;Line number&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;/td&gt;
 &lt;td&gt;&lt;code&gt;Tag&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;string&lt;/td&gt;
 &lt;td&gt;no&lt;/td&gt;
 &lt;td&gt;Arbitrary text copied to the response&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;/td&gt;
 &lt;td&gt;&lt;code&gt;Timestamp&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;int&lt;/td&gt;
 &lt;td&gt;no&lt;/td&gt;
 &lt;td&gt;Unix UTC time (seconds)&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;/td&gt;
 &lt;td&gt;&lt;code&gt;Modbus&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;string&lt;/td&gt;
 &lt;td&gt;yes&lt;/td&gt;
 &lt;td&gt;Modbus command to be sent to the inverter&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;LogLevel&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;&lt;/td&gt;
 &lt;td&gt;string&lt;/td&gt;
 &lt;td&gt;no&lt;/td&gt;
 &lt;td&gt;Change log level: &lt;code&gt;OnlyErrors&lt;/code&gt;, &lt;code&gt;Min&lt;/code&gt;, &lt;code&gt;Max&lt;/code&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;SendLastLog&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;&lt;/td&gt;
 &lt;td&gt;int&lt;/td&gt;
 &lt;td&gt;no&lt;/td&gt;
 &lt;td&gt;1 = attach logs to response (incrementally)&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>EVCC Topics</title><link>https://krzysztofhajdamowicz.github.io/rewrite-GbbOptimizer-manual/en/mqtt-api/evcc-topics/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://krzysztofhajdamowicz.github.io/rewrite-GbbOptimizer-manual/en/mqtt-api/evcc-topics/</guid><description>&lt;h1 id="mqtt-topics-for-evcc"&gt;MQTT Topics for EVCC&lt;a class="anchor" href="#mqtt-topics-for-evcc"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;GbbOptimizer integration with &lt;a href="https://evcc.io/"&gt;evcc.io&lt;/a&gt; via MQTT.&lt;/p&gt;
&lt;h2 id="configuration"&gt;Configuration&lt;a class="anchor" href="#configuration"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;In the Mosquitto (or HA) broker, create a bridge configuration file:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;
&lt;table style="border-spacing:0;padding:0;margin:0;border:0;"&gt;&lt;tr&gt;&lt;td style="vertical-align:top;padding:0;margin:0;border:0;"&gt;
&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;1
&lt;/span&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;2
&lt;/span&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;3
&lt;/span&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;4
&lt;/span&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;5
&lt;/span&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;6
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td style="vertical-align:top;padding:0;margin:0;border:0;;width:100%"&gt;
&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-gdscript3" data-lang="gdscript3"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;connection GbbOptimizer_&lt;span style="color:#f92672"&gt;&amp;lt;&lt;/span&gt;PlantId&lt;span style="color:#f92672"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;remote_username &lt;span style="color:#f92672"&gt;&amp;lt;&lt;/span&gt;PlantId&lt;span style="color:#f92672"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;remote_password &lt;span style="color:#f92672"&gt;&amp;lt;&lt;/span&gt;PlantToken&lt;span style="color:#f92672"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;address &lt;span style="color:#f92672"&gt;&amp;lt;&lt;/span&gt;MQTT address&lt;span style="color:#f92672"&gt;&amp;gt;&lt;/span&gt;:&lt;span style="color:#ae81ff"&gt;8883&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;bridge_capath &lt;span style="color:#f92672"&gt;/&lt;/span&gt;etc&lt;span style="color:#f92672"&gt;/&lt;/span&gt;ssl&lt;span style="color:#f92672"&gt;/&lt;/span&gt;certs
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;topic &lt;span style="color:#75715e"&gt;# both 2 evcc/loadpoints/ &amp;lt;PlantId&amp;gt;/evcc/site/loadpoints/&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;MQTT server addresses — see &lt;a href="https://krzysztofhajdamowicz.github.io/rewrite-GbbOptimizer-manual/en/references/mqtt-servers/"&gt;MQTT servers&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="data-from-evcc-to-gbboptimizer"&gt;Data from EVCC to GbbOptimizer&lt;a class="anchor" href="#data-from-evcc-to-gbboptimizer"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;div class="mqtt-topic-card mqtt-direction--subscribe"&gt;
 &lt;div class="mqtt-topic-header"&gt;
 &lt;span class="mqtt-badge mqtt-direction--subscribe"&gt;SUB&lt;/span&gt;
 &lt;code class="mqtt-topic-path"&gt;{PlantId}/evcc/site/statistic/total/chargedKWh&lt;/code&gt;&lt;/div&gt;
 &lt;p class="mqtt-topic-description"&gt;Total energy consumed by the charger (kWh)&lt;/p&gt;</description></item></channel></rss>