Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Template for deduction of fees above a certain usage #179

Closed
3liasen opened this issue Jan 8, 2023 · 7 comments
Closed

Template for deduction of fees above a certain usage #179

3liasen opened this issue Jan 8, 2023 · 7 comments
Labels
documentation Improvements or additions to documentation

Comments

@3liasen
Copy link

3liasen commented Jan 8, 2023

It would be an excellent feature, if it's possible to implement e.g. a tick box, stating that there's a deduction in costs due to reduced costs when consumption is over 4000 kWh per year.

@3liasen 3liasen added the feature request New feature or enhancement label Jan 8, 2023
@MTrab
Copy link
Owner

MTrab commented Jan 8, 2023

This needs to be in a template - it's nearly impossible to make this smart in any other ways.

@MTrab MTrab added documentation Improvements or additions to documentation and removed feature request New feature or enhancement labels Jan 8, 2023
@MTrab MTrab changed the title [FR]: Implementation of reduced costs when consumption exceeds 4000 kWh per year Template for deduction of fees above a certain usage Jan 8, 2023
@woopstar
Copy link

woopstar commented Feb 10, 2023

If you have a sensor that counts the amount of power users per month, you can use this template with version 1.2.3

{% if states("sensor.hovedforsyning_energy_total_current_month") | float > 334 and now().month > 6 %}
  {% set reduction = ( el_afgift - 0.008 ) | float(0) %}
{% endif %}

{{ 0.012 - reduction|default(0) | float(0) }}

@3liasen
Copy link
Author

3liasen commented Feb 10, 2023

Thanks, Andreas. Right now I'm using the template example from the Wiki {{0.03544|float}}, and coincidentally I'm using Norlys FlexEl as well, so it works fine.

If I understand this right, I should be able to use your template (which this second is also available after @MTrab has updated her Wiki). Already updated to v1.2.3

Thank you both!!! No more 200 line templates for me. ;-)

@MTrab
Copy link
Owner

MTrab commented Feb 10, 2023

Fixed by #261 and a great bit of help in #259 (Thanks @woopstar )

@MTrab MTrab closed this as completed Feb 10, 2023
@DK-MGO
Copy link

DK-MGO commented Jan 31, 2024

Hello,

Would it be possible for someone to write a small how-to for combining:

I guess the first is entered into the setup UI for Energi Data Service, but then how do I use the second?

Thank you!

@woopstar
Copy link

Hello,

Would it be possible for someone to write a small how-to for combining:

I guess the first is entered into the setup UI for Energi Data Service, but then how do I use the second?

Thank you!

Just change the pricing in the last URL to match the price from first URL in this part:

{{ 0.012 - reduction | default(0) | float(0) }}

The 0.012 equals Vindstød VEStrøm

@DK-MGO
Copy link

DK-MGO commented Jan 31, 2024

Thank you for the swift reply, and pardon if I am a bit slow...

But I update the template from the first URL to fit with my electricity provider:
`{% set costs = {
"elafgift": 0.763,
"nettarif_lav": 0.1636,
"nettarif_spids": 0.4537,
"abonnement_net": 0.09425,
"eltillaeg_ellev": 0.07,
"abonnement_ellev": 0.725
} %}

{% if now().month >= 10 or now().month < 4 %}
{% if now().hour >= 17 and now().hour < 20 %}
{{
costs.elafgift +
costs.nettarif_spids +
costs.abonnement_net +
costs.eltillaeg_ellev +
costs.abonnement_ellev
}}
{% else %}
{{
costs.elafgift +
costs.nettarif_lav +
costs.abonnement_net +
costs.eltillaeg_ellev +
costs.abonnement_ellev
}}
{% endif %}
{% else %}
{{
costs.elafgift +
costs.nettarif_lav +
costs.abonnement_net +
costs.eltillaeg_ellev +
costs.abonnement_ellev
}}
{% endif %}`

and paste that in here:
image

But what do I do with this?
{{ 0.012 - reduction | default(0) | float(0) }}

or more specifically with this:
`{% if states("sensor.hovedforsyning_energy_total_current_month") | float > 334 %}
{% set reduction = ( el_afgift - 0.008 ) | float(0) %}
{% endif %}

{{ 0.012 - reduction | default(0) | float(0) }}`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

4 participants