Giter Club home page Giter Club logo

homeassistant-mojelektro's Introduction

Hits GitHub issues GitHub User's stars GitHub Repo stars

Home Assistant Integration of Moj Elektro electricity meter

This is an updated version of the custom component for integrating electric utility meter data into Home Assistant. It no longer requires a local certificate to access Moj Elektro but utilizes a new API service provided by Informatika.si.

Screenshot of a Moj Electro in Home Assistant using Apex Chart Card. *Example of Moj Elektro API using Apex Chart Card. You can find yaml in https://github.com/frlequ/mojelektro-apex-chart

Warning for existing users

This update should not erase existing sensors, but will not update the energy produced _output entities. Fixed!

Note

Note about data: This integration gathers energy information with a 24-hour delay because API doesn't provide real-time data. Unfortunately, this delay leads to inaccurate readings, especially between midnight and 6 a.m as data aggregates. The problem lies with Moj Elektro, and there's no way around it.

Setup API

  1. Log in to Mojelektro.si using any available login options.
  2. Under Moj Profil, find the option to create a token Kreiraj žeton. Use unlimited expiration and click Create Token.
  3. Copy the newly generated token. You'll need it in the configuration step.
  4. Your meter_id is EIMM number found und Merilna mesta/merilne točke

Installation

Method 1 (easiest): Open your Home Assistant instance and open a repository inside the Home Assistant Community Store.

Method 2: Manually copy mojelektro folder from latest release to custom_components folder.

Restart Home Assistant

Configuration

In Home Assistant

  1. Go to Settings > Add intergration > search > Moj Elektro
  2. Enter credentials:

Screenshot of a Moj Electro setup in Home Assistant.

Note

As for version 0.2.0 there is no need for configuration.yaml file edit!

Roadmap

  • Add energy output sensors
  • Add config flow (Home Assistant UI setup)
  • Add decimals options for meters
  • Add option to save to long term statistics
  • Multi-language Support
    • English
    • Slovenian

Report any issues

Thanks and consider giving me a 🌟 star

homeassistant-mojelektro's People

Contributors

frlequ avatar saso5 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

homeassistant-mojelektro's Issues

multiple EIMM

Integration works as expected when adding an EIMM to the HA.

After adding the second EIMM there are no entities and after the reboot of whole HA the values are taken from the second EIMM added.

Deprecated constants

2024-04-27 20:51:04.569 WARNING (ImportExecutor_0) [homeassistant.const] ENERGY_KILO_WATT_HOUR was used from mojelektro, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfEnergy.KILO_WATT_HOUR instead, please report it to the author of the 'mojelektro' custom integration
2024-04-27 20:51:04.580 WARNING (ImportExecutor_0) [homeassistant.const] DEVICE_CLASS_ENERGY was used from mojelektro, this is a deprecated constant which will be removed in HA Core 2025.1. Use SensorDeviceClass.ENERGY instead, please report it to the author of the 'mojelektro' custom integration

Strange data

Data in the HA does not match what I see directly in the mojelektro swagger. Are there any calculations done before pushing the data to HA?

image

image

Invalid authentication, please try again

After the initial succesfull setup it quite quickly stoped syncing. I reinstalled the integration but when trying to set it up I get "Invalid authentication, please try again", I even created a new token.

Example for data that also includes energy output

Hello

I enclosed the debug log with A+ and A- data.

2024-02-01 22:00:50.198 DEBUG (SyncWorker_4) [custom_components.mojelektro.moj_elektro_api] Meter does not match: 36.357 vs 39.832. Or dates 2024-01-31 and 2024-01-31. A possible mojElektro fault.

These values are A- 36,357 and A+ 39,832 for yestarday.

And screenshot from HA

HAlog-home_assistant_20230102.txt
HA_MojElektro_2024-02-01 223041

Entity_ID changed

Hello

Why the name of the entity_id has changed - now has 2 at end?

mojelektro_entity_ID_changed

Update for sensor.mojelektro_15min_output fails

Hi.
Everything was working fine for a few hours and all of the sudden stopped. Tried to regenerate key and reinstall integration to no success Fetching fails with the following log:

Logger: homeassistant.helpers.entity
Source: helpers/entity.py:898
First occurred: 13:52:14 (204 occurrences)
Last logged: 13:57:44

Update for sensor.mojelektro_15min_output fails
Update for sensor.mojelektro_15min_input fails
Update for sensor.mojelektro_monthly_input fails
Update for sensor.mojelektro_monthly_input_peak fails
Update for sensor.mojelektro_monthly_input_offpeak fails
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 898, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1218, in async_device_update
await hass.async_add_executor_job(self.update)
File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/mojelektro/sensor.py", line 107, in update
self._state = self.hass.data[DOMAIN].get(self.type)
^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get'

Daily and Monthly cost

In the case of the graphs, I see that you also have a calculation based on daily and monthly costs. How do you get the balance for the previous months so that you can calculate the expenses? I am also interested in the past day, given that the data is "rarely" linked, I tried to do it at a specific time, e.g. 10 am to check the status according to the tariff for the previous day, but the status is usually "Unavailable".

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.