Energy Assistant Configuration file

The energy_assistant.yaml file is used to configure Energy Assistant. An starting point for your configuration file can be found here.

Home

Configure the main attributes of your home.

State Values

Some configuration items are configured as state values. There are the following formats supported:

Direct assignment:

value_name: homeassistant entity

Example:

grid_supply_power: sensor.grid_supply_power

Scaling or inverting

value_name:
  value: homeassistant entity
  scale: The value will be multiplied with this scaling value (float)
  inverted: Whether the value will be inverted (bool)

Example:

grid_supply_power:
  value: sensor.grid_supply_power
  scale: 0.001

Jinja2 Templates

value_name:
  template: jinja2 template
  scale: The value will be multiplied with this scaling value (float)
  inverted: Whether the value will be inverted (bool)

Example:

grid_supply_power:
  template: {{sensor.grid_supply_power_1 + sensor.grid_supply_power_2}}
  scale: 0.001

Parameters for Home

The following values need to be set (not optional):

  • name: The name of the home to be displayed in the user interface.
  • solar_power: Home Assistant entity name for the currently produced solar power. This is can be configured using the state value format described above.
  • solar_energy: Home Assistant entity name for the total amount of solar energy produced by the house. Optionally this value can be generated by the integration helper in Home Assistant. This is can be configured using the state value format described above.
  • grid_supply_power: Home Assistant entity name for the current power measured at the connection point of the house to the grid. This value can be positive (exporting energy to the grid) or negative (importing energy from the grid). This is can be configured using the state value format described above.
  • grid_inverted: If set to True, you can invert the grid_supply_power.
  • imported_energy: Home Assistant entity name for the total amount of energy imported from the grid. This is can be configured using the state value format described above.
  • exported_energy: Home Assistant entity name for the total amount of energy imported from the grid. This is can be configured using the state value format described above.

Devices

This is a list of the devices to monitored and managed by the Energy Assistant.

  • name: The name of the device to be displayed in the user interface.
  • id: GUID of the device. This value needs to be a valid guid and needs to be unique.
  • type: This can either be evcc, power-state-device, homeassistant or stiebel-eltron
  • store_sessions: Needs to be set to true in case you want to log the sessions of the devie in the Session Log.

evcc type

This is a device (e.g. a charger) managed by Evcc. You need to configure a MQTT connection for the Evcc connect.

  • evcc_topic: The mqtt topic configured in the Evcc MQTT Configuration.
  • load_point_id: The Evcc id of the load point (typically the ids are just numbers from 1..x)

homeassistant type

This is a device managed by Home Assistant. Energy Assistant will display the current power consumption and provides different statistics on energy consumption like self sufficiency.

In case you are setting the model and manufacturer or the state, the device will detect it's state (on or off) based on the power consumption. This state information can then be used to log the sessions of the device (in case store_sessions is set to True). Example: You have a dish washer connected through a smart plug. This device type the detects if the dishwasher is running or not.

  • icon: mdi icon shown in the UI
  • power: Home Assistant entity for the current power consumption of the device (in Watt)
  • energy: Home Assistant entity for the total energy meter of the device (in kWh). In case the device does not provide this entity, you can setup a integration helper in Home Assistant. This is can be configured using the state value format described above.
  • manufacturer: Manufacturer of the device.
  • model: Model of the device
  • output: In case you want Energy Assistant to control the device (pv mode or optimized mode), you need to set this value to the id of the homeassistant switch entity controlling the power of the device.
  • nominal_power: Expected nominal power consumption (in Watts) of the device in case the device is running.
  • nominal_duration: Expected nominal time (in seconds) the device is running per day.
  • constant: True if the power of the device should not be interrupted when the device is running. In this case, there is only one startup per 24h in the Optimized mode.

  • state: In case Energy Assistant has not yet a pre-configured model of your device, you can configure the state detection with this entry.

  • state_on:
    • threshold: The device is detected as on when the power goes above this value (in Volt)
  • state_off:
    • threshold: The device is detected as off when the power goes above this value (in Volt). In addition the following items are considered:
    • trailing_zeros_for: The power needs to be below threshold for trailing_zeros_for seconds.

In case neither manufacturer or model nor state is defined, the following defaults are used:

  • Device is on if power is above 2 Watt
  • Device is off if power is 0 Watt for 10 seconds

Energy Assistant is providing detection for the device types listed here.

heat-pump type

This device type is used for Stiebel Eltron heat pumps. Often, you will configure two instances: One for heating, one for water heating.

  • state: Home Assistant entity for the state of the device (on or off)
  • energy: Home Assistant entity for total energy. This is can be configured using the state value format described above.
  • temperature: Home Assistant entity for the current temperature
  • comfort_target_temperature: Home Assistant entity for the target temperature
  • target_temperature_normal: Target temperature for normal operation
  • target_temperatrure_pv: Target temperature for the case when enough PV power is available or the timeslot for the Optimized Energy consumption is now.
  • nominal_power: The nominal power of the heat pump.

Example:

home:
  name: "My Home"
  solar_power: sensor.solaredge_i1_ac_power
  solar_energy: sensor.solaredge_i1_ac_energy_kwh
  grid_supply_power:
    value: sensor.solaredge_m1_ac_power
    inverted: true
  imported_energy: sensor.solaredge_m1_imported_kwh
  exported_energy: sensor.solaredge_m1_exported_kwh
  devices:
    - name: Evcc loadpoint 1
      id: 7d480adc-2c45-4de9-8f36-063c5dea0253
      type: evcc
      evcc_topic: "evcc"
      load_point_id: 1
      store_sessions: true
    - name: Tumbler
      id: 75203c88-216f-4712-8a94-80513793f7e1
      type: power-state-device
      power: sensor.tumbler_power
      energy:
        value: sensor.tumbler_energy
        scale: 0.001
      store_sessions: true
      manufacturer: v-zug
      model: Adora TS WP
    - name: Server
      id: eb6b3f0a-1175-4ff3-9ebe-8c22663cba48
      type: homeassistant
      icon: mdi-server-network
      power: sensor.server_power
      energy:
        value: sensor.server_energy
        scale: 0.001

Mqtt

The mqtt configuration is only needed in case you would like to interface with evcc.

Example:

mqtt:
  host: homeassistant.stadel15.net
  username: smarthome
  password: smarthome!23
  topic: energyassistant

Emhass

The Emhass configuration section is described in the Emhass documentation.

The following keys in the Emhass configuration are provided by Energy Assistant itself. In case you are using those keys, Energy Assistant will overwrite the values:

  • hass_url
  • long_lived_token
  • var_PV
  • var_load
  • var_replace_zero
  • var_interp
  • time_zone
  • lat
  • lon
  • alt

  • num_def_loads

  • P_deferrable_nom
  • def_total_hours
  • treat_def_as_semi_cont
  • set_def_constant

Home Assistant

This section is only used in case you run Energy Assistant stand alone (not as Home Assistant addon).

  • url: URL of the home assistant instance you want to connect to.
  • token: Long lived access token from Home Assistant.

Example:

homeassistant:
  url: https://homeassistant.example.net
  token: "your long lived home assistant token"