pufferfish-tech / octopus-agile-pi-prices

Display the upcoming prices on the Octopus Energy "Agile" tariff.
Apache License 2.0
71 stars 27 forks source link

Congratulations on public recognition #9

Open Chiny91 opened 4 years ago

Chiny91 commented 4 years ago

Congratulations @pufferfish-tech on being officially noticed by Octopus Energy. Now there is absolutely no excuse for not fixing the bugs, sorting one or two sub-optimal points 😄

Octopus Energy blog.

Incidentally, Octopus Energy show a Raspberry Pi Zero which I find 100% reliable, compared to my daily crash of an older R Pi 2b.

pufferfish-tech commented 4 years ago

I noticed that yesterday! I used a pi 2b to write this on, never had any crashes, I wonder if you had an sd card problem or something. Could be anything, power supply spikes, who knows.

I'm pretending the minimum price bug doesn't exist. I've fixed it in the new thing I'm working on so I suppose I will roll it out to this in due course! 😛

GeofP commented 3 years ago

I am an Octopus customer and came accros your work whilst researching the Agile tariff. I have now followed your install instructions on a Pi Zero W with red inkyphat display. Running "python3 octoprice_main_inky.py" gave a couple of import errors and had to do the following before it would run: pip3 install inky pip3 install font_fredoka_one. Thank you for your contribution!

pufferfish-tech commented 3 years ago

Welcome to Agile :)

The step: "curl https://get.pimoroni.com/inky | bash" in the instructions ought to have done the install of inky and the font, but it is owned/maintained by pimoroni so if you did run it, perhaps it may have failed or been down somehow at the time.

GeofP commented 3 years ago

Thank you. I think your software will be getting a lot of attention!

ukblaster commented 3 years ago

I have had this running a while now. Tempted to fix the min price bug too. The other issue I have is regular failure to have prices available when the crontab entry runs. Tempted to create a store prices which can be called multiple times but will only insert if not already exists.

pufferfish-tech commented 3 years ago

I have had this running a while now. Tempted to fix the min price bug too.

Yeah its bugging me now too - I'll get right on it ;)

The other issue I have is regular failure to have prices available when the crontab entry runs. Tempted to create a store prices which can be called multiple times but will only insert if not already exists.

You can just run it multiple times in cron, say... 15 17,19,20,21 * /usr/bin/python3 store_prices.py > /home/pi/cron2.log

This will run at 15 mins past 5, 7, 8 and 9pm

My only advice is don't do it more than a few times a day. I think the above ought to work fine. If you do look at the insert if not exists, then maybe you could combine that with making sure not to make duplicates in the sqlite (currently it does, which isn't a massive issue, but not exactly desirable). That would be useful for me.

Cheers!

beararmy commented 3 years ago

If you do look at the insert if not exists

Hey buddy, if it helps you, this is the SQL I've used to achieve that same result. Hopefully copypastable. Linky :)

pufferfish-tech commented 3 years ago

I have had this running a while now. Tempted to fix the min price bug too.

Done :) Nice - we have negative pricing tonight too, so I'm seeing the right minimum value, -4.2p in 23hrs Give me a shout if I've messed any(every)thing up but it should just need the new octoprice_main_inky.py file pulling down.

Chiny91 commented 3 years ago

Yes, that fix works fine for me, (-4.6p at 1500 bst). Ah, just had the Octopus email re a "double plunge"... now, what will I switch on ?

Nice work.

pufferfish-tech commented 3 years ago

Yes, that fix works fine for me, (-4.6p at 1500 bst). Ah, just had the Octopus email re a "double plunge"... now, what will I switch on ?

.... everything :)

bertybassett commented 3 years ago

needed manual installs of

pip3 install inky pip3 install font_fredoka_one pip3 install pytz pip install smbus2

but now getting this

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/inky/eeprom.py", line 100, in read_eeprom
    from smbus2 import SMBus
ModuleNotFoundError: No module named 'smbus2'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "octoprice_main_inky.py", line 25, in <module>
    inky_display = InkyPHAT("red")
  File "/usr/local/lib/python3.7/dist-packages/inky/phat.py", line 72, in __init__
    v_flip=False)
  File "/usr/local/lib/python3.7/dist-packages/inky/inky.py", line 86, in __init__
    self.eeprom = eeprom.read_eeprom(i2c_bus=i2c_bus)
  File "/usr/local/lib/python3.7/dist-packages/inky/eeprom.py", line 102, in read_eeprom
    raise ImportError('This library requires the smbus2 module\nInstall with: sudo pip install smbus2')
ImportError: This library requires the smbus2 module
Install with: sudo pip install smbus2
pufferfish-tech commented 3 years ago

@bertybassett did you install the inky phat library?

"curl https://get.pimoroni.com/inky | bash"

bertybassett commented 3 years ago

yes

pufferfish-tech commented 3 years ago

Did it fail? It seems like it missed the install for a lot of things..

bertybassett commented 3 years ago

sudo pip3 install smbus2 fixed it and I can confirm that it is now working

I must say the inky script asked if I wanted a full install examples and documents and I said no maybe that caused it to fail.

pufferfish-tech commented 3 years ago

Yeah looking down the list of things the pimoroni script does, I think if it fails you will get a lot of missing stuff. Try running it again and see if you can spot any errors?

pufferfish-tech commented 3 years ago

You can literally put https://get.pimoroni.com/inky into a browser, save the file, open it as text and see how much stuff it does...quite a lot!

bertybassett commented 3 years ago

don't worry it is working now

pufferfish-tech commented 3 years ago

Good stuff!