samples please
How are you guys getting the hourly weather forecast. I only get a weather entity but not the hourly ?!
It depends on which weather service integration you are using. I’m using met.no and it has 2 entities, one for daily forecast and one for hourly.
I also use met.no and only get 1 entity ?
That’s strange, I don’t remember anything special to get the hourly entity. Is it by any chance disabled by default and needs to be enabled? Or anything to do with location (I’m in Sweden).
Here are good examples on how to do that:
i tried this (see #94) in your link. at the moment it doesnt work for me.
I tried to remove and re-install it a few times but nothing. The strange thing is that I get the hourly forecast when I click on the entity in the entity explorer. But I have not found a way to actually access this data.
Yeah I have that to, but also a separate entity with just the hourly forecast.
I see now that when I add another I only get the one entity:
So my original integration “Home” has 2 separate entities, where I can use the hourly entity to get forecast for my display. The test “Work” does not. Something must have changed with the integration since I set up my original one.
Thanks for checking
Create sensors for each hour.
For example like this
template:
- trigger:
- platform: time_pattern
hours: /1
action:
- service: weather.get_forecast
target:
entity_id: weather.forecast_testy
data:
type: hourly
response_variable: forecast
sensor:
- name: Počasí teplota hodinově 1
unique_id: teplota_pocasi_hodina_1
state: "{{ forecast.forecast[0].temperature }}"
- name: Počasí teplota hodinově 2
unique_id: teplota_pocasi_hodina_2
state: "{{ forecast.forecast[1].temperature }}"
- name: Počasí teplota hodinově 3
.................
....................
@eemceebee and @Zinken
You both are caught in a change that was introduced with the last update. It is the change to eliminate the forecast attributes out of the weather entity to its own entity (forecast attribute vs forecast entity).
There are numerous topics about this, here is a link to one of my posts, with a try to explain that a little. Take a look at that post, and the whole topic as well.
hmm I basically copy pasted the code and I though after reading this : Weather - Home Assistant it should work, but I only have every element being unknown. Do I have to tell this that I am using met.no ?
hmm I basically copy pasted the code and I though after reading this : Weather - Home Assistant it should work, but I only have every element being unknown. Do I have to tell this that I am using met.no ?
Have you put your own weather entity in your code?
Not sure what I was doing wrong. Maybe a typo, but now it works. Thanks
How did it works out? I’m interseting in it aswell. If you have something, can you share your code? Thanks!
I unfortunately did not get the graph component to work.
In the end I solved it by just drawing rectangles:
The code:
int bar_size = 33;
it.rectangle(x_offset+(bar_size*0), y_offset-id(electricity_price).state*100, bar_size, id(electricity_price).state*100);
it.rectangle(x_offset+(bar_size*1), y_offset-id(electricity_price_1h).state*100, bar_size, id(electricity_price_1h).state*100);
it.rectangle(x_offset+(bar_size*2), y_offset-id(electricity_price_2h).state*100, bar_size, id(electricity_price_2h).state*100);
it.rectangle(x_offset+(bar_size*3), y_offset-id(electricity_price_3h).state*100, bar_size, id(electricity_price_3h).state*100);
it.rectangle(x_offset+(bar_size*4), y_offset-id(electricity_price_4h).state*100, bar_size, id(electricity_price_4h).state*100);
it.rectangle(x_offset+(bar_size*5), y_offset-id(electricity_price_5h).state*100, bar_size, id(electricity_price_5h).state*100);
it.rectangle(x_offset+(bar_size*6), y_offset-id(electricity_price_6h).state*100, bar_size, id(electricity_price_6h).state*100);
it.rectangle(x_offset+(bar_size*7), y_offset-id(electricity_price_7h).state*100, bar_size, id(electricity_price_7h).state*100);
it.rectangle(x_offset+(bar_size*8), y_offset-id(electricity_price_8h).state*100, bar_size, id(electricity_price_8h).state*100);
it.rectangle(x_offset+(bar_size*9), y_offset-id(electricity_price_9h).state*100, bar_size, id(electricity_price_9h).state*100);
it.rectangle(x_offset+(bar_size*10), y_offset-id(electricity_price_10h).state*100, bar_size, id(electricity_price_10h).state*100);
it.rectangle(x_offset+(bar_size*11), y_offset-id(electricity_price_11h).state*100, bar_size, id(electricity_price_11h).state*100);
it.printf(x_offset+(bar_size*0)+(bar_size/2), y_offset, id(font_small), TextAlign::BOTTOM_CENTER, "%.0f", id(electricity_price).state*100);
it.printf(x_offset+(bar_size*1)+(bar_size/2), y_offset, id(font_small), TextAlign::BOTTOM_CENTER, "%.0f", id(electricity_price_1h).state*100);
it.printf(x_offset+(bar_size*2)+(bar_size/2), y_offset, id(font_small), TextAlign::BOTTOM_CENTER, "%.0f", id(electricity_price_2h).state*100);
it.printf(x_offset+(bar_size*3)+(bar_size/2), y_offset, id(font_small), TextAlign::BOTTOM_CENTER, "%.0f", id(electricity_price_3h).state*100);
it.printf(x_offset+(bar_size*4)+(bar_size/2), y_offset, id(font_small), TextAlign::BOTTOM_CENTER, "%.0f", id(electricity_price_4h).state*100);
it.printf(x_offset+(bar_size*5)+(bar_size/2), y_offset, id(font_small), TextAlign::BOTTOM_CENTER, "%.0f", id(electricity_price_5h).state*100);
it.printf(x_offset+(bar_size*6)+(bar_size/2), y_offset, id(font_small), TextAlign::BOTTOM_CENTER, "%.0f", id(electricity_price_6h).state*100);
it.printf(x_offset+(bar_size*7)+(bar_size/2), y_offset, id(font_small), TextAlign::BOTTOM_CENTER, "%.0f", id(electricity_price_7h).state*100);
it.printf(x_offset+(bar_size*8)+(bar_size/2), y_offset, id(font_small), TextAlign::BOTTOM_CENTER, "%.0f", id(electricity_price_8h).state*100);
it.printf(x_offset+(bar_size*9)+(bar_size/2), y_offset, id(font_small), TextAlign::BOTTOM_CENTER, "%.0f", id(electricity_price_9h).state*100);
it.printf(x_offset+(bar_size*10)+(bar_size/2), y_offset, id(font_small), TextAlign::BOTTOM_CENTER, "%.0f", id(electricity_price_10h).state*100);
it.printf(x_offset+(bar_size*11)+(bar_size/2), y_offset, id(font_small), TextAlign::BOTTOM_CENTER, "%.0f", id(electricity_price_11h).state*100);
it.printf(x_offset+(bar_size*0)+(bar_size/2), y_offset, id(font_small_bold), TextAlign::TOP_CENTER, "%2.0f", id(time_hour).state);
it.printf(x_offset+(bar_size*1)+(bar_size/2), y_offset, id(font_small_bold), TextAlign::TOP_CENTER, "%2.0f", id(time_hour_1h).state);
it.printf(x_offset+(bar_size*2)+(bar_size/2), y_offset, id(font_small_bold), TextAlign::TOP_CENTER, "%2.0f", id(time_hour_2h).state);
it.printf(x_offset+(bar_size*3)+(bar_size/2), y_offset, id(font_small_bold), TextAlign::TOP_CENTER, "%2.0f", id(time_hour_3h).state);
it.printf(x_offset+(bar_size*4)+(bar_size/2), y_offset, id(font_small_bold), TextAlign::TOP_CENTER, "%2.0f", id(time_hour_4h).state);
it.printf(x_offset+(bar_size*5)+(bar_size/2), y_offset, id(font_small_bold), TextAlign::TOP_CENTER, "%2.0f", id(time_hour_5h).state);
it.printf(x_offset+(bar_size*6)+(bar_size/2), y_offset, id(font_small_bold), TextAlign::TOP_CENTER, "%2.0f", id(time_hour_6h).state);
it.printf(x_offset+(bar_size*7)+(bar_size/2), y_offset, id(font_small_bold), TextAlign::TOP_CENTER, "%2.0f", id(time_hour_7h).state);
it.printf(x_offset+(bar_size*8)+(bar_size/2), y_offset, id(font_small_bold), TextAlign::TOP_CENTER, "%2.0f", id(time_hour_8h).state);
it.printf(x_offset+(bar_size*9)+(bar_size/2), y_offset, id(font_small_bold), TextAlign::TOP_CENTER, "%2.0f", id(time_hour_9h).state);
it.printf(x_offset+(bar_size*10)+(bar_size/2), y_offset, id(font_small_bold), TextAlign::TOP_CENTER, "%2.0f", id(time_hour_10h).state);
it.printf(x_offset+(bar_size*11)+(bar_size/2), y_offset, id(font_small_bold), TextAlign::TOP_CENTER, "%2.0f", id(time_hour_11h).state);
As you can see, both prices and hours come from home assistant sensors.
I still need to fix those price rounding differences that cause the 0 line to jump by 1 pixel.
Thanks for your reply. I will look into that
That looks amazing!
Would you consider assembling and coding 1 setup as a commision? I’m willing to pay for a good setup like this.