Homevolt package 🔋

I’m started to collect my Homevolt battery sensors from the local webserver in a package to access all data in Home-Assistant.

Please use if want, and post comments or improvements.:battery: :electric_plug::zap:

Invite: https://invite.tibber.com/zg5s6hew


  • Enable local webserver on Homevolt
  • Enabled at start or 3s press on left button under the hood
  • Navigate to Homevolt local webserver by http://ip-address
  • Force local webserver to enabled in Params
  • Turn on password, if desired
  • Turn on secure http, if desired
  • Store Params to flash
Guide in swedish

Wi-Fi-guide

Om ditt batteri har dÄlig LTE-anslutning som orsakar lÄngsamma eller misslyckade uppdateringar, kan du manuellt stÀlla in Wi-Fi via batteriets portal:
Aktivera servicelÀge

  • HĂ„ll in knappen pĂ„ vĂ€nstra sidan av vĂ€xelriktaren i 3 sekunder.
  • Anslut till batteriets Wi-Fi
  • Öppna Wi-Fi-instĂ€llningarna pĂ„ din telefon.
  • Anslut till nĂ€tverket som heter HVSM-<QR-kod pĂ„ batteriet>.
  • Konfigurera Wi-Fi via portalen
  • NĂ€r du Ă€r ansluten bör en portal öppnas automatiskt.
  • Klicka “Konfigurera Wi-Fi”.
  • VĂ€lj och anslut till kundens Wi-Fi-nĂ€tverk.

Om portalen inte öppnas automatiskt:

  • Öppna en webblĂ€sare och navigera till: http://10.133.70.1/ eller http://homevolt-.local
  • Hitta serienumret pĂ„ vĂ€xelriktarens förpackning:
  • Det börjar med 68b och ser ut som 68b6b34dcbac

Using custom components in package to calculate income:

to include packages folder to config.

homeassistant:
    packages: !include_dir_named packages

Secrets file

  • Change to http without s if not using local cert
  • Change ip-address in the file.
