Coder Social home page Coder Social logo

danimart1991 / pvpc-hourly-pricing-card Goto Github PK

View Code? Open in Web Editor NEW
81.0 6.0 20.0 1.02 MB

Home Assistant Lovelace custom card to use with Spain electricity hourly pricing (PVPC) integration

License: Apache License 2.0

home-assistant lovelace lovelace-ui lovelace-custom-card home-automation home-assistant-custom hacs home-assistant-hacs lovelace-card pvpc

pvpc-hourly-pricing-card's People

Contributors

bramkragten avatar danimart1991 avatar fragmenthor avatar jjprz avatar misa1515 avatar sargue avatar syeklu 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  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

pvpc-hourly-pricing-card's Issues

Cannot read property '_model' of undefined

From time to time I get this error in the logs:

2020-05-06 09:07:21 ERROR (MainThread) [frontend.js.latest.202004272] http://192.168.100.5:8123/hacsfiles/pvpc-hourly-pricing-card/pvpc-hourly-pricing-card.js:358:58 Uncaught TypeError: Cannot read property '_model' of undefined
2020-05-06 09:07:25 ERROR (MainThread) [frontend.js.latest.202004272] http://192.168.100.5:8123/hacsfiles/pvpc-hourly-pricing-card/pvpc-hourly-pricing-card.js:358:58 Uncaught TypeError: Cannot read property '_model' of undefined
2020-05-06 09:07:27 ERROR (MainThread) [frontend.js.latest.202004272] http://192.168.100.5:8123/hacsfiles/pvpc-hourly-pricing-card/pvpc-hourly-pricing-card.js:358:58 Uncaught TypeError: Cannot read property '_model' of undefined

All seems to work ok.

It poinst to this line:

const xBarStart = meta.data[selectedIndex]._model.x;

Maybe the meta.data is not available under some circumstances? Or the selectedIndex value is not correct?

Suggestion for graph

It would be interesting to add a min and a max option to the graph for people that don't want the autoscale.

pvpc hourly pricing card no funciona tras actualización HA

Buenos días,

Desde la ultima actualización de HA en Septiembre dicha tarjeta no funciona. Nos encontramos con el siguiente error para tu información @danimart1991

Custom element doesn't exist: pvpc-hourly-pricing-card.
type: custom:pvpc-hourly-pricing-card
name: PVPC 2.0 DT
entity: sensor.pvpc_2_0_dt

Saludos

Desde ayer 12.05.2023, no se muestran datos en la integración de PVPC en Home Assistant

Este error se originó a partir de una integración personalizada.

Logger: homeassistant.config_entries
Source: custom_components/pvpc_hourly_pricing/init.py:102
Integration: Spain electricity hourly pricing (PVPC)
First occurred: 10:48:16 (1 occurrences)
Last logged: 10:48:16

Error setting up entry PVPC for pvpc_hourly_pricing
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 387, in async_setup
result = await component.async_setup_entry(hass, self)
File "/config/custom_components/pvpc_hourly_pricing/init.py", line 102, in async_setup_entry
hass.config_entries.async_setup_platforms(entry, PLATFORMS)
AttributeError: 'ConfigEntries' object has no attribute 'async_setup_platforms'

No disponible

Desde las 19 horas de hoy (29-11-20) aparece no disponible. Un saludo

Precios de excedentes de autoconsumo

Propongo una nueva funcionalidad de la tarjeta.

La opción de añadir un nuevo sensor con el precio de venta de excedentes de autoconsumo y que se pinte en la misma gráfica. Propongo utilizar el mismo color del dia (hoy o mañana si disponible) pero utilizando una línea punteada en vez de sólida.

La idea es utilizar el sensor que también proporciona la versión de la integración que funciona con un token: azogue/aiopvpc#35 (comment)

Option to disable Tomorrow graph

It would be great if the graph showing the following day could be permanently disabled.

At the moment the user can turn on/off the graph but it can be confusing for non-technical users.

Theme broken HA 2021.5.0

Hello,

In version 2021.5.0 of HA, when entering the visualization where the card is, the custom HA theme is broken and replaced by the standard one.

Tested in various browsers, phones, clearing cache and cookies, new lovelance, view, etc, always with the same result.

Thanks for the card.
Greetings!

sensor.pvpc unavailable since some time ago

Since some time ago, pvpc sensor appears as unavailable and the log shows:

This error originated from a custom integration.

Logger: homeassistant.config_entries
Source: custom_components/pvpc_hourly_pricing/__init__.py:102
Integration: Spain electricity hourly pricing (PVPC)
First occurred: 1:01:41 PM (1 occurrences)
Last logged: 1:01:41 PM

