Gå til innhold
  • Bli medlem
Støtt hjemmeautomasjon.no!

JAH

Medlemmer
  • Innlegg

    2
  • Ble med

  • Besøkte siden sist

Alt skrevet av JAH

  1. Jeg løste det med å samle følgende i en linje: {% if now().weekday() in (0,1,2,3,4) %} {% if now().hour >=6 and now().hour <22 %} additional_costs: '{% set s = { "grid_day": 0.4310, "grid_night_weekend": 0.3685, "grid_yearly_cost": 2400, "psub_monthly_cost": 49, "psub_kwh_cost": 0.0695 } %} {% if now().weekday() in (0,1,2,3,4) and now().hour >=6 and now().hour <22 %} {% set fixed_cost = (((s.grid_yearly_cost+(12*s.psub_monthly_cost))/365)/24)|float %}{{(s.grid_day+s.psub_kwh_cost)+fixed_cost|float }} {% else %} {% set fixed_cost = (((s.grid_yearly_cost+(12*s.psub_monthly_cost))/365)/24)|float %}{{(s.grid_night_weekend+s.psub_kwh_cost)+fixed_cost|float }} {% endif %}'
  2. Hei Jeg trenger litt hjelp med additional costs. Har søkt litt rundt, kopiert litt kode og kommet frem til dette, som baserer seg på Elvia og min strøm leverandør. I configuration.yaml : additional_costs: '{% set s = { "grid_day": 0.4310, "grid_night_weekend": 0.3685, "grid_yearly_cost": 2400, "psub_monthly_cost": 49, "psub_kwh_cost": 0.6950 } %} {% if now().weekday() in (0,1,2,3,4) %} {% if now().hour >=6 and now().hour <22 %} {% set fixed_cost = (((s.grid_yearly_cost+(12*s.psub_monthly_cost))/365)/24)|float %}{{(s.grid_day+s.psub_kwh_cost)+fixed_cost|float }} {% else %} {% set fixed_cost = (((s.grid_yearly_cost+(12*s.psub_monthly_cost))/365)/24)|float %}{{(s.grid_night_weekend+s.psub_kwh_cost)+fixed_cost|float }} {% endif %} {% endif %}' Det ser ut om koden etter "else" ikke blir kjørt, så får ikke noe verdi i helga.
×
×
  • Opprett ny...

Viktig informasjon

Vi har plassert informasjonskapsler/cookies på din enhet for å gjøre denne siden bedre. Du kan justere dine innstillinger for informasjonskapsler, ellers vil vi anta at dette er ok for deg.