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

Q: Additional Cost based on date #376

Open
boelle opened this issue Apr 13, 2024 · 3 comments
Open

Q: Additional Cost based on date #376

boelle opened this issue Apr 13, 2024 · 3 comments

Comments

@boelle
Copy link

boelle commented Apr 13, 2024

is it possible to add extra cost depending on date?

for winter 1-10 to 1-4 i have 3 tarif prices depending on time of day

image

for summer from 1-4 to 1-10 i have 3 other prices

image

if its possible can you give an example?

@boelle
Copy link
Author

boelle commented Apr 13, 2024

think i found it in example 5... will give it a go and close this one if it works

EDIT: Sanity check..... do this look right? not sure on the else and if's

{% set s = {
    "hourly_fixed_cost": 0.0,
    "summer_night": 7.35,
    "summer_day": 11.03,
    "summer_eve": 28.67, 
    "winter_night": 7.35,
    "winter_day": 22.06,
    "winter_eve": 66.17,
    "cert": 0.0
}
%}
{% if now().month >= 4 and now().month < 10 %}
    {% if now().hour >= 0 and now().hour < 6 %}
        {{ s.summer_night + s.hourly_fixed_cost + s.cert | float }}
    {% else %}
    {% if now().hour >= 6 and now().hour < 17 %}
        {{ s.summer_day + s.hourly_fixed_cost + s.cert | float }}
    {% else %}
    {% if now().hour >= 17 and now().hour < 21 %}
        {{ s.summer_eve + s.hourly_fixed_cost + s.cert | float }}
    {% else %}
    {% if now().hour >= 21 and now().hour < 24 %}
        {{ s.summer_day + s.hourly_fixed_cost + s.cert | float }}
    {% endif %}
{% else %}
    {% if now().hour >= 0 and now().hour < 6 %}
        {{ s.winter_night + s.hourly_fixed_cost + s.cert | float }}
    {% else %}
    {% if now().hour >= 6 and now().hour < 17 %}
        {{ s.winter_day + s.hourly_fixed_cost + s.cert | float }}
    {% else %}
    {% if now().hour >= 17 and now().hour < 21 %}
        {{ s.winter_eve + s.hourly_fixed_cost + s.cert | float }}
    {% else %}
    {% if now().hour >= 21 and now().hour < 24 %}
        {{ s.winter_day + s.hourly_fixed_cost + s.cert | float }}
    {% endif %}
{% endif %}

@boelle
Copy link
Author

boelle commented Apr 13, 2024

or is this correct?

{% set s = {
    "hourly_fixed_cost": 0.0,
    "summer_night": 5.88,
    "summer_day": 8.82,
    "summer_eve": 22.94, 
    "winter_night": 5.88,
    "winter_day": 17.64,
    "winter_eve": 52.93,
    "cert": 0.0
}
%}
{% if now().month >= 4 and now().month < 10 %}
    {% if now().hour >= 0 and now().hour < 6 %}
        {{ s.summer_night + s.hourly_fixed_cost + s.cert | float }}
    {% elif now().hour >= 6 and now().hour < 17 %}
        {{ s.summer_day + s.hourly_fixed_cost + s.cert | float }}
    {% elif now().hour >= 17 and now().hour < 21 %}
        {{ s.summer_eve + s.hourly_fixed_cost + s.cert | float }}
    {% elif now().hour >= 21 and now().hour < 24 %}
        {{ s.summer_day + s.hourly_fixed_cost + s.cert | float }}
    {% endif %}
{% else %}
    {% if now().hour >= 0 and now().hour < 6 %}
        {{ s.winter_night + s.hourly_fixed_cost + s.cert | float }}
    {% elif now().hour >= 6 and now().hour < 17 %}
        {{ s.winter_day + s.hourly_fixed_cost + s.cert | float }}
    {% elif now().hour >= 17 and now().hour < 21 %}
        {{ s.winter_eve + s.hourly_fixed_cost + s.cert | float }}
    {% elif now().hour >= 21 and now().hour < 24 %}
        {{ s.winter_day + s.hourly_fixed_cost + s.cert | float }}
    {% endif %}
{% endif %}

Q... how would i add a fixed fee for each kwh on top of this? is that what hourly fixed cost is for?

@boelle
Copy link
Author

boelle commented Apr 14, 2024

@Hellowlol can you help out? ie am i correct or far off track?

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

No branches or pull requests

1 participant