Error setting up entry PVPC for pvpc_hourly_pricing
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 390, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/pvpc_hourly_pricing/__init__.py", line 102, in async_setup_entry
    hass.config_entries.async_setup_platforms(entry, PLATFORMS)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'ConfigEntries' object has no attribute 'async_setup_platforms'

I'm using the latest version of the pvpc card (1.9.0)

Wrong detection of minimum cost hour

Hi! This is what I've seen today:

  • The card is showing the minimum cost at 5:00 to 6:00 hour.

Screenshot_20200428-214256

  • The price is correct, but the reality is that it is from 11:00 to 12:00

Screenshot_20200428-214310

It seems that it repeats the data of today in the tomorrow data.

Suggestion: Collapsable graph

Graph view of the card is quite useful but it takes quite space of the screen to keep it visible all the time so I wonder if it is posible to make it collapsable.

I mean, with "graph: true" option it would be great it a new "collapse_graph: true/false" could be implemented.

collapse_graph = false -> Current layout/behavior
collapse_graph = true -> Card layout will be slightly different: Graph will be hidden by default but in some place in the card will be an down-arrow (I imagine it where the minimum/maximum daily price are shown, for instance).
If you click on it, the card will make bigger itself and show the graph. Arrow will become an up-arrow.
When you click on it again, the card shrink itself hidding the graph (and the arrow will become a down-arrow)

I think it could be great and useful because allows you a glance to the day's prices (looking at attributes isn't as visual) keeping the space used by the card to a minimum.

Thank you in advance

Did the API path change since 2 Nov?

As of 2 Nov, PVPC card and the built in PVPC integration in HA has stopped working.

Log just says:
Logger: homeassistant.components.pvpc_hourly_pricing.sensor
Source: components/pvpc_hourly_pricing/sensor.py:136
Integration: Spain electricity hourly pricing (PVPC) (documentation, issues)
First occurred: 22:58:51 (5 occurrences)
Last logged: 23:05:04

sensor.pvpc: repeated bad data update, mark component as unavailable source

Error color icono tararjeta

Con la ultima actualización de home assistant a la 0.112.0 el icono de la tarjeta que cambia de verde a rojo para indicar si se esta en periodo barato o caro de la luz ha dejando de funcionar y ahora esta siempre en negro
Captura de pantalla 2020-07-02 a las 23 05 40

PVPC no muestra datos

desde ayer día 2 de Noviembre a las 20:00 aproximadamente HA no muestra ningún dato.
La integración aparece como no disponible.la tarjeta tampoco muestra ningún dato.
he actualizado e incluso instalado de nuevo pero no funciona. Hoy he comprobado con la instalación de un amigo y tampoco funciona.
Gracias por la integración .

Cannot select the Card

Hello,
Following the steps on the web, I have come to configure the card in Home Assistant with version 0.05, but when I update to 1.00 or higher, I get an error when selecting the card, which shows in red: NotSupportedError : Failed to execute 'define' on 'CustomElementRegistry': the name "pvpc-hourly-pricing-card-editor" has already been used with this registry
Could it be something from the selection check?
Any ideas, since I find the card very interesting. Thank you

Uncaught TypeError: Cannot read property '_model' of undefined

Hello,

I get this error "hacsfiles/pvpc-hourly-pricing-card/pvpc-hourly-pricing-card.js:365:81 Uncaught TypeError: Cannot read property '_model' of undefined".
The card worked correctly one day, then appears the error.
How to solve the error?
Thanks a lot for your help and great work.

Change the height of the graph

First of all, thank you for this card.

I propose the option of being able to change the height of the graph (with a fixed minimum and maximum).

This would allow more flexibility to adapt the card to screens of different sizes and to add in existing panels.

Gracias.

Cambios en api.esios.ree.es

Hola,
Escribo en español porque entiendo es tu idioma nativo y el correo recibido está también en español.

He recibido un correo de esios con el contenido que pego abajo, he buscado y creo que no hay incidencia creada sobre esto.

Gracias por tu trabajo.

Saludos

Correo recibido:

Estimad@ minombre :-).

Como usuario/a del API público de esios api.esios.ree.es, le informamos que se va proceder a la migracion de dicho API a una nueva infraestructura.

El interfaz de todas las operaciones del api se mantendrá sin modificaciones, únicamente se produce un cambio en la cabecera donde se indica el token de acceso a la hora de realizar las llamadas al API.

Actualmente el token de acceso al API se incluye en la siguiente cabecera:

    Authorization: Token token=xxxxxxxxx"


La nueva cabecera a utilizar es la siguiente:

    x-api-key: xxxxxxxxxx