homevolt_pass: "password_in_local_webserver"
homevolt_pris: 60000
homevolt_montage: "2025-01-01"
homevolt_status: "https://192.168.1.100/status.json"
homevolt_ems: "https://192.168.1.100/ems.json"
homevolt_error: "https://192.168.1.100/error_report.json"
homevolt_error_curl: >
      echo {\"errors\": $(curl -sk -u 'admin:password' https://192.168.1.100/error_report.json) }
homevolt_schedule: "https://192.168.1.100/schedule.json"
homevolt_params: "https://192.168.1.100/params.json"
homevolt_params_curl: >
      echo {\"params\": $(curl -sk -u 'admin:password' https://192.168.1.100/params.json) }
homevolt_logs: "https://192.168.1.100/logs.json"
homevolt_logs_curl: >
      echo {\"logs\": $(curl -sk -u 'admin:password' https://192.168.1.100/logs.json) }
    # whitelist check for commands before sending them
homevolt_console_curl: >
      echo "{\"result\": \"$( curl -sk -u 'admin:password' -X POST --form cmd='{{
      states('input_text.homevolt_cmd') if
        states('input_text.homevolt_cmd') in [
          'time uptime' ,'help' ,'lte_info' ,'tasks', 'power i',
          'param_list', 'mqtt', 
          'lte_restart', 'lte_power 1','lte_power 0',
          'ems_schedule_get',
          'sched_list'
        ] or states('input_text.homevolt_cmd').startswith('echo ')
        or states('input_text.homevolt_cmd').startswith('ping ')
        or states('input_text.homevolt_cmd').startswith('lte_at ')
        or states('input_text.homevolt_cmd').startswith('sched_del ')
        or states('input_text.homevolt_cmd').startswith('sched_add ')
        or states('input_text.homevolt_cmd').startswith('sched_set ')
or states('input_text.homevolt_cmd').startswith('ems_schedule_force ')
        else
        'echo command not accepted to send by HA'
      }}' https://192.168.1.100/console.json | sed -e ':a' -e 'N' -e '$!ba' -e 's/\n/\\n/g' )\"}"

packages\homevolt.yaml

### Homevolt package
#  2025-04-23
# 

# Custom changes
# Uses nordpool integration (https://www.home-assistant.io/integrations/nordpool/) for the sensor:
#      sensor.nord_pool_se3_aktuellt_pris

# price for battery and purchased day


# ------------------------------------------------ #
# REST integration
rest:
- resource: !secret homevolt_status
  username: "admin"
  password: !secret homevolt_pass
  verify_ssl: false
  scan_interval: 300
  timeout: 30
  sensor:
  - name: "Homevolt status"
    unique_id: "homevolt_status"
    value_template: "{{ value_json.uptime if 'uptime' in value_json }}"
    icon: "mdi:battery-clock"
    json_attributes:
    - uptime
    - wifi_status
    - lte_status
    - mqtt_status
    - w868_status
    - ems_status
  - name: "Homevolt LTE cellid"
    unique_id: "homevolt_lte_cellid"
    value_template: >-
      {{ ((value_json.lte_status.cell_id) | replace('"','')) if 'cell_id' in value_json.lte_status }}
    icon: "mdi:sim"

- resource: !secret homevolt_ems
  username: "admin"
  password: !secret homevolt_pass
  verify_ssl: false
  scan_interval: 30
  timeout: 30
  sensor:
  - name: "Homevolt EMS"
    unique_id: "homevolt_ems"
    value_template: "{{ value_json.ems[0].ems_data.state_str }}"
    icon: >-
      mdi:battery-{{ int((float(value_json.ems[0].ems_data.soc_avg)/100) | round(-1), 0)
        if not float(value_json.ems[0].ems_data.soc_avg) < 5 else 'outline' }}
    json_attributes: 
    - ems
    - aggregated
    - sensors
  - name: "Homevolt EMS error"
    unique_id: "homevolt_ems_error"
    value_template: "{{ (value_json.ems[0].error_str)[:255] }}"
    icon: "mdi:battery-unknown"
    json_attributes_path: "$.ems[0]"
    json_attributes: 
    - error_str
  - name: "Homevolt EMS varning"
    unique_id: "homevolt_ems_warning"
    value_template: "{{ (value_json.ems[0].ems_data.warning_str | join(', ') | replace('_', ' ') | replace('ems', 'EMS'))[:255] }}"
    icon: "mdi:battery-unknown"
    json_attributes_path: "$.ems[0].ems_data"
    json_attributes: 
    - warning_str
  - name: "Homevolt EMS info"
    unique_id: "homevolt_ems_info"
    value_template: "{{ (value_json.ems[0].ems_data.info_str | join(', ') | replace('_', ' ') | replace('ems', 'EMS'))[:255] }}"
    icon: "mdi:battery-unknown"
    json_attributes_path: "$.ems[0].ems_data"
    json_attributes: 
    - info_str
  - name: "Homevolt temperatur"
    unique_id: "homevolt_ems_temperature"
    value_template: "{{ float(value_json.ems[0].ems_data.sys_temp,0)/10 }}"
    icon: "mdi:battery-heart-variant"
    unit_of_measurement: '°C'
    device_class: temperature
  - name: "Homevolt spÀnning L1"
    unique_id: "homevolt_ems_l1"
    value_template: "{{ value_json.ems[0].ems_voltage.l1 /10 }}"
    unit_of_measurement: 'V'
    icon: "mdi:meter-electric-outline"
    device_class: voltage
  - name: "Homevolt spÀnning L2"
    unique_id: "homevolt_ems_l2"
    value_template: "{{ value_json.ems[0].ems_voltage.l2 /10 }}"
    unit_of_measurement: 'V'
    icon: "mdi:meter-electric-outline"
    device_class: voltage
  - name: "Homevolt spÀnning L3"
    unique_id: "homevolt_ems_l3"
    value_template: "{{ value_json.ems[0].ems_voltage.l3 /10 }}"
    unit_of_measurement: 'V'
    icon: "mdi:meter-electric-outline"
    device_class: voltage
  - name: "Homevolt frekvens"
    unique_id: "homevolt_ems_freq"
    value_template: "{{ value_json.ems[0].ems_data.frequency /1000 }}"
    unit_of_measurement: 'Hz'
    icon: "mdi:meter-electric-outline"
    device_class: frequency
  - name: "Homevolt effekt"
    unique_id: "homevolt_ems_power"
    value_template: "{{ value_json.ems[0].ems_data.power }}"
    unit_of_measurement: 'W'
    icon: "mdi:battery-sync-outline"
    device_class: power
  - name: "Homevolt energi producerat"
    unique_id: "homevolt_ems_prod"
    value_template: "{{ value_json.ems[0].ems_data.energy_produced /1000 }}"
    unit_of_measurement: 'kW'
    icon: "mdi:battery-positive"
    device_class: power
  - name: "Homevolt energi konsumerat"
    unique_id: "homevolt_ems_consumed"
    value_template: "{{ value_json.ems[0].ems_data.energy_consumed /1000 }}"
    unit_of_measurement: 'kW'
    icon: "mdi:battery-negative"
    device_class: power
  
  - name: "Homevolt effekt tillgÀnglig"
    unique_id: "homevolt_power_avail"
    value_template: >-
      {{
      float(value_json.ems[0].ems_prediction.avail_ch_pwr,0) - 
      float(value_json.ems[0].ems_prediction.avail_di_pwr,0)
      }}
    unit_of_measurement: 'kW'
    icon: "mdi:battery-negative"
    device_class: power
    json_attributes_path: "$.ems[0].ems_prediction"
    json_attributes: 
    - avail_ch_pwr
    - avail_di_pwr

  - name: "Homevolt konsumerat"
    unique_id: "homevolt_consumed"
    value_template: "{{ value_json.ems[0].ems_aggregate.exported_kwh }}"
    unit_of_measurement: 'kWh'
    icon: "mdi:battery-positive"
    device_class: energy
    state_class: total
  - name: "Homevolt producerat"
    unique_id: "homevolt_produced"
    value_template: "{{ value_json.ems[0].ems_aggregate.imported_kwh }}"
    unit_of_measurement: 'kWh'
    icon: "mdi:battery-negative"
    device_class: energy
    state_class: total

  - name: "Homevolt bat0"
    unique_id: "homevolt_bat0"
    value_template: "{{ float(value_json.ems[0].bms_data[0].soc)/100 }}"
    unit_of_measurement: '%'
    icon: >-
      mdi:battery{{
      '-'~(float(value_json.ems[0].bms_data[0].soc)/100) | round(-1) | int
      if (float(value_json.ems[0].bms_data[0].soc)/100) >= 10 and (float(value_json.ems[0].bms_data[0].soc)/100) <= 90
      else '-outline' if (float(value_json.ems[0].bms_data[0].soc)/100) <= 10 }}
  - name: "Homevolt bat1"
    unique_id: "homevolt_bat1"
    value_template: "{{ float(value_json.ems[0].bms_data[1].soc)/100 }}"
    unit_of_measurement: '%'
    icon: >-
      mdi:battery{{
      '-'~(float(value_json.ems[0].bms_data[1].soc)/100) | round(-1) | int
      if (float(value_json.ems[0].bms_data[1].soc)/100) >= 10 and (float(value_json.ems[0].bms_data[1].soc)/100) <= 90
      else '-outline' if (float(value_json.ems[0].bms_data[1].soc)/100) <= 10 }}
  - name: "Homevolt bat0 laddningar"
    unique_id: "homevolt_bat0_cycle"
    value_template: "{{ value_json.ems[0].bms_data[0].cycle_count }}"
    icon: "mdi:battery"
  - name: "Homevolt bat1 laddningar"
    unique_id: "homevolt_bat1_cycle"
    value_template: "{{ value_json.ems[0].bms_data[1].cycle_count }}"
    icon: "mdi:battery"
    
  # Pulse CT
  - name: "Homevolt nÀteffekt"
    unique_id: "homevolt_grid_power"
    value_template: "{{ value_json.sensors[0].total_power }}"
    unit_of_measurement: 'W'
    icon: "mdi:battery-negative"
    device_class: power
    state_class: measurement
    json_attributes_path: "$.sensors[0]"
    json_attributes: 
    - phase
  - name: "Homevolt nÀt konsumerat"
    unique_id: "homevolt_grid_consumed"
    value_template: "{{ value_json.sensors[0].energy_imported }}"
    unit_of_measurement: 'kWh'
    icon: "mdi:battery-negative"
    device_class: energy
    state_class: total
  - name: "Homevolt nÀt producerat"
    unique_id: "homevolt_grid_produced"
    value_template: "{{ value_json.sensors[0].energy_exported }}"
    unit_of_measurement: 'kWh'
    icon: "mdi:battery-positive"
    device_class: energy
    state_class: total
  - name: "Homevolt solcell effekt"
    unique_id: "homevolt_solar_power"
    value_template: "{{ value_json.sensors[1].total_power }}"
    unit_of_measurement: 'W'
    icon: "mdi:battery-positive"
    device_class: power
    state_class: measurement
    json_attributes_path: "$.sensors[1]"
    json_attributes: 
    - phase
  - name: "Homevolt solcell konsumerat"
    unique_id: "homevolt_solar_consumed"
    value_template: "{{ value_json.sensors[1].energy_imported }}"
    unit_of_measurement: 'kWh'
    icon: "mdi:battery-negative"
    device_class: energy
    state_class: total
  - name: "Homevolt solcell producerat"
    unique_id: "homevolt_solar_produced"
    value_template: "{{ value_json.sensors[1].energy_exported }}"
    unit_of_measurement: 'kWh'
    icon: "mdi:battery-positive"
    device_class: energy
    state_class: total
  - name: "Homevolt hushÄlleffekt"
    unique_id: "homevolt_load_power"
    value_template: "{{ value_json.sensors[2].total_power }}"
    unit_of_measurement: 'W'
    icon: "mdi:battery-negative"
    device_class: power
    state_class: measurement
    json_attributes_path: "$.sensors.[2]"
    json_attributes: 
    - phase
  - name: "Homevolt batteri konsumerat"
    unique_id: "homevolt_bat_consumed"
    value_template: "{{ value_json.sensors[2].energy_imported }}"
    unit_of_measurement: 'kWh'
    icon: "mdi:battery-negative"
    device_class: energy
    state_class: total
  - name: "Homevolt batteri producerat"
    unique_id: "homevolt_bat_produced"
    value_template: "{{ value_json.sensors[2].energy_exported }}"
    unit_of_measurement: 'kWh'
    icon: "mdi:battery-positive"
    device_class: energy
    state_class: total

- resource: !secret homevolt_schedule
  username: "admin"
  password: !secret homevolt_pass
  verify_ssl: false
  scan_interval: 1800
  sensor:
  - name: "Homevolt schema"
    unique_id: "homevolt_schem"
    value_template: >-
      {{ (value_json.schedule | rejectattr('from', '>', (now().timestamp())) | rejectattr('to', '<', (now().timestamp())) | map(attribute='type') | 
      first |
      replace('1', 'Ladda, uttag:') | replace('3', 'VĂ€nta') | replace('4', 'NĂ€t urladdning ') | replace('2', 'Urladdning ') | replace('5', 'NĂ€t Laddning/urladdning ')) if 'schedule' in value_json
      }} {{ (value_json.schedule | rejectattr('from', '>', (now().timestamp())) | rejectattr('to', '<', (now().timestamp())) | map(attribute='params.setpoint') | first) ~'W' if 'schedule' in value_json and
        (value_json.schedule | rejectattr('from', '>', (now().timestamp())) | rejectattr('to', '<', (now().timestamp())) | map(attribute='params.setpoint') | first) > 0
      }}
    icon: >-
      {% set type = (value_json.schedule | rejectattr('from', '>', (now().timestamp())) | rejectattr('to', '<', (now().timestamp())) | map(attribute='type') | first) %}
      {{ 'mdi:battery-positive' if type == 1 }}
      {{ 'mdi:battery-negative' if type == 2 or type == 4 }}
      {{ 'mdi:battery-clock-outline' if type == 3 }}
    json_attributes: 
    - local_mode
    - schedule
    - schedule_id
  - name: "Homevolt schema nÀsta"
    unique_id: "homevolt_schem_next"
    value_template: >-
      {{ as_datetime(float(value_json.schedule[1].from,0)).strftime('%H:%M') if 'schedule' in value_json
      }} {{ (value_json.schedule[1].type |
      replace('1', 'Ladda, uttag:') | replace('3', 'VĂ€nta') | replace('4', 'NĂ€t urladdning ') | replace('2', 'Urladdning ') | replace('5', 'NĂ€t Laddning/urladdning ')) if 'schedule' in value_json
      }}{{ (value_json.schedule[1].params.setpoint ) ~'W' if 'schedule' in value_json and 'setpoint' in value_json.schedule[1].params
      }}
    icon: "mdi:calendar-clock-outline"
    
# ------------------------------------------------ #
# Command line integration
# used to fetch json array
command_line:
- sensor:
    name: "Homevolt logs"
    unique_id: "homevolt_logs"
    scan_interval: 600
    icon: "mdi:text"
    # password in curl
    command: !secret homevolt_logs_curl
    value_template: >-
      Error: {{ value_json.logs | selectattr('level','eq', 'error') | list | count }}, 
      Warning: {{ value_json.logs | selectattr('level','eq', 'warning') | list | count }}, 
      Info: {{ value_json.logs| selectattr('level','eq', 'info') | list | count }}, 
      Total: {{ value_json.logs | length if value_json is defined }}
    json_attributes:
      - logs

      
- sensor:
    name: "Homevolt parametrar"
    unique_id: "homevolt_param"
    scan_interval: 7200
    icon: "mdi:console-line"
    # password in curl
    command: !secret homevolt_params_curl
    value_template: >-
      {{ value_json.params | length if value_json is defined }}
    json_attributes:
      - params
      
- sensor:
    name: "Homevolt errors"
    unique_id: "homevolt_errors"
    scan_interval: 600
    icon: "mdi:battery-alert-variant-outline"
    command: !secret homevolt_error_curl
    value_template: >-
      {{ (value_json.errors |
      rejectattr('message','in', 
        ['','Throttled','idle','up2date','Rev:1 (435 mV)','Protocol version: 5']) | 
      rejectattr('message','contains', 'OK') | 
      rejectattr('message','contains', 'online') |
      rejectattr('message','contains', 'No ') | 
      rejectattr('message','contains', ' 100.00%') | 
      rejectattr('message','contains', 'RSSI ') | 
      rejectattr('message','contains', ' valid') | 
      rejectattr('message','contains', ' available') | 
      map(attribute='message') | list | join(', '))[:255] 
      if value_json is defined }}
    json_attributes:
      - errors

- sensor:
    name: "Homevolt console"
    unique_id: "homevolt_console"
    scan_interval: 2592000
    icon: "mdi:console"
    command: !secret homevolt_console_curl
    value_template: >-
      {{ value_json.result[:255] }}
    json_attributes:
      - result

# ------------------------------------------------ #
# Template integration
template:
- sensor:
  - name: "Homevolt intÀkt momentant"
    unique_id: "homevolt_income"
    unit_of_measurement: "SEK"
    state: >-
      {{ float(states('sensor.nord_pool_se3_aktuellt_pris'), 0) * (float(states('sensor.homevolt_effekt'), 0)/1000) | round(2) }}
    device_class: monetary
    icon: "mdi:cash"
    
  - name: "Homevolt nÀt L1"
    unique_id: "homevolt_grid_l1"
    unit_of_measurement: "A"
    state: "{{ float(state_attr('sensor.homevolt_nateffekt', 'phase')[0].amp, 0) }}"
    device_class: current
    state_class: measurement
    icon: "mdi:current-ac"
    attributes:
      power: "{{ float(state_attr('sensor.homevolt_nateffekt', 'phase')[0].power,0)  }}"
      volt: "{{ float(state_attr('sensor.homevolt_nateffekt', 'phase')[0].voltage,0)  }}"
    
  - name: "Homevolt nÀt L2"
    unique_id: "homevolt_grid_l2"
    unit_of_measurement: "A"
    state: "{{ float(state_attr('sensor.homevolt_nateffekt', 'phase')[1].amp, 0) }}"
    device_class: current
    state_class: measurement
    icon: "mdi:current-ac"
    attributes:
      power: "{{ float(state_attr('sensor.homevolt_nateffekt', 'phase')[1].power,0)  }}"
      volt: "{{ float(state_attr('sensor.homevolt_nateffekt', 'phase')[1].voltage,0)  }}"
    
  - name: "Homevolt nÀt L3"
    unique_id: "homevolt_grid_l3"
    unit_of_measurement: "A"
    state: "{{ float(state_attr('sensor.homevolt_nateffekt', 'phase')[2].amp, 0) }}"
    device_class: current
    state_class: measurement
    icon: "mdi:current-ac"
    attributes:
      power: "{{ float(state_attr('sensor.homevolt_nateffekt', 'phase')[2].power,0)  }}"
      volt: "{{ float(state_attr('sensor.homevolt_nateffekt', 'phase')[2].voltage,0)  }}"


- trigger:
  - platform: time_pattern
    hours: "/1"
  sensor:
    name: "Homevolt Äterbetalning"
    unique_id: "homevolt_refund_automation"
    unit_of_measurement: "SEK"
    state: >-
      {{ float(states('sensor.homevolt_intakt'),0) + 
       float(state_attr(this.entity_id, 'gridrewards_per_dygn') if 'gridrewards_per_dygn' in this.attributes else 0 ,0) *
       int((as_timestamp(now()) - as_timestamp(state_attr(this.entity_id, 'montage_datum') if 'montage_datum' in this.attributes else now()) )/60/60/24, 0) |
       round(0) }}
    device_class: monetary
    icon: "mdi:cash"
    attributes:
      kostnad_batteri: !secret homevolt_pris
      montage_datum: !secret homevolt_montage
      gridrewards_per_dygn: 18
      sparat_nyttjande: "{{ float(states('sensor.homevolt_intakt'),0) }}"
      gridrewards_total: "{{ float(this.attributes.gridrewards_per_dygn if 'gridrewards_per_dygn' in this.attributes else 0,0)* int((as_timestamp(now()) - as_timestamp(this.attributes.montage_datum if 'montage_datum' in this.attributes else now()))/60/60/24,0) }}"
      beraknad_ater_days: >-
        {% set per_day = (int(this.state, 0) / int((as_timestamp(now()) - int(as_timestamp(this.attributes.montage_datum if 'montage_datum' in this.attributes else now())))/60/60/24, 0)) %}
        {{ int((int(this.attributes.kostnad_batteri if 'kostnad_batteri' in this.attributes else 0,0) - (int(this.state,0))) / per_day, 0) }}
      beraknad_ater: "{{ (int(this.attributes.beraknad_ater_days if 'beraknad_ater_days' in this.attributes else 0,0) * (24*60*60) + as_timestamp(now())) | timestamp_custom('%Y-%m-%d', True) }}"


# ------------------------------------------------ #
# Sensor integration
sensor:
- platform: integration
  unique_id: "homevolt_income_moment"
  source: sensor.homevolt_intakt_momentant
  name: Homevolt intÀkt
  unit_time: h
  method: left
  round: 2
  
utility_meter:
  yearly_earning:
    source: sensor.homevolt_intakt
    name: "Homevolt intÀkt Är"
    unique_id: "homevolt_income_yearly"
    cycle: yearly
    net_consumption: true
    
  monthly_earning:
    source: sensor.homevolt_intakt
    name: "Homevolt intÀkt mÄnad"
    unique_id: "homevolt_income_monthley"
    cycle: monthly
    net_consumption: true
    
# Input for cmd
input_text:
  homevolt_cmd:
    name: Homevolt cmd input
    initial: time uptime


# ------------------------------------------------ #
# Automation integration
automation:
- alias: Homevolt uppdatera schema varje timme
  id: "homevolt_update"
  description: "Uppdaterar schema sensor varje timme för att fÄ senaste schema | homevolt.yaml"
  trigger:
  - platform: time_pattern
    minutes: 1
  action:
  - action: homeassistant.update_entity
    data:
      entity_id:
      - sensor.homevolt_schema

- alias: Homevolt uppdatera console
  id: "homevolt_update_console"
  description: "Uppdaterar console-frÄga | homevolt.yaml"
  trigger:
  - platform: state
    entity_id: input_text.homevolt_cmd
    for: "00:00:06"
  action:
  - action: homeassistant.update_entity
    data:
      entity_id:
      - sensor.homevolt_console

6 Likes

Homevolt: https://homevolt.com/

ERROR / WARNING / INFO messages

from Tibber support

  • EMS_WARNING_OVER_SOC_MAX_WARNING Systemet minskar effekten pĂ„ grund av hög “State of Charge”, detta förvĂ€ntas vid laddning av batteriet.
  • EMS_WARNING_SOC_IMBALANCE_WARNING InnebĂ€r att batterierna Ă€r för lĂ„ngt ifrĂ„n varandra i SOC för att kunna anslutas.
  • EMS_WARNING_BATTERY_DC_DISCONNECT_WARNING Detta Ă€r en konsekvens av ovanstĂ„ende varning, att ett av de tvĂ„ batterierna Ă€r frĂ„nkopplat frĂ„n DC pĂ„ grund av hög spĂ€nningsskillnad.

Dashboard

type: sections
max_columns: 6
icon: mdi:home-battery
path: batteri
sections:
  - type: grid
    cards:
      - type: tile
        tap_action:
          action: url
          url_path: https://192.168.1.100
        hold_action:
          action: perform-action
          perform_action: homeassistant.update_entity
          target: {}
          data:
            entity_id:
              - sensor.homevolt_ems
              - sensor.homevolt_scheman
              - sensor.homevolt_status
        entity: sensor.homevolt_ems
        name: EMS
        vertical: false
        show_entity_picture: false
        hide_state: false
        state_content:
          - state
          - last_updated
        features_position: bottom
        icon_tap_action:
          action: more-info
      - type: tile
        entity: sensor.homevolt_producerat
        name: Producerat
      - type: tile
        entity: sensor.homevolt_konsumerat
        name: Konsumerat
      - type: tile
        entity: sensor.homevolt_schema
        name: Schema
        features_position: bottom
        vertical: false
        icon_tap_action:
          action: perform-action
          perform_action: homeassistant.update_entity
          target: {}
          data:
            entity_id:
              - sensor.homevolt_schema
      - type: tile
        entity: sensor.homevolt_schema_nasta
        name: Schema nÀsta
        show_entity_picture: false
        vertical: false
        hide_state: false
        hold_action:
          action: more-info
        state_content: state
      - type: markdown
        content: >-
          {{ states('sensor.homevolt_ems_error') if
          states('sensor.homevolt_ems_error') != 'No error' }}

          {{ '**Varning:**' if states('sensor.homevolt_ems_varning') != '' }}

          {{ states('sensor.homevolt_ems_varning') }}

          {{ '**Info:**' if states('sensor.homevolt_ems_info') != '' }}

          {{ states('sensor.homevolt_ems_info') }}


          **{{ states('sensor.homevolt_logs') }}**

          ‱ {{ (state_attr('sensor.homevolt_logs','logs') |
                    rejectattr('level','in', ['info']) |
                    map(attribute='data') |
                    list | join('\n‱ '))[:255] }}
          **Status**

          ‱ {{ states('sensor.homevolt_errors').split(', ') | join('\n‱ ') }}
      - type: tile
        entity: sensor.homevolt_intakt_manad
        name: IntÀkt mÄnad
        features_position: bottom
        vertical: false
        icon: mdi:cash
        state_content: state
      - type: tile
        features_position: bottom
        vertical: false
        entity: sensor.homevolt_aterbetalning
        name: IntÀkt
  - type: grid
    cards:
      - type: gauge
        entity: sensor.homevolt_nateffekt
        max: 14000
        severity:
          green: 0
          yellow: 6000
          red: 10000
        name: NĂ€t
        grid_options:
          rows: auto
          columns: 4
      - type: gauge
        grid_options:
          rows: auto
          columns: 4
        entity: sensor.homevolt_solcell_effekt
        name: Solcell
        max: 5000
      - type: gauge
        entity: sensor.homevolt_hushalleffekt
        max: 5000
        severity:
          green: 0
          yellow: -3000
          red: -5000
        needle: true
        min: -5000
        grid_options:
          columns: 4
          rows: auto
        name: Hus
      - type: gauge
        entity: sensor.homevolt_nat_l1
        severity:
          green: 0
          yellow: 8
          red: 16
        name: L1
        max: 20
        grid_options:
          columns: 3
          rows: 1
      - type: gauge
        entity: sensor.homevolt_nat_l2
        severity:
          green: 0
          yellow: 8
          red: 16
        name: L2
        max: 20
        grid_options:
          columns: 3
          rows: 1
      - type: gauge
        entity: sensor.homevolt_nat_l3
        severity:
          green: 0
          yellow: 8
          red: 16
        name: L3
        max: 20
        grid_options:
          columns: 3
          rows: 1
      - type: gauge
        entity: sensor.homevolt_spanning_l1
        max: 230
        min: 225
        needle: true
        grid_options:
          rows: 1
          columns: 3
        name: " "
      - type: gauge
        entity: sensor.homevolt_effekt
        max: 6000
        name: Effekt
        min: -6000
        needle: false
        grid_options:
          columns: 4
          rows: auto
      - type: gauge
        entity: sensor.homevolt_bat0
        severity:
          green: 60
          yellow: 10
          red: 0
        name: Batteri 0
        grid_options:
          columns: 4
          rows: auto
      - type: gauge
        entity: sensor.homevolt_bat1
        severity:
          green: 60
          yellow: 10
          red: 0
        name: Batteri 1
        grid_options:
          columns: 4
          rows: auto
      - type: gauge
        entity: sensor.nordpool_kwh_se3_sek_3_095
        severity:
          green: 0
          yellow: 2
          red: 3
        needle: true
        max: 4
        grid_options:
          columns: 4
          rows: 1
        name: " "
      - type: tile
        entity: sensor.homevolt_bat0_laddningar
        name: Laddningar
      - show_name: false
        show_icon: true
        type: button
        tap_action:
          action: navigate
          navigation_path: /lovelace-energi/homevolt-consol
        icon: mdi:console
        entity: sensor.homevolt_console
        grid_options:
          columns: 2
          rows: 1
        hold_action:
          action: navigate
          navigation_path: /lovelace-energi/homevolt-consol
      - type: gauge
        entity: sensor.homevolt_temperatur
        max: 60
        min: -10
        grid_options:
          columns: 4
          rows: 1
        name: " "
      - type: tile
        entity: sensor.homevolt_lte_cellid
        name: Cellid
title: Batteri
cards: []
badges: []

Apexcharts

type: custom:apexcharts-card
graph_span: 36h
update_interval: 5min
experimental:
  color_threshold: true
header:
  show: true
  show_states: true
  colorize_states: true
  floating: false
yaxis:
  - id: watt
    decimals: 0
    apex_config:
      tickAmount: 6
    min: -6000
    max: 6000
  - id: lowest
    decimals: 0
    min: 0
    max: 1
    show: false
  - id: SEK
    show: false
    decimals: 1
    opposite: true
    apex_config:
      tickAmount: 6
      title:
        text: kr
    min: ~0
    max: ~2
  - id: procent
    show: false
    decimals: 1
    opposite: true
    apex_config:
      tickAmount: 6
      title:
        text: "%"
    min: -100
    max: 100
apex_config:
  chart:
    height: 360px
    animations:
      enabled: false
      easing: easeinout
      speed: 800
      animateGradually:
        enabled: true
        delay: 150
  annotations:
      xaxis:
      - x: EVAL:new Date().setHours(16,0,0)
        x2: EVAL:new Date().setHours(20,0,0)
        label:
          text: KvÀll
          borderWidth: 0
          style:
            background: "#0000"
  tooltip:
    enabled: true
  zoom:
    enabled: true
    type: x
    autoScaleYaxis: true
    zoomedArea:
      fill:
        color: "#90CAF9"
        opacity: 0.4
      stroke:
        color: "#0D47A1"
        opacity: 0.4
        width: 1
  legend:
    show: true
    floating: false
    offsetY: -2
hours_12: false
span:
  start: hour
  offset: "-32h"
now:
  show: false
  color: grey
  label: Nu
all_series_config:
  show:
    legend_value: true
    datalabels: false
    extremas: false
    in_header: false
  float_precision: 0
  invert: false
  stroke_width: 1
  curve: stepline
  yaxis_id: watt
  extend_to: now
series:
  - entity: sensor.nordpool_kwh_se3_sek_3_095
    name: El hist.
    stroke_width: 0
    curve: stepline
    color: grey
    type: area
    yaxis_id: SEK
    opacity: 0.2
    extend_to: now
    show:
      legend_value: false
      extremas: false
      in_header: false
      header_color_threshold: true
    color_threshold:
      - value: 0
        color: green
      - value: 1.5
        color: orange
      - value: 3
        color: darkred
      - value: 4.5
        color: red
      - value: 6
        color: black
  - entity: sensor.nordpool_kwh_se3_sek_3_095
    stroke_width: 0
    curve: stepline
    color: black
    type: area
    yaxis_id: SEK
    opacity: 0.2
    float_precision: 2
    show:
      legend_value: false
      extremas: true
      in_header: false
      header_color_threshold: true
    data_generator: |
      return (entity.attributes.raw_today.map((start, index) => {
        return [new Date(start["start"]).getTime(), entity.attributes.raw_today[index]["value"]];
      })).concat(entity.attributes.raw_tomorrow.map((start, index) => {
        return [new Date(start["start"]).getTime(), entity.attributes.raw_tomorrow[index]["value"]];
      }));
    color_threshold:
      - value: 0
        color: green
      - value: 1.5
        color: orange
      - value: 3
        color: darkred
      - value: 4.5
        color: red
      - value: 6
        color: black
  - entity: binary_sensor.nordpool_billigast_6h
    name: Billigast 6h
    stroke_width: 0
    curve: stepline
    type: area
    yaxis_id: lowest
    opacity: 0.1
    show:
      in_header: false
      legend_value: false
    transform: "return x === 'on' ? 1 : 0;"
  - entity: sensor.homevolt_effekt
    name: Batteri
    stroke_width: 1
    opacity: 1
    curve: stepline
    yaxis_id: watt
    show:
      in_header: false
    group_by:
      duration: 10min
      func: avg
  - entity: sensor.homevolt_nateffekt
    name: NĂ€t
    stroke_width: 1
    opacity: 0.6
    curve: stepline
    yaxis_id: watt
    transform: return -x
    show:
      in_header: false
    group_by:
      duration: 10min
      func: avg
  - entity: sensor.homevolt_bat0
    name: Batteri0
    stroke_width: 1
    opacity: 1
    curve: smooth
    yaxis_id: procent
    show:
      in_header: false
  - entity: sensor.homevolt_bat1
    name: Batteri1
    stroke_width: 1
    opacity: 1
    curve: smooth
    yaxis_id: procent
    show:
      in_header: false
3 Likes

It seems to work very well!
Thanks!!!

1 Like

Hi and thanks @fatuuse

Do you also built a page for showing all the info?

2 Likes

IstĂ€llet för att behöva leta upp och byta IP sĂ„ kan man lĂ€gga in nĂ„got som detta i secrets.yaml tibber_rest: “http://192.168.0.22/status.json”

I ditt script lÀgger man dÄ till nÄgot som detta:

  • resource: !secret tibber_rest

DÄ blir det bara ett stÀllet man behöver updater IP pÄ.

Japp. men Àven till: /error_report.json & /schedule.json
Jag har inte hittat nÄgon sÀtt att slÄ ihop en secret med ett annat vÀrde.

Should not these be state_class: total_increasing?

  - name: "Homevolt batteri konsumerat"
    value_template: "{{ value_json.sensors[2].energy_imported }}"
    unit_of_measurement: 'kWh'
    icon: "mdi:battery-negative"
    device_class: energy
    state_class: total
  - name: "Homevolt batteri producerat"
    value_template: "{{ value_json.sensors[2].energy_exported }}"
    unit_of_measurement: 'kWh'
    icon: "mdi:battery-positive"
    device_class: energy
    state_class: total

I believe it won’t matter until you change battery.
Total can decrease, but I trust measurements from battery data.
Total increasing can’t decrease .

NÄgon som vÄgat skicka nÄgot annat kommando Àn echo & help??
Skulle vara kul och veta om det gÄr att ersÀtta en rad i schemat :grin:

Package updated in first post.
https://community.home-assistant.io/t/homevolt-package/845654

Apexcharts upcoming schedule example

type: custom:apexcharts-card
graph_span: 22h
yaxis:
  - id: watt
    decimals: 0
    apex_config:
      tickAmount: 6
  - id: lowest
    min: 0
    max: 1
    show: false
apex_config:
  chart:
    height: 260px
hours_12: false
span:
  start: hour
  offset: "-8h"
series:
  - entity: sensor.homevolt_schema
    stroke_width: 0
    curve: stepline
    color: black
    type: area
    yaxis_id: watt
    opacity: 0.2
    data_generator: |
      return (entity.attributes.schedule.map((entry, index) => {
        var setpoint = (entry["params"]["setpoint"]);
        if(isNaN(setpoint)) {setpoint=0;};
        if(entry["type"] == 1) {setpoint=setpoint*-1;};
        return [new Date(entry["from"]*1000),setpoint];
      }));
  - entity: binary_sensor.nordpool_billigast_6h
    name: Billigast 6h
    stroke_width: 0
    curve: stepline
    type: area
    yaxis_id: lowest
    opacity: 0.1
    transform: "return x === 'on' ? 1 : 0;"
  - entity: sensor.homevolt_effekt
    name: Batteri
    stroke_width: 1
    opacity: 1
    curve: stepline
    yaxis_id: watt
    group_by:
      duration: 10min
      func: avg

Tja, kan du skriva koden för den binÀra sensorn?

template:
- binary_sensor:
  - name: Nordpool billigast 6h
    icon: mdi:gauge-low
    state: >-
      {% set l=(state_attr('sensor.nordpool_kwh_se3_sek_3_095', 'raw_today')|sort(attribute='value'))[0:6] %}
      {% for i in l %}
      {{ True if (now() >= i.start and now() <= i.end) }}
      {% endfor %}
    attributes:
      time: >-
        {%- set l=(state_attr('sensor.nordpool_kwh_se3_sek_3_095', 'raw_today')|sort(attribute='value'))[0:6] | sort(attribute='start') %}
        {%- for i in l %}
        {%- if (i.start.hour - l[loop.index0-1].end.hour) >= 1 and not loop.first %}
        {{- l[loop.index0-1].end.hour }}{% endif %}
        {%-  if i.start.hour != l[loop.index0-1].end.hour %}
        {{ i.start.hour~'-' }}{% endif %}
        {%- if loop.last %}
        {{- i.end.hour~'\n' | replace(0,24) }}{% endif %}
        {%- endfor %}
      price: "{{ states('sensor.nordpool_kwh_se3_sek_3_095') }}"

Thank you!
I’m Very glad to have found this, just a question why no unique_id’s on the sensors? Just asking if it might be a problem to have them.

I didn’t had any use for it, yet?
Could add


done! :slight_smile:
hope it works!

1 Like

Is it possible to control the battery or I “only” get sensors?

I also have a homevolt and now I’m trying this integration but when I try to restart HA I get the following error message: Configuration warnings
Integration error: packages - Integration ‘packages’ not found.

what am i doing wrong

did you miss homassistant: as top?

When I put that in my config file I get this error message:
Configuration warnings

Integration error: Homeassistant - Integration ‘Homeassistant’ not found.