Energy consumption and generation

https://community.home-assistant.io/t/how-to-help-us-help-you-or-how-to-ask-a-good-question/114371#oneone-format-it-properly

name: “Current Demand”

value_template: >
  {% if "demand" in value_json %}
    {{ 0 if value_json.demand <=0 else value_json.demand }}
  {% else %}
    unknown
  {% endif %}

name: “Current Export”

value_template: >
  {% if "demand" in value_json %}
    {{ 0 if value_json.demand > 0 else value_json.demand|abs  }}
  {% else %}
    unknown
  {% endif %}