Hemos habilitado el siguiente endpoint de test para que pueda realizar las pruebas necesarias una vez adapte sus llamadas: [https://apip.esios.ree.es](https://apip.esios.ree.es")

Las dos cabeceras son compatibles tanto en el sistema actual como en el nuevo, por lo que ya puede dejar preparados desarrollos con ambas cabeceras si lo desea, y tenerlos actualizados para cuando se despliegue en producción el nuevo sistema.

Se comunicará más adelante la fecha de puesta en producción a través de la web [https://www.esios.ree.es](https://www.esios.ree.es") y por correo electrónico. Si ha adaptado sus llamadas con la nueva cabecera, el cambio debe ser transparente ya que se mantendrá el endpoint https://api.esios.ree.es.

Ante cualquier consulta, por favor pónganse en contacto por correo electrónico con [[email protected]](mailto:[email protected]")

Un cordial saludo,

Consultas SIOS.

Not loaded in Lovelace

After installing with HACS in a Home Assistant OS (RaspBerry PI 4), version 2020.12.2, I get a "Not loaded in Lovelace" error.
Captura de pantalla 2021-01-05 a las 20 44 54

After reinstalling, no error is shown but the card didn't show in Lovelace

Icons change

I need opinion on the change of icons to something more clarifying for all users. Since it is difficult to find suitable Material Design icons. How about using this thumb icons? I accept another approach like animated icons, svg icons,... but must contemplate all three tariff periods (peak, valley and super-valley).

image

same color for both curves

I don't know if it's my problem but since version 1.4.0 the two curves appear in the same color (blue)

image

Se corta el tooltip

Hola! Gracias por la card...
No sé si es por alguna de las custom card que uso, pero el tooltip con los datos se corta:

image

Aquí está las cards que uso:

cards:
  - entities:
      - entities:
          - attribute: next_best_at
            name: Siguientes
        entity: sensor.pvpc_horario_dha
        name: Mínimo
        secondary_info:
          attribute: min_price_at
          name: A las
        show_state: false
        type: 'custom:multiple-entity-row'
    type: entities
  - type: 'custom:pvpc-hourly-pricing-card'
    title: PVPC por hora DHA
    entity_id: sensor.pvpc_horario_dha
title: Coste kWh
type: 'custom:stack-in-card'

Graph not shown since 2023.7.0b0

The graph view in the PVPC Hourly Pricing Card is not working since 2023.7.0b0 release:

imagen

Only the "colored dot" is shown but the graph itself is not visible. Attributes are received OK from PVPC integration but data is not shown in the graph.

In case it helps, just created a new dashboard with only the PVPC card (with graph enabled) I can see this in browser developer console:
imagen

Under "card configuration" with "Show graph" enabled, browser developer console shows this:
imagen

I've seen home-assistant/frontend#16799 in 2023.07 release related with "timezone" but not sure if it might be related/the root cause of this issue

Card Appearance

Hello.
I would like to make some modifications in the card design.
I see how to change the font size, but didn't find how to change the card header location, on my HA screen it is perceptibly lower then on the other other cards, please check screenshot attached.
Can you point me how to change it, as I only see common ha-card style, which affect all cards.
Cards

Uncaught TypeError: Cannot convert undefined or null to object

Hola, estoy viendo este error en el registro. Estoy usando la última versión disponible. La tarjeta funciona así que no tiene pinta de ser muy grave, pero supongo que faltará alguna validación en código o algo.

Detalles de registro (ERROR)
Logger: frontend.js.latest.202004072
Source: components/system_log/__init__.py:209
First occurred: 13:12:43 (2 occurrences)
Last logged: 13:16:53

http://192.168.100.5:8123/hacsfiles/pvpc-hourly-pricing-card/pvpc-hourly-pricing-card.js:130:31 Uncaught TypeError: Cannot convert undefined or null to object

Un saludo y gracias por tu código!!

Graph and peaks show with a 1 hour delay when used in the Canary Islands.

Dear Daniel,

First of all, thank you so much for such wonderful card. We all appreciate your efforts.

However, I have found what seems to be an issue. I am based in the Canary Islands, therefore, my Home Assistant is set up to the Atlantic/Canary time zone, which provides the correct time for me, including Daylight saving in summer.

It seems like your card may be misinterpreting the information that the PVPC integration feeds it.

As you can see here, the max price is shown to be at 22h, and the minimum at 4h.
image

Nonetheless, the data fed by the PVPC integration, which seems correct after cross-checking, differs by 1 hour.
You can see that the max price is actually shown to be at 21h, and the minimum at 3h.
image

Furthermore, the graph displayed seems to be shifted to the right by 1 hour.
image

My gut feeling is that the card is not taking into account the time zone and is somehow adding 1 hour to the data provided by the PVPC integration. That said, I do not know what the issue is and I am not sure it is the card, but this could be a starting point.

Please let me know if there is anything I can help you with.

BR

Airam

Suggestion: select section and no point

In the graph, to see the price of some hour, we need to select the point where the hour starts.

This had sense in the old style where it was a continuous line and only the starting point was at the right hour/price.

Now the graph is divided into sections, one per hour, and the complete section marks the correct hour/price. Can the complete section be used to select the hour? Will be a lot easier, specially for mobile, to select one hour to see the price and I think it represents better the graph.

If you make this change, maybe is better too to move a little to the right the max and min markers in the graph, to be in the center of the section and not in the starting point. Again I think this will represent a lot better the contents of the graph.

Thanks!

Not working in 0.116.0

It seems it has stopped working in Home Assistant 0.116.0. Simply nothing appears. I have not seen any error.

Configuracion visual grafico en modo oscuro

Sobre el tema por defecto de Home Assistant la visualizacion del grafico es correcta con la ultima update de las barras, pero sobre un tema en modo oscuro no se ven las barras.
¿Quizas alguna configuracion extra es necesaria?
Grafico

Selection remains under Android

The new PVPC card is great. It select and hour and shows a tooltip with the price when the mouse is over it.

The problem is that under Android, this selection and tooltip remains on. It does not return to the "current hour" and the tooltip does not hide when the touch is released.

I'm not too sure but I suppose that this was not the intended result.

I can't uninstall totally the HAC

With Home Assistant 2023.2.x, I can't uninstall the hac. Apparently the widget is uninstalled, but in the list of cards it remains. Thanks

precio medio periodo

Hola. Como sabéis la pvpc con discriminación horaria no te cobra por horas, si no por el precio promedio del periodo valle o pico. Yo tengo una serie de sensores para que me calcule la factura mensual, pero claro, le tengo que poner el precio promedio que yo crea conveniente porque la media de cada periodo cambia todos los días.
Sería posible que este sensor indicase el precio medio del periodo pico o valle actual para que los sensores de calculo de factura cogieran ese dato del sensor?.
Muchas gracias por el curro.

Error getting PVPC prices (NaN)

The card stopped working yesterday or the day before. I'm in the lastest version of HomeAssistant, but it also fails for a friend of mine which is in the previous version, so maybe the problem is that ESIOS changed something on their end.

This is a screenshot of the current content of the card.
image

Añadir un atributo con el precio medio diario

Buenos días, creo que sería útil disponer de un atributo con el precio medio diario para cada día.

Este valor se puede usar en automatizaciones, por ejemplo:

  • Activar determinados aparatos (lavadoras, lavavajillas, bombas de calor, etc.) cuando el precio actual sea inferior al precio medio diario, pero no cuando sea superior.
  • Carga de baterías desde la red, cuando la batería está descargada por debajo de un determinado nivel, en horario nocturno, siempre que el precio en ese horario sea inferior al precio medio diario. Esto suele suceder en los días de diario L-V pero no en fines de semana.

De hecho estoy desarrollando una automatización para este fin, pero tendría que calcular el precio medio, y sería más fácil si la integración me lo entrega.

Integration stopped working today

Hi, this integration stopped working today for me. I tried to reload it, to delete and create it again but no luck.

It seems it’s not retrieving data from url.

Problemas con el cambio horario

Hoy se ha cambiado la hora y la tarjeta no visualiza bien la gráfica al faltar la información de 02:00 a 03:00. Tampoco indica el valor máximo y mínimo de hoy.
Screenshot_2023-03-26-16-59-48-707_io homeassistant companion android-edit
Tampoco funciona, tocando la gráfica, que muestre el precio de una hora determinada.

Dropdown selector for sensor not working in recent HA versions

Instead of a dropdown to select the sensor, a list of sensors is displayed that doesn't work when clicking it (it doesn't change the chosen sensor. If the list worked, it would be ok):

image

I think a recent HA version broke these dropdowns and some addons/cards need to be updated.

It can be corrected in yaml mode, but impossible in UI mode (plus, the wrong sensor will remain selected, making the graph not work.

Thank you, loving the graph!

Graph not shown since HA 2021.7

Hello all

Just updated HA to 2021.7 beta2 version (it includes updated PVPC integration home-assistant/core#51789 ) and the graph shown in this card has stopped to be visible:
image

Other attributes are shown properly. Only the graph seems to be failing after upgrade.

I've just tried with latests stable versions of Firefox and Edge (Chromium based) with no improvement. Browser cache has also been deleted.

I've just noted HA graphs are now slighty different from what they used to be (different colors are used now for instance) so I'm not sure if it could be some change under the hood regarding them it could impact on your card.

Thank you in advance!

Feature request: Add current hour to the graph

I think it will be interesting to add some kind of symbol to the graph, in this way we can see directly at which point we are, without looking at the hour. Maybe a simple vertical line in the current hour, or a change in the background color dividing the past and the future will be enough.
Or maybe the result is very bad, I can't say. :)

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.