Skip to content

Instantly share code, notes, and snippets.

@awstanley
Last active April 26, 2022 23:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save awstanley/39e84bf1d1f149af7adbbe0e82a72b14 to your computer and use it in GitHub Desktop.
Save awstanley/39e84bf1d1f149af7adbbe0e82a72b14 to your computer and use it in GitHub Desktop.
Zappi integration tied Markdown display for your phone or dashboard. Designed for phone display or as part of a grid/horizontal grouping.
{# This Markdown will not execute anything on your Zappi, it just displays information.
Largely untested in different states due to the generally green nature of charging done here.
Pause state renders correctly against two inputs, and the Charging state works too.
* Required power/CT information is in watts (should be correct now);
* Session is in kWh (should be correct now);
* 'EV Connected' is clobbered by 'Charging', so state information is used from the integration.
Fixed an else/if issue and removed the untested Boost section.
#}
{#
The serial number of the Zappi is used to build the variables.
This can be pulled from a helper if you want.
Find this in your linked Zappi name on HA.
#}
{% set zappi_serialnumber = '<serial>' %}
{#
The grid excess is how much you've configured your Zappi to leave when it's running in Eco+.
This can be hardcoded to a float if you prefer. Remember to update this when you change it.
If in doubt (because you haven't set it), this is 0.
#}
{% set zappi_grid_excess = states('input_number.requirement_zappi_grid_excess')|float %}
{#
The minimum power is the minimum power the Zappi requires,
ignoring the grid excess.
1400-1600W is the norm, depending on settings. If in doubt, 1600.
#}
{% set zappi_minimum_power = states('input_number.requirement_zappi_minimum_power')|float %}
{# Auto-set variables from the integration #}
{% set zappi_charge_mode = states('select.myenergi_zappi_' + zappi_serialnumber + '_charge_mode') %}
{% set zappi_plug_status = states('sensor.myenergi_zappi_' + zappi_serialnumber + '_plug_status') %}
{% set zappi_status = states('sensor.myenergi_zappi_' + zappi_serialnumber + '_status') %}
{% set zappi_power_ct_grid = states('sensor.myenergi_zappi_' + zappi_serialnumber + '_power_ct_grid')|float %}
{% set zappi_charge_session = states('sensor.myenergi_zappi_' + zappi_serialnumber + '_charge_added_session')|float(default=0.0) %}
<center>
<ha-icon icon="mdi:ev-plug-type2"></ha-icon> <strong>{{ zappi_charge_mode }}</strong>
{% if zappi_plug_status == "EV Connected" %}{% if zappi_status == 'Paused' %}
Paused
<small>Waiting for surplus:</small>
{{ zappi_power_ct_grid + zappi_grid_excess + zappi_minimum_power }} W{% endif%}{% elif zappi_status == 'Completed' %}
Completed
<small>Last Session:</small>
{{ zappi_charge_session }} kWh{% elif zappi_plug_status == 'Charging' %}
{{ zappi_status }}
<small>Current Session:</small>
{{ zappi_charge_session }} kWh{% else %}Not Connected{% endif %}
</center>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment