Giter Site home page Giter Site logo

zsbt / hass-w1000-portal Goto Github PK

View Code? Open in Web Editor NEW
42.0 11.0 4.0 58 KB

Home Assistant custom component for W1000 energy portal (e.g. https://energia.eon-hungaria.hu/ )

License: Do What The F*ck You Want To Public License

Python 100.00%
home-assistant-component energy w1000 eon

hass-w1000-portal's Introduction

Purpose

It pulls data from W1000 portal reports.

Changelog

  • 2022-12-30: added package bs4 to requirements
  • 2022-12-05: implementing +A/-A data as statistics - huge thanks to wrobi for making it! Please note, you need add curve A to your report (see the screenshots below)
  • 2022-12-01: hotfix #9: restricting data polls to morning hours and HA reboots
  • 2022-11-22: fixed bug that occured when report name list included space in configuration.yaml

Usage

Prepare data sources

  1. Register and log in to your provider's portal (e.g. https://energia.eon-hungaria.hu/W1000 in Hungary)

  2. Create a new Workarea, if you don't have yet

  3. Add a report to your workarea. Remember this report name, it will be your new sensor in Home Assistant: screenshots

  4. Do you have solar production (export)? Create a new, similar report with curves DP_1-1:2.8.0 and -A.

Set up Home Assistant

In configuration.yaml, give the integration your login details:

w1000-energy-monitor:
  login_user: !secret w1000-email-address
  login_pass: !secret w1000-password
  url: https://energia.eon-hungaria.hu/W1000
  reports: import,export

(report names are case-sensitive)

Energy Dashboard

The new sensors are ready to be added to the Energy Dashboard. Please note, the graph for the current day can be messy as the latest data is not consistent.

Further info

Have some problems? Looking for examples? Visit the Wiki.

Contribute!

If you find this integration useful and think you're good in programming, feel free to create pull requests. I'd be thankful for code reviews, security audits.

I am open to discuss new ideas, change considerations.

hass-w1000-portal's People

Contributors

sanyatuning avatar zsbt 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  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hass-w1000-portal's Issues

1.8.0 curve is missing

Hozzáadtam az A+-t, viszont olyan görbét nem találok, hogy 1.8.0. Ez mit takar? Csak A+,A-,R+,R- közül lehet az EON-nál választani.

CSak az előzőnapi grafikon működik

Sziasztok!
Elég kezdő vagyok a HA-ban. Megpróbáltam a minta leírás alapján beüzemelni a W1000-es kiegészítőt, de kevés sikerrel. Az eneria panelen az aznapin egy nagy minusz oszlop szerepel egy villanyóra állással. Az előző napi az jónak néz ki, ott óránként szépen hozza a fogyasztást. A rezsidémon jópofa de 4 hibát hoz (kideríthetetleneket) és csak a villanyóra állás és a hvg kép működik:
Error while executing automation automation.villanyoraallas_valtozik: Error rendering data template: UndefinedError: 'dict object' has no attribute 'to_state'
Villanyóraállás változik: Error executing script. Error for call_service at pos 1: Error rendering data template: UndefinedError: 'dict object' has no attribute 'to_state'
Template variable error: 'dict object' has no attribute 'to_state' when rendering '{{ trigger.to_state.state|float - trigger.from_state.state|float }}'
és a configban:
Invalid config for [template]: [name] is an invalid option for [template]. Check: template->name. (See /config/configuration.yaml, line 45).
Invalid config for [template]: [name] is an invalid option for [template]. Check: template->name. (See /config/configuration.yaml, line 50).
Invalid config for [template]: [name] is an invalid option for [template]. Check: template->name. (See /config/configuration.yaml, line 65).
Van akinek jól működik?

Köszi, Feró

Invalid statistic_id

Hi Zsombor,

I have entries in my logfile every time I restart HA for each sensor (report in EON) configured:

2023-01-13 21:11:18.084 WARNING (MainThread) [custom_components.w1000-energy-monitor] exception at async_import_statistics 'sensor.w1000_Consumption': Invalid statistic_id
2023-01-13 21:11:18.258 WARNING (MainThread) [custom_components.w1000-energy-monitor] exception at async_import_statistics 'sensor.w1000_Production': Invalid statistic_id

I have values for the sensors and even the consumption is showing, although as a big peak instead of hourly values:
image

Could you help me to troubleshoot?

Thanks
Peter

HA sensors getting "Unknown" value

Hi,
I attached the screenshots from the W1000 EON environment and from my HA dashboard and logbook.
Unfortunately the logbook does not include any entries for the two sensors.
If I can give you any more info, or do any more research, just tell me.

eon w1000 dashboard

HA w1000 term sensor logbook

HA energy sensors

A+ only curve

Hi,

i have added only the +A curve, as it can be enough for me to see the current state for 60minute intervals,but its not working without the 1.8.0 curve added to a report as well:

Ez a hiba egy egyéni integrációból lett származtatva.

Logger: custom_components.w1000-energy-monitor
Source: custom_components/w1000-energy-monitor/init.py:333
Integration: W1000 Energy Monitor (documentation, issues)
First occurred: 18:32:21 (2 occurrences)
Last logged: 18:32:21

1.8.0 curve is missing. Please add it to your report 'a60'
1.8.0 curve is missing. Please add it to your report 'b60'
IMG_3050

Unsupported state class

After upgrade HomeAssistant to version 2023.8.2 it shows 2 errors (for sensor.w1000_import and sensor.w1000_export):

Unsupported state class
The state class of this entity, is not supported.
Statistics cannot be generated until this entity has a supported state class.
If this state class was provided by an integration, this is a bug. Please report an issue.
If you have set this state class yourself, please correct it. The different state classes and when to use which can be found in the developer documentation. If the state class has permanently changed, you may want to remove the long term statistics of it from your database.
Do you want to permanently remove the long term statistics of sensor.w1000_import from your database?

Is this really a bug? What could I do to fix this issue?

By,

paya

Unknown state after updating to latest version

Hi Zsombor,

I have just updated the latest version of W1000 integration and all states of my longtime serving sensors became 'unknown'.

This is my HASS system info:
Core 2024.3.3
Supervisor 2024.03.0
Operating System 12.1
Frontend 20240307.0

And this is the debug report:

This error originated from a custom integration.

Logger: homeassistant
Source: custom_components/w1000-energy-monitor/init.py:280
integration: W1000 Energy Monitor (documentation, issues)
First occurred: 7:20:56 PM (1 occurrences)
Last logged: 7:20:56 PM

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/config/custom_components/w1000-energy-monitor/init.py", line 330, in update
json = await self.request_data()
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/w1000-energy-monitor/init.py", line 99, in request_data
retitem = await self.read_reportname(report)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/w1000-energy-monitor/init.py", line 182, in read_reportname
return await self.read_reportid(int(window['reportid']), reportname)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/w1000-energy-monitor/init.py", line 280, in read_reportid
if data['time'] > lasttime:
^^^^^^^^^^^^^^^^^^^^^^^
TypeError: '>' not supported between instances of 'str' and 'NoneType'

2024-03-25 19:20:45.458 DEBUG (MainThread) [custom_components.w1000-energy-monitor] registered sensor: sensor.w1000_ha_import
2024-03-25 19:20:45.459 DEBUG (MainThread) [custom_components.w1000-energy-monitor] registered sensor: sensor.w1000_ha_export
2024-03-25 19:20:45.461 DEBUG (MainThread) [custom_components.w1000-energy-monitor] registered sensor: sensor.w1000_import
2024-03-25 19:20:45.463 DEBUG (MainThread) [custom_components.w1000-energy-monitor] registered sensor: sensor.w1000_export
2024-03-25 19:20:45.464 DEBUG (MainThread) [custom_components.w1000-energy-monitor] registered sensor: sensor.w1000_griddown
2024-03-25 19:20:45.465 DEBUG (MainThread) [custom_components.w1000-energy-monitor] registered sensor: sensor.w1000_gridup
2024-03-25 19:20:45.701 DEBUG (MainThread) [custom_components.w1000-energy-monitor] reading report ha.import
2024-03-25 19:20:45.785 DEBUG (MainThread) [custom_components.w1000-energy-monitor.sensor] async_update.data None
2024-03-25 19:20:45.785 DEBUG (MainThread) [custom_components.w1000-energy-monitor.sensor] async_update.data None
2024-03-25 19:20:45.786 DEBUG (MainThread) [custom_components.w1000-energy-monitor.sensor] async_update.data None
2024-03-25 19:20:45.787 DEBUG (MainThread) [custom_components.w1000-energy-monitor.sensor] async_update.data None
2024-03-25 19:20:45.787 DEBUG (MainThread) [custom_components.w1000-energy-monitor.sensor] async_update.data None
2024-03-25 19:20:45.788 DEBUG (MainThread) [custom_components.w1000-energy-monitor.sensor] async_update.data None
2024-03-25 19:20:54.333 DEBUG (MainThread) [custom_components.w1000-energy-monitor] resp status http 200
2024-03-25 19:20:54.520 DEBUG (MainThread) [custom_components.w1000-energy-monitor] found report ha.import in workarea Munkaterület1702
2024-03-25 19:20:54.520 DEBUG (MainThread) [custom_components.w1000-energy-monitor] found report export in workarea Munkaterület1702
2024-03-25 19:20:54.520 DEBUG (MainThread) [custom_components.w1000-energy-monitor] found report ha.export in workarea Munkaterület1702
2024-03-25 19:20:54.520 DEBUG (MainThread) [custom_components.w1000-energy-monitor] found report import in workarea Munkaterület1702
2024-03-25 19:20:54.520 DEBUG (MainThread) [custom_components.w1000-energy-monitor] found report griddown in workarea Munkaterület1290
2024-03-25 19:20:54.520 DEBUG (MainThread) [custom_components.w1000-energy-monitor] found report gridup in workarea Munkaterület1290
2024-03-25 19:20:56.094 DEBUG (MainThread) [custom_components.w1000-energy-monitor] reading report ha.export
2024-03-25 19:20:56.302 DEBUG (MainThread) [custom_components.w1000-energy-monitor] reading report import
File "/config/custom_components/w1000-energy-monitor/init.py", line 330, in update
File "/config/custom_components/w1000-energy-monitor/init.py", line 99, in request_data
File "/config/custom_components/w1000-energy-monitor/init.py", line 182, in read_reportname
File "/config/custom_components/w1000-energy-monitor/init.py", line 280, in read_reportid

Thansk a million for looking into this

Empty values since 17th of Jan 2024

Hi,

I use from the integration only the two entities created:

  • w1000.export
  • w1000.import

Which shows me the total imported and exported energy on that day.

And last successful day is 16th of January, 2024.

I have enabled the debug log, and this is the output:

[core-ssh config]$ grep w1000 home-assistant.log
2024-01-19 15:36:46.126 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration w1000-energy-monitor which has not been tested by Home Assistant. This component might cause stabil
ity problems, be sure to disable it if you experience issues with Home Assistant
2024-01-19 15:36:56.760 DEBUG (MainThread) [custom_components.w1000-energy-monitor] reading report import
2024-01-19 15:36:58.777 DEBUG (MainThread) [custom_components.w1000-energy-monitor] resp status http 200
2024-01-19 15:36:58.860 DEBUG (MainThread) [custom_components.w1000-energy-monitor] found report import in workarea Workarea176
2024-01-19 15:36:58.860 DEBUG (MainThread) [custom_components.w1000-energy-monitor] found report export in workarea Workarea176
2024-01-19 15:36:59.768 DEBUG (MainThread) [custom_components.w1000-energy-monitor] registered sensor: sensor.w1000_import
2024-01-19 15:36:59.768 DEBUG (MainThread) [custom_components.w1000-energy-monitor] registered sensor: sensor.w1000_export
2024-01-19 15:36:59.770 DEBUG (MainThread) [custom_components.w1000-energy-monitor.sensor] None
2024-01-19 15:36:59.771 DEBUG (MainThread) [custom_components.w1000-energy-monitor.sensor] None
2024-01-19 15:36:59.784 DEBUG (MainThread) [custom_components.w1000-energy-monitor] import statistic: sensor.w1000_import count: 38
2024-01-19 15:36:59.785 DEBUG (MainThread) [custom_components.w1000-energy-monitor] reading report export
2024-01-19 15:37:00.082 DEBUG (MainThread) [custom_components.w1000-energy-monitor] import statistic: sensor.w1000_export count: 38
2024-01-19 15:37:00.083 DEBUG (MainThread) [custom_components.w1000-energy-monitor] Notifying all listeners
2024-01-19 15:37:00.093 DEBUG (MainThread) [custom_components.w1000-energy-monitor.sensor] {'state': None, 'unit': 'kWh', 'attributes': {'curve': 'HU000110-11-S00000000000001133408 DP_1-1:1.8.0*0', '
generated': None, 'state_class': 'total_increasing', 'device_class': 'energy'}}
2024-01-19 15:37:00.093 DEBUG (MainThread) [custom_components.w1000-energy-monitor.sensor] {'state': None, 'unit': 'kWh', 'attributes': {'curve': 'HU000110-11-S00000000000001133408 DP_1-1:2.8.0*0', '
generated': None, 'state_class': 'total_increasing', 'device_class': 'energy'}}

So the data is not updated, even though if I log in to the energy portal, I see valid total import, and export numbers for 17th, and for 18th as well.

Password not expired, using this tool since 2023. April, this is the first error like this for me.

Thanks
Sandor

Unable to import component: No module named 'bs4'

Hello,

I've just installed this integration in my homeassistant and after restart I got this error:

Logger: homeassistant.setup
Source: setup.py:210
First occurred: 17:54:32 (1 occurrences)
Last logged: 17:54:32

Setup failed for custom integration w1000-energy-monitor: Unable to import component: No module named 'bs4'

After installing bs4 manually it works:

source /srv/homeassistant/bin/activate
pip install beautifulsoup4

I don't speak python a'la homeassistant, but I assume this should be added as a dependency.

Thanks for this btw! :)

Regards,
Gabor

If historical data available, current day shows that

First try the provided script worked flawlessly but after a few hours the daily stats show the all time import, export values, and only previous days work correctly.

Daily:
image

Previous day:
image

Also since I can't open a PR here, I'd recommend a few changes to make it clearer how to install W1000-portal.
README.md

Weird data on previous days

Every historical data starting from nov 16. has a huge bar at the start. HA hasn't been restarted/modified. since then.
image
image

Is there any tool to fix these anomalies? I would go all the way to manually correct the whole year just to finally get a clean chart.

Fetching +A and -A profile datas

[feature-request]
Is there any way to process the 15-minute data?
I mean the +A and -A profiles.
I know they can be half a day late, but it would be nice to see the consumption and recharge data on the Home Assistant Energy Dashboard.
BTW it's a very useful product, thanks a lot.

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.