# \[APP\]\[Pro\] Piggy Bank

**URL:** <https://community.homey.app/t/app-pro-piggy-bank/66677>\
**Category:** Apps\
**Tags:** app, tools, homey-pro\
**Created:** [July 29, 2022, 10:07pm UTC](https://community.homey.app/t/app-pro-piggy-bank/66677 "2022-07-29T22:07:19Z")\
**Posts on this page:** 20\
**Page:** 27

<div class="post-metadata">

**Author:** ![frodeheg](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/frodeheg/32/49010_2.png) [@frodeheg](https://community.homey.app/u/frodeheg)\
**Post date:** [February 17, 2023, 1:18am UTC](https://community.homey.app/t/app-pro-piggy-bank/66677/528 "2023-02-17T01:18:55Z")

</div>

Solar power support is [scheduled](https://github.com/frodeheg/no.sparegris/milestone/5), so it will come at some point.

There is a discussion in [this ticket](https://github.com/frodeheg/no.sparegris/issues/2) about how to add the support. Can you please enter the ticket and review / give your comments on how the ideas would fit your needs or if you have better ideas? I am still a bit in the wild on how to best support solar power.

Meanwhile you may be best off using flow-cards to set the price points and operating modes.

---

<div class="post-metadata">

**Author:** ![frodeheg](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/frodeheg/32/49010_2.png) [@frodeheg](https://community.homey.app/u/frodeheg)\
**Post date:** [February 23, 2023, 6:19am UTC](https://community.homey.app/t/app-pro-piggy-bank/66677/529 "2023-02-23T06:19:00Z")

</div>

## Version 0.20.1 is now available for [testing](https://homey.app/a/no.sparegris/test/)

**Major changes:**

- Added support for Belgian energy tariff
- Added energy limiters for day and month (Note for Norwegian users: **You need to enable this limit manually** if you want to be within the limit for ‘strømstøtte’ per month. Note that it will not be very accurate before we cross into March)

**Minor changes:**

- Added device support for:
  - com.ctmlyng.op:mtouch-one
  - net.filllip-namron:4512725
  - no.connecte:thermostat
  - net.filllip-namron:540139x

- Added note for sensibly devices.
- Added alarm to show when power is being limited.
- Fixed a bug that ran code after the insights device was deleted.
- Fixed a rare issue where the reported power could be negative after a restart.
- Fixed a bug that didn’t accumulate estimated power correctly in case of missing power reporting.
- Added Preview for functionality being added in version 0.21: Time schedules
- Removed incorrect feedback that extended logging was enabled.

---

<div class="post-metadata">

**Author:** ![Felix\_oslo](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/felix_oslo/32/33969_2.png) [@Felix\_oslo](https://community.homey.app/u/Felix_oslo)\
**Post date:** [February 23, 2023, 9:45pm UTC](https://community.homey.app/t/app-pro-piggy-bank/66677/530 "2023-02-23T21:45:16Z")

</div>

Thank you so much for a great app! I have some thermostats that I’d like to just turn off when the usage is too high, I do not want Piggy Bank to change any temperature. Then I have other thermostats that I’d like Piggy Bank to control the temperature on. Is it possible, or is it a function that is soon to come? As far as I can see, the only option now is to just turn on or off the temperature control option.

---

<div class="post-metadata">

**Author:** ![frodeheg](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/frodeheg/32/49010_2.png) [@frodeheg](https://community.homey.app/u/frodeheg)\
**Post date:** [February 23, 2023, 10:00pm UTC](https://community.homey.app/t/app-pro-piggy-bank/66677/531 "2023-02-23T22:00:36Z")

</div>

If you use the option “Turn on” and “Turn off” under "price control instead of “change temp” then the intent is that the temperature should not be touched. Have you tried this? (click the “change temp” icon to switch to “Turn on” and “Turn off”)

---

<div class="post-metadata">

**Author:** ![Felix\_oslo](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/felix_oslo/32/33969_2.png) [@Felix\_oslo](https://community.homey.app/u/Felix_oslo)\
**Post date:** [February 23, 2023, 10:06pm UTC](https://community.homey.app/t/app-pro-piggy-bank/66677/532 "2023-02-23T22:06:56Z")

</div>

I can choose “Off when crises”, “ignore”, or “Turn on”, and “Turn Off”. Is it “Off when crises” that maybe could be translated better? I understand that when the price is over ex High, “Off when crises” turns the thermostat off when the price limit is reached. “Ignore” makes Piggy Bank ignore the device, “Turn on” turns on the device when the price is high, and "Turn off " (since its gray) makes me think that it does nothing. Then again when you say what you do, I should try to choose Turn Off. But this is related to prices, I want to turn off then I use more power in total to avoid changing the “effect step”. Does the choice also affect this situation?

---

<div class="post-metadata">

**Author:** ![frodeheg](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/frodeheg/32/49010_2.png) [@frodeheg](https://community.homey.app/u/frodeheg)\
**Post date:** [February 23, 2023, 10:21pm UTC](https://community.homey.app/t/app-pro-piggy-bank/66677/533 "2023-02-23T22:21:08Z")

</div>

If you press the information button next to the “Action when the price is xxxx” you will see a description of all the different actions.

![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/f/0/f0cb5c3ef7553becc7fa863fea64bc8eb3c2ccb4.png)

The colouring is a way to indicate what is the the best way to use the app to earn money. If it’s green it will be controlled as good as possible, if it’s yellow then it means there is potential for you to improve the setting (by enabling temperature control). If it’s gray then there is nothing to control because it’s off or ignored.

> [@Felix\_oslo](#):
>
> I should try to choose Turn Off. But this is related to prices, I want to turn off then I use more power in total to avoid changing the “effect step”.

In this case you should not use “Turn Off”, just “Turn On” in replacement of “Change temp” because that will keep the device on as much as possible within the power limit and not touch the temperature.

---

<div class="post-metadata">

**Author:** ![Felix\_oslo](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/felix_oslo/32/33969_2.png) [@Felix\_oslo](https://community.homey.app/u/Felix_oslo)\
**Post date:** [February 23, 2023, 10:38pm UTC](https://community.homey.app/t/app-pro-piggy-bank/66677/534 "2023-02-23T22:38:22Z")

</div>

I have turned off the “Allow Temperature Control” under units to control. I think it should work if i choose “Turn off when crises”, that means that it turns off when the effect limit is reached, correct? I have many flows that turns on and off the thermostats in other situations like when leaving the home. If I choose Turn On, Piggy Bank would turn it on as soon as the usage is under the effect limit. Is this correct? I hope so… And if this is correct, I would really love to have the choice under Units Control (Allow Temperature control" to be possible to set under each unit. But thanks for a super duper app!

---

<div class="post-metadata">

**Author:** ![frodeheg](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/frodeheg/32/49010_2.png) [@frodeheg](https://community.homey.app/u/frodeheg)\
**Post date:** [February 23, 2023, 11:00pm UTC](https://community.homey.app/t/app-pro-piggy-bank/66677/535 "2023-02-23T23:00:51Z")

</div>

> [@Felix\_oslo](#):
>
> Turn off when crises

Turn off when crisis will not turn the device on again… it’s primarily intended for non-essential lights.

It is the Turn on option you’re interested in… it will keep the heater on all the time except for when it need to use less power to reach the power tariff. It will turn on again when there is enough power.

If you disable the temperature control then you will not be able to control the temperature for different price points with your other heaters so I would leave it on if I were you.

> [@Felix\_oslo](#):
>
> I have many flows that turns on and off the thermostats in other situations like when leaving the home.

You need to disable all flows controlling on/off operations outside of piggy. Instead create a mode in piggy called “home” and “not home” and switch between these instead.

> [@Felix\_oslo](#):
>
> If I choose Turn On, Piggy Bank would turn it on as soon as the usage is under the effect limit. Is this correct?

Turn on will have it on whenever you’re below the power limit yes and off when it’s above.

> [@Felix\_oslo](#):
>
> Allow Temperature control" to be possible to set under each unit

It is… if you use the “Turn on” option instead of “change temp”… (although, it may set it to the base temperature you have set for the current mode, I don’t remember exactly. If it is, then you can use a virtual switch device in Homey to control the heater so the temperature control is not visible to piggy. This should work fine for now… In the next version this will be possible without virtual devices. - See Advanced-\>“Time Schedule” for a preview in the test version of the app)

---

<div class="post-metadata">

**Author:** ![Felix\_oslo](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/felix_oslo/32/33969_2.png) [@Felix\_oslo](https://community.homey.app/u/Felix_oslo)\
**Post date:** [February 23, 2023, 11:04pm UTC](https://community.homey.app/t/app-pro-piggy-bank/66677/536 "2023-02-23T23:04:16Z")

</div>

Super thx!!!

---

<div class="post-metadata">

**Author:** ![Felix\_oslo](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/felix_oslo/32/33969_2.png) [@Felix\_oslo](https://community.homey.app/u/Felix_oslo)\
**Post date:** [February 24, 2023, 12:07am UTC](https://community.homey.app/t/app-pro-piggy-bank/66677/537 "2023-02-24T00:07:57Z")

</div>

My HeatWater tank is normally controlled by Tibber where it’s always on the x number of cheapest hours pr day. But it’s only on x number of hours. When controlling it with Piggy Bank, it goes on when Cheap, and I can set a minim of x cheap hours every day. But if the day is cheap all day, the HeatWater tank will stay on all day, and I only want it to stay on 4 hours a day (preferably the 4 cheapest hours). I can’t see that this is possible in the app, or is it?

---

<div class="post-metadata">

**Author:** ![frodeheg](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/frodeheg/32/49010_2.png) [@frodeheg](https://community.homey.app/u/frodeheg)\
**Post date:** [February 24, 2023, 12:29am UTC](https://community.homey.app/t/app-pro-piggy-bank/66677/538 "2023-02-24T00:29:26Z")

</div>

Having it on only the 4 cheapest hours will not fit well with meeting the power tariff.  
Of course you want to move as much power as possible to the cheapest hours, but that will also make the electricity consumption for those single hours go up significantly, which could make you cross the next power step. Thus if you choose to have it on for only 4 hours it may end up in a situation where it is power throttled and will not reach sufficient temperature by the end of the cycle.

Besides, the prices doesn’t differ that much between the 4 cheapest hours and the next cheapest hours from there that you will save back what you save on the power tariff. My personal experience is that from the total savings I can get I will get 50% from the power tariff and 50% from moving from expensive to cheap hours.

Anyway, this is my schema:  
Normal price: 65 degrees.  
Cheap: +15 = 80 degrees  
Dirt cheap: +20 = 85 degrees  
Expensive: -10 = 55 degrees  
Extreme: -30 = 35 degrees

Always have 4 hours cheap.

With this schema I will get the expensive hours cut off and always have sufficiently hot water. The heat reserve from cheap hours will ensure that the tank is off when it’s expensive.

Btw. If you don’t like the automatic price control you can set the price points by using flows instead…

---

<div class="post-metadata">

**Author:** ![frodeheg](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/frodeheg/32/49010_2.png) [@frodeheg](https://community.homey.app/u/frodeheg)\
**Post date:** [February 26, 2023, 2:01am UTC](https://community.homey.app/t/app-pro-piggy-bank/66677/539 "2023-02-26T02:01:13Z")

</div>

So I experienced a very annoying situation today.  
Apparently, my meter reader app had started malfunctioning so the meter reader did not give a single update for 28 hours. This totally ruined the power control today so I propose the following change to the app, what do you think?

- Whenever the app has not received any meter reader signals for \> x minutes (where x is configurable between 5 and 40. Default to 10) then the app goes into power save mode and puts all heating sources into frost guard and turns off all on/off devices.
- At the same time an alarm flow is triggered so you can use this to restart the meter reader app (this resolved my problem at least)
- An alarm indicator is also added to the insights device.
- The alarm is also shown on the welcome screen for the app setup.

I created [this ticket](https://github.com/frodeheg/no.sparegris/issues/196) for the issue.

I think this is better than the current approach which is believing that the current power is what was reported 40 minutes ago.

Any thoughts?

---

<div class="post-metadata">

**Author:** ![dooniem](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/dooniem/32/58384_2.png) [@dooniem](https://community.homey.app/u/dooniem)\
**Post date:** [February 26, 2023, 1:15pm UTC](https://community.homey.app/t/app-pro-piggy-bank/66677/540 "2023-02-26T13:15:45Z")

</div>

Will the override card still work during this error? I would love to able to “when error triggers” set certain units to “something” instead of off and frost settings all over the board.  
Take my chances with the tariff and do something else than your defaults. I guess this will be cleaner on the GUI rather than making new settings for what to do during the meter error

---

<div class="post-metadata">

**Author:** ![frodeheg](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/frodeheg/32/49010_2.png) [@frodeheg](https://community.homey.app/u/frodeheg)\
**Post date:** [February 26, 2023, 1:29pm UTC](https://community.homey.app/t/app-pro-piggy-bank/66677/541 "2023-02-26T13:29:48Z")

</div>

Well, that’s the thing, nothing is decided yet, so we just have to come to a sensible arrangement:  
My main requirements are:

1. The error situation should not make you accidentally cross the power target
2. The error situation must be alerted to the user.
3. It must be possible to automatically resolve the situation.

So I am open to solve these in various ways.  
If you want more control over 1 then I can create an emergency-handling page that has tick-boxes for every controlled device if they should be included in an emergency shutdown. I could also try to estimate the total energy usage from the power reported by every device individually, but I wasn’t thinking of doing either of these initially.  
Normally I would guess that 3 will resolve the situation soon so the emergency shutdown is soon recovered automatically anyway.

---

<div class="post-metadata">

**Author:** ![dooniem](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/dooniem/32/58384_2.png) [@dooniem](https://community.homey.app/u/dooniem)\
**Post date:** [February 26, 2023, 7:37pm UTC](https://community.homey.app/t/app-pro-piggy-bank/66677/542 "2023-02-26T19:37:55Z")

</div>

> [@frodeheg](#):
>
> 1. It must be possible to automatically resolve the situation.

All you can do here is to provide the error trigger, no? You can’t fix a API/cloud problem (restarting the app won’t cut it), and you can’t reboot the user’s router unless it’s controlled by Homey.

> [@frodeheg](#):
>
> If you want more control over 1 then I can create an emergency-handling page that has tick-boxes for every controlled device

This is what I thought would make an already crowded GUI messier? harder for newcomers? And extra work for you. But I appreciate such a solution if you can fit it in.

> [@frodeheg](#):
>
> 1. The error situation must be alerted to the user.

This is where Homey apps have a disadvantage to a standard app on your phone. In order to get alerted in a timely manner, a push notification is needed/wanted. Even if automatically handled. So every awake Piggy user will add such a push notification flowcard to the error trigger, unless Piggy’s able to push without “our consent”? Since we all have to set such a flow, I thought it would be easy enough to add some “well thought out” manual overrides at the same time, if they don’t get ignored during the error that is.

> [@frodeheg](#):
>
> 1. The error situation should not make you accidentally cross the power target

Not sure if you mean this should hold true even if the user willingly sets every device to be ignored in the suggested emergency-handling page or not? A manual override, through flow cards or through a page with tick-boxes could lead to overshooting the power tariff. But mentioning this risk should be enough? **If it happens during a winter night, I’m willing to accidentally overshoot the tariff to keep my children’s rooms warm.**

---

<div class="post-metadata">

**Author:** ![frodeheg](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/frodeheg/32/49010_2.png) [@frodeheg](https://community.homey.app/u/frodeheg)\
**Post date:** [February 26, 2023, 11:47pm UTC](https://community.homey.app/t/app-pro-piggy-bank/66677/543 "2023-02-26T23:47:50Z")

</div>

> [@dooniem](#):
>
> All you can do here is to provide the error trigger, no?

The plan was just to give the trigger and provide an example image of how to connect it.

> [@dooniem](#):
>
> But I appreciate such a solution if you can fit it in.

Bear in mind that this is to handle a very unlikely situation, I have not experienced this very often myself. Thus, I would much prefer it simple rather than a whole lot of this and that.

> [@dooniem](#):
>
> **If it happens during a winter night, I’m willing to accidentally overshoot the tariff to keep my children’s rooms warm.**

Well, the current situation is that if it starts malfunctioning after it reported a very high power the result will be exactly like the suggestion right now anyway because it thinks the high power is still enabled even when everything has been shut down, so everything just keep being shut down…, so I hardly think the suggested change would make the situation much worse than it already is. Though… I could instead react to such a situation in this way instead:

- Turn on everything and set temperatures as if the PP is extremely expensive.
- +force car-chargers to never charge more than half the selected power-tariff.

---

<div class="post-metadata">

**Author:** ![sverf](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sverf/32/68429_2.png) [@sverf](https://community.homey.app/u/sverf)\
**Post date:** [February 27, 2023, 1:13pm UTC](https://community.homey.app/t/app-pro-piggy-bank/66677/544 "2023-02-27T13:13:17Z")

</div>

> [@frodeheg](#):
>
> The gliding average should for every hour be weighted as follows for your case:
> 
> ```auto
> gliding_average_next_hour = (gliding_average_previous_hour*17 + price_12_hours_into_the_future) / 18
> 
> ```
> 
> Thus, you should have been seeing a large jump up 18:00 in your graph due to the price increase at 09:00. I cannot see this in your graph, which is suspicious. This can be caused by a few things:
> 
> - The price fetching for next day failed and could not be retrieved before later in the evening. In this case, when the +12 hour price is not known it will use the 23:00 price in the formula above instead as a replacement for the `price_12_hour_into_the_future` variable. I have an open ticket to [improve the reliability of future prices here](https://github.com/frodeheg/no.sparegris/issues/136), but I have not had time to fix it yet, but it is planned.
> - I can not see a bigger jump in gliding\_average in your graph before 00:00, which is 6 hours before the actual jump, which could mean that the future and past values has been mixed? If so, this would be a bug.
> 
> Can you see on your raw-data for your graph and check how well it fit with the formula above to identify if any of these are the case?

Hi again.  
I think maybe your way of calculating the gliding average weights historic prices too much. In the attached pictures I have in blue the prices from NO3 from 12.feb to 16.feb this year. In orange is your calculation (previous hour\*17 + future price)/18, and in grey is the average of the 6 previous hours and the 12 next hours. As you can see, the orange is much smoother, weigting historic prices more than the grey one. Is it possible to change the calculation? Otherwise, another option is to just change the wording in the “which hours to base the price on”.

 ![Picture1](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/9/e/9ec030c867472eb2b5436a0ade3ded80cf0091c2.png)

---

<div class="post-metadata">

**Author:** ![frodeheg](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/frodeheg/32/49010_2.png) [@frodeheg](https://community.homey.app/u/frodeheg)\
**Post date:** [March 1, 2023, 10:24pm UTC](https://community.homey.app/t/app-pro-piggy-bank/66677/545 "2023-03-01T22:24:10Z")

</div>

> [@sverf](#):
>
> I think maybe your way of calculating the gliding average weights historic prices too much.

Yes, I think you have spotted an error in my terminology.

What seems to closest describe what I am doing is the [Exponential Moving Average (EMA)](https://www.investopedia.com/terms/e/ema.asp).

I’m using a smoothing factor of 1 whereas the most common one is 2. And there is a + 1 for the number of days that I don’t account for.

I think the quickest fix I can do is to:

- Change the wording to Exponential Moving Average.
- Add the +1 to the days in the formula
- Change the smoothing factor to 2 for completeness

That would probably leave out any confusion.

Will this work for you?

I created this ticket to follow up: [Change reference value for prices · Issue #201 · frodeheg/no.sparegris · GitHub](https://github.com/frodeheg/no.sparegris/issues/201)

---

<div class="post-metadata">

**Author:** ![Felix\_oslo](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/felix_oslo/32/33969_2.png) [@Felix\_oslo](https://community.homey.app/u/Felix_oslo)\
**Post date:** [March 2, 2023, 12:06am UTC](https://community.homey.app/t/app-pro-piggy-bank/66677/546 "2023-03-02T00:06:41Z")

</div>

This may be the right way in some hoses, but not in mine. I have 210 square meters and the solution that turns on in max x hours when the price is at the lowest works fine. I’m quite desperate for a solution here, do you think its possible? To make a device only be on in the x hours when the price is low?

---

<div class="post-metadata">

**Author:** ![Peter\_Kawa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_kawa/32/173848_2.png) [@Peter\_Kawa](https://community.homey.app/u/Peter_Kawa)\
**Post date:** [March 2, 2023, 12:16am UTC](https://community.homey.app/t/app-pro-piggy-bank/66677/547 "2023-03-02T00:16:59Z")

</div>

> [@Felix\_oslo](#):
>
> To make a device only be on in the x hours when the price is low?

Power by the Hour app has such functionality build in

[Previous page](https://community.homey.app/t/app-pro-piggy-bank/66677.md?page=26)

[Next page](https://community.homey.app/t/app-pro-piggy-bank/66677.md?page=28)
