# \[APP\]\[Pro\] Power by the Hour: Insights per hour, day, month and year

**URL:** <https://community.homey.app/t/app-pro-power-by-the-hour-insights-per-hour-day-month-and-year/20535>\
**Category:** Apps\
**Tags:** app, tools\
**Created:** [November 10, 2019, 10:06pm UTC](https://community.homey.app/t/app-pro-power-by-the-hour-insights-per-hour-day-month-and-year/20535 "2019-11-10T22:06:03Z")\
**Posts on this page:** 20\
**Page:** 127

<div class="post-metadata">

**Author:** ![Antohagg](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/antohagg/32/48013_2.png) [@Antohagg](https://community.homey.app/u/Antohagg)\
**Post date:** [October 17, 2024, 1:12pm UTC](https://community.homey.app/t/app-pro-power-by-the-hour-insights-per-hour-day-month-and-year/20535/2576 "2024-10-17T13:12:56Z")

</div>

I guess this could be done with two flows. One that runs each new day that calculate the diff between max price and min price and store the value in a variable. The other flow runs each new hour and calculates the gain value.

daypricediff = maxdayprice-mindayprice

gain= (maxdayprice-currentprice)/daypricediff

this will give a zero value when currentprice=maxdayprice and one when currentprice=mindayprice like you specified in the post.

---

<div class="post-metadata">

**Author:** ![peltsi51](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peltsi51/32/12564_2.png) [@peltsi51](https://community.homey.app/u/peltsi51)\
**Post date:** [October 17, 2024, 2:50pm UTC](https://community.homey.app/t/app-pro-power-by-the-hour-insights-per-hour-day-month-and-year/20535/2577 "2024-10-17T14:50:07Z")

</div>

Sorry missed that completely. I can work with that. 👍

---

<div class="post-metadata">

**Author:** ![peltsi51](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peltsi51/32/12564_2.png) [@peltsi51](https://community.homey.app/u/peltsi51)\
**Post date:** [October 17, 2024, 3:05pm UTC](https://community.homey.app/t/app-pro-power-by-the-hour-insights-per-hour-day-month-and-year/20535/2578 "2024-10-17T15:05:13Z")

</div>

Just clarification. Is the rank so that lower value is higher price or other way around?

---

<div class="post-metadata">

**Author:** ![Gruijter](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/gruijter/32/1973_2.png) [@Gruijter](https://community.homey.app/u/Gruijter)\
**Post date:** [October 17, 2024, 3:05pm UTC](https://community.homey.app/t/app-pro-power-by-the-hour-insights-per-hour-day-month-and-year/20535/2579 "2024-10-17T15:05:56Z")

</div>

> [@peltsi51](#):
>
> other way around

1 is lowest price

---

<div class="post-metadata">

**Author:** ![peltsi51](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peltsi51/32/12564_2.png) [@peltsi51](https://community.homey.app/u/peltsi51)\
**Post date:** [October 17, 2024, 3:08pm UTC](https://community.homey.app/t/app-pro-power-by-the-hour-insights-per-hour-day-month-and-year/20535/2580 "2024-10-17T15:08:50Z")

</div>

Good idea, I already made that.

But there is a scaling problem. When there is days that have for example high price in every other hour but one. The scaling then makes that only on that one hour would have the gain value 1 and all others are close to 0. If one uses this for heating control the house would be cold 😉

---

<div class="post-metadata">

**Author:** ![peltsi51](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peltsi51/32/12564_2.png) [@peltsi51](https://community.homey.app/u/peltsi51)\
**Post date:** [October 17, 2024, 3:13pm UTC](https://community.homey.app/t/app-pro-power-by-the-hour-insights-per-hour-day-month-and-year/20535/2581 "2024-10-17T15:13:59Z")

</div>

I have also missed that this app has the possibility to add a “extra time of day markup”. This is excelent feature. Thanks @Gruijter for developing this app constantly. 👍

---

<div class="post-metadata">

**Author:** ![Gruijter](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/gruijter/32/1973_2.png) [@Gruijter](https://community.homey.app/u/Gruijter)\
**Post date:** [October 17, 2024, 3:42pm UTC](https://community.homey.app/t/app-pro-power-by-the-hour-insights-per-hour-day-month-and-year/20535/2582 "2024-10-17T15:42:53Z")

</div>

> [@peltsi51](#):
>
> only on that one hour would have the gain value 1 and all others are close to 0

Not true. The ranking has no weight. So 1 cheap hour and 23 expensive hours still has each hour ranking 1 through 24. So say you want 6 hours of heating per day, just select all ranks below 7 ( which is equal to selecting the 6 cheapest hours of the day) , and weigh the actual hour e.g. as 1/rank). Or whatever weighting scheme you can come up with, such as 3/(rank+2).

Or go for the scheme @Antohagg suggested

---

<div class="post-metadata">

**Author:** ![Gruijter](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/gruijter/32/1973_2.png) [@Gruijter](https://community.homey.app/u/Gruijter)\
**Post date:** [October 17, 2024, 3:44pm UTC](https://community.homey.app/t/app-pro-power-by-the-hour-insights-per-hour-day-month-and-year/20535/2583 "2024-10-17T15:44:14Z")

</div>

Many thanks for your kind donation @peltsi51 ❤🍻

---

<div class="post-metadata">

**Author:** ![Antohagg](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/antohagg/32/48013_2.png) [@Antohagg](https://community.homey.app/u/Antohagg)\
**Post date:** [October 17, 2024, 4:23pm UTC](https://community.homey.app/t/app-pro-power-by-the-hour-insights-per-hour-day-month-and-year/20535/2584 "2024-10-17T16:23:50Z")

</div>

That means that you want the gain value to be centered around the average price? I.e. temperature to be set to 21 degrees when you have the average price.  
Not sure if this is the simplest formula but it might work.

Flow1(run at midnight):  
daypricediffaboveaverage = maxdayprice-averagedayprice

daypricediffbelowaverage = averagedayprice -mindayprice

Flow2(run every hour):  
Use a condition to check if current price is equal or above average then use this formula to calculate gain

gain = ((maxdayprice-currentprice)/daypricediffaboveaverage)/2

else

gain =(((mindayprice-currentprice)/daypricediffbelowaverage)/2)+1

This will give a zero value when currentprice=maxdayprice and one when currentprice=mindayprice and 0.5 when you hit averagedayprice

btw, sorry for all the edits, on my mobile so cant test it out.

---

<div class="post-metadata">

**Author:** ![Aivis\_Balodis](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/aivis_balodis/32/116632_2.png) [@Aivis\_Balodis](https://community.homey.app/u/Aivis_Balodis)\
**Post date:** [October 17, 2024, 9:33pm UTC](https://community.homey.app/t/app-pro-power-by-the-hour-insights-per-hour-day-month-and-year/20535/2585 "2024-10-17T21:33:02Z")

</div>

Tomorrow’s electricity price data has not been updated 🫤

 ![IMG_2304](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/8/c/8c91fb7149585106329b5e8cd1558beb9e005f4c.jpeg)

---

<div class="post-metadata">

**Author:** ![Jari\_Peuhkurinen](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jari_peuhkurinen/32/101312_2.png) [@Jari\_Peuhkurinen](https://community.homey.app/u/Jari_Peuhkurinen)\
**Post date:** [October 18, 2024, 11:59am UTC](https://community.homey.app/t/app-pro-power-by-the-hour-insights-per-hour-day-month-and-year/20535/2586 "2024-10-18T11:59:24Z")

</div>

Again problems with price updates. Prices update, but not every hour, they update between hours…

Another thing I’ve noticed is that when restarting Homey it takes a few hours for the prices to update regularly. Restarting the app won’t help.

Is the problem in the app or in price data?

Processing: 1000020502.jpg…

---

<div class="post-metadata">

**Author:** ![Gruijter](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/gruijter/32/1973_2.png) [@Gruijter](https://community.homey.app/u/Gruijter)\
**Post date:** [October 18, 2024, 12:19pm UTC](https://community.homey.app/t/app-pro-power-by-the-hour-insights-per-hour-day-month-and-year/20535/2587 "2024-10-18T12:19:10Z")

</div>

It seems the entsoe api is being migrated to a new version. Will need time to find out what they are doing.

---

<div class="post-metadata">

**Author:** ![Satoer](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/satoer/32/38113_2.png) [@Satoer](https://community.homey.app/u/Satoer)\
**Post date:** [October 18, 2024, 12:38pm UTC](https://community.homey.app/t/app-pro-power-by-the-hour-insights-per-hour-day-month-and-year/20535/2588 "2024-10-18T12:38:38Z")

</div>

Hoi Robin,

I’ve got a reply from the developer of the Growatt (and Solar edge) modbus app:

> [@\[APP\]\[Pro\] SolarEdge + Growatt TCP modbus](https://community.homey.app/t/app-pro-solaredge-growatt-tcp-modbus/45487/1167):
>
> are these measure\_battery or battery not ok [solaredge.modbus/drivers/growattwithbatt\_tl/driver.compose.json at main · biemond/solaredge.modbus · GitHub](https://github.com/biemond/solaredge.modbus/blob/main/drivers/growattwithbatt_tl/driver.compose.json#L29C1-L30C23)? plus these “measure\_power”, “measure\_power.input”, “measure\_power.gridoutput”, “measure\_power.pv1input”, “measure\_power.pv2input”, “measure\_power.houseload”,

Is this enough information to get the Growatt Battery system added to PBTH-battery?

---

<div class="post-metadata">

**Author:** ![Gruijter](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/gruijter/32/1973_2.png) [@Gruijter](https://community.homey.app/u/Gruijter)\
**Post date:** [October 18, 2024, 2:55pm UTC](https://community.homey.app/t/app-pro-power-by-the-hour-insights-per-hour-day-month-and-year/20535/2589 "2024-10-18T14:55:49Z")

</div>

mmh. not clear to me what they represent. When I dont forget I will contact him for clarification.

---

<div class="post-metadata">

**Author:** ![Gruijter](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/gruijter/32/1973_2.png) [@Gruijter](https://community.homey.app/u/Gruijter)\
**Post date:** [October 18, 2024, 2:58pm UTC](https://community.homey.app/t/app-pro-power-by-the-hour-insights-per-hour-day-month-and-year/20535/2590 "2024-10-18T14:58:43Z")

</div>

ENTSOE is indeed migrating their API. I now implemented a change to support the new API, but there seems to be a bug on their end. Any day that has consecutive hourly prices that EXACTLY match are skipped in the response. This messes up the data and thus PBTH disregards it all.

I contacted ENTSOE support about this and am awaiting their response…

---

<div class="post-metadata">

**Author:** ![Gruijter](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/gruijter/32/1973_2.png) [@Gruijter](https://community.homey.app/u/Gruijter)\
**Post date:** [October 18, 2024, 3:03pm UTC](https://community.homey.app/t/app-pro-power-by-the-hour-insights-per-hour-day-month-and-year/20535/2591 "2024-10-18T15:03:09Z")

</div>

new version 6.6.3 available for testing: [Power by the Hour App for Homey | Homey](https://homey.app/a/com.gruijter.powerhour/test/)

- Added flow compare to monthly average (thx @Antohagg !)
- New ENTSO-E API implemented.
- Fix JSON example. (thx @ Anna Steinsaphir !)
- homey-api@3.6.3

---

<div class="post-metadata">

**Author:** ![Aivis\_Balodis](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/aivis_balodis/32/116632_2.png) [@Aivis\_Balodis](https://community.homey.app/u/Aivis_Balodis)\
**Post date:** [October 18, 2024, 3:20pm UTC](https://community.homey.app/t/app-pro-power-by-the-hour-insights-per-hour-day-month-and-year/20535/2592 "2024-10-18T15:20:47Z")

</div>

Thank you [Gruijter](https://community.homey.app/u/Gruijter) for your work!  
After update, no changes - today’s electricity market prices are not renewed.  
Do they have to be restored instantly, or do they have to wait a while?

---

<div class="post-metadata">

**Author:** ![Gruijter](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/gruijter/32/1973_2.png) [@Gruijter](https://community.homey.app/u/Gruijter)\
**Post date:** [October 18, 2024, 3:33pm UTC](https://community.homey.app/t/app-pro-power-by-the-hour-insights-per-hour-day-month-and-year/20535/2593 "2024-10-18T15:33:22Z")

</div>

See this [[APP][Pro] Power by the Hour: Insights per hour, day, month and year - #2590 by Gruijter](https://community.homey.app/t/app-pro-power-by-the-hour-insights-per-hour-day-month-and-year/20535/2590)

---

<div class="post-metadata">

**Author:** ![DidierVU](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/didiervu/32/12458_2.png) [@DidierVU](https://community.homey.app/u/DidierVU)\
**Post date:** [October 19, 2024, 7:50am UTC](https://community.homey.app/t/app-pro-power-by-the-hour-insights-per-hour-day-month-and-year/20535/2594 "2024-10-19T07:50:00Z")

</div>

I want to measure the total energy usage of my home, ignoring the solarpower output.

 ![IMG_4864](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/8/d/8dc381ca67d04e5caf977ab4e59e378052d5ebb8.jpeg)

The energy card output is exactly what this does: total energy EM + solarpanel outpt.  
But I can’t seem to use this value in Power by the hour?

HOMEY\_ENERGY\_SMARTMETER is returning negative values:

 ![IMG_4865](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/6/5/65b51588fd65d1e486edd9a40967f48fd023b982.jpeg)

How can I use the total like in the card/widget above? Can I use a logic variable to send the current usage (so energy EM + solar output EM) to a PBTH device?

---

<div class="post-metadata">

**Author:** ![Eternity](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/eternity/32/102113_2.png) [@Eternity](https://community.homey.app/u/Eternity)\
**Post date:** [October 19, 2024, 11:04am UTC](https://community.homey.app/t/app-pro-power-by-the-hour-insights-per-hour-day-month-and-year/20535/2595 "2024-10-19T11:04:50Z")

</div>

I am replacing my current P1 reader with another brand P1 reader.

It would be great if the historical data from the old P1 devices in PBTH (gas and electricity) can be ported to the new P1 meter.

Can I update the P1 source in the current PBTH devices? What would be the best approach?

[Previous page](https://community.homey.app/t/app-pro-power-by-the-hour-insights-per-hour-day-month-and-year/20535.md?page=126)

[Next page](https://community.homey.app/t/app-pro-power-by-the-hour-insights-per-hour-day-month-and-year/20535.md?page=128)
