I’m trying to get the solcast integration going, and even though I’ve tried it before, I’m coming up blank with how to install it. I’ve used HACS for the install, and the integration is sitting there, but clicking on it only gives me an info screen. How do I start it and supply the API key etc?
I made a guide here
Thanks - that did it.
@del13r since many things have changed since you posted the guide, the sensor now can be set up from UI etc. can you upgrade your guide to make it easier for the newbies
power bill guide. Already added solcast solar forecast (although it is not being maintained right now)
Integration - Riemann sum integral - Home Assistant
I was talking about helpers e.g Riemann sum integral and Utility Meter - Home Assistant
Ah right, I see.
I have learned something new today.
I may update this in the future to include GUI instructions, but am also hesitant as my setup is working just the way I like it at the moment.
The thought of spending the time with the possibility of breaking my already perfect working setup just to update a guide is a bit daunting.
Was there anything with in particular that was hardest for newbies?
for e.g if my peak cost is Pkr 16 is this how I should setup my sensor
- sensor:
- name: Tariff Price
unit_of_measurement: Pkr/kWh
state: >
{{ 16}}
- sensor:
- name: Energy Cost
device_class: monetary
state_class: measurement
unit_of_measurement: Pkr
state: >
{{ (states('sensor.daily_energy_Peak') | float * 16 | round(2) }}
Hi @del13r,
Thanks for sharing your cool and elaborate dashboard. I am inspired by it.
I am with Ausgrid and their rates are based on ‘working’ weekdays. So public holidays on Mon-Fri are shoulder during what would otherwise be peak. So the code I have used for a template sensor to get applicable rates are as below.
{#
Australian Ausgrid NSW Peak-shoulder-offpeak sensor defined
Peak rates:
From 2pm to 8 pm on working weekdays during 1 November and 31 March;
From 5pm to 9pm on working weekdays during 1 June to 31 August
Off-peak:
10pm to 7am
sholder: all other times
#}
{% set output = 'shoulder'%}
{% if ((now().month <= 3 or now().month >=11)
and (14 <= now().hour <= 19)) or
((6 <= now().month <= 8 )
and (17 <= now().hour <= 20)) and (now().weekday()<6) %}
{%set output = 'peak'%}
{%else %}
{%if now().hour>= 22 or now().hour < 7 %}
{% set output = 'offpeak' %}
{%endif %}
{%endif %}
{#if public holiday when peak does not apply #}
{# define public holidays falling on weekdays as a list of lists ['yyyy','mm','dd']#}
{% set holidays =
[['2022','06','13'],['2022','10','03'],['2022','12','26'],['2022','12','27'],
['2023','01','02'],['2023','01','26'],['2023','04','07'],['2023','04','10'],
['2023','04','25'],['2023','06','12'],['2023','10','02'],['2023','12','25'],
['2023','12','26']]%}
{% set today_list = (now()|string)[0:10].split('-') %}
{# of peak rate time but public holiday, then shoulder rates apply #}
{% if output == 'peak' and today_list in holidays %}
{% set output = 'shoulder' %}
{%endif%}
{{output}}
Please correct me if I’m wrong here but don’t these automations to change the tariff only occur if home assistant is active at the time of the automation. I noticed this as we had a (rare) power outage that covered the transition from peak > shoulder, and the tariff didn’t change.
Is there a way to set the automation to trigger during a time window, instead of at the start of the time period?
Hi,
Right off the top of my head, I’m thinking that maybe a solution involving an if statement might be able to help in that case.
This link seems to be on the right track
I’ll be giving it some thought and research, however I’m still really only learning the basics of yaml syntax and homeassistant. This is currently week 1!
Do you think we could use this feature in the helper UI?
In the meantime I’ll get my head around the post you just linked.
The TOD integration would only help if every day was the same. Where it becomes less desirable is when you have different times for summer/winter peak. The if statement appears to be the best solution albeit I have not used it myself yet
that makes sense. I’ll include something along the lines of that if statement.
Just going through your code for my own uses (thanks!) - maybe I’m wrong here but it looks like you’re trying to test if it is Mon - Fri (where 0 = Mon and 6 = Sunday). This statement would be true for Saturday as well. Thought I’d point that out in case it’s still in your code (or I’m missing something).
I changed the if statement to be much simpler for my tariff at the moment (no seasonal conditions yet)
{% set output = 'shoulder'%}
{% if (17 <= now().hour <= 19) and (now().weekday()<5) %}
{%set output = 'peak'%}
{%else %}
{%if (now().hour>= 22 or now().hour < 7) or (now().weekday()>=5)%}
{% set output = 'offpeak' %}
{%endif %}
{%endif %}
{{output}}
I know I need to use this template to update the value of utility_meter.daily_energy
however that’s where I’ve hit a wall. The automations I have just change the tariff under separate conditions. Any hints?
Hi @alexeiw123,
Yes, you are right. I noticed that recently and fixed my code. ‘0’ is Monday, not Sunday as i had thought before.