-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No display :( #19
Comments
Hiya @Fing086 - assuming your 'create_price_db.py' file is default, unchanged, line 8 is merely a comment and shouldn't generate any syntax errors. Have you modified this file at all? Perhaps it would be helpful to show us your file just to be sure nothing's crept in that shouldn't be there. With python, a misplaced tab or spurious comma anywhere in the file can make for hellish debugging! :) Moreover, that file 'create_price_db.py' only needs running once, in order to create your SQLite prices database, which by default gets named Alternatively, look at my fork of the code, and you'll see what's going on here - the database file needs to have the same name in create_price_db.py (line 5 ) octoprice_main_inky.py (line 28) and store_prices.py (lines 203, 211) I do recall vaguely having some weird issues on at least one PiZeroW where it didn't create the database file in the correct directory location, which of course made everything fail to start later - so maybe check where yours has ended up, if indeed it has even been created. Again, you'll see in my fork, that I gave the database reference an explicit pathname to the file so all accesses of it were a known quantity! YMMV :) Assuming you do have a correctly-named database in the right location where the other python scripts can find it, then your start-failure problem might be down to the cron jobs not starting? Did you set up your crontab? (see the Readme.MD file for that step) Finally, I do recall that the main file 'octoprice_main_inky.py' won't actually do anything until the database file is created, but it's easy to miss the error message unless you're checking in SSH console via Putty or whatever. You actually have to run store_prices.py at least once prior to the main script, so there there are some prices in there for it to spit out during the half-hour refreshes during the day. Hope this helps - let me know how you get on! It is worth having this running, imo. Even though I don't actually use the Agile tariff myself anymore (I'm on Octopus Go at the moment and have been since a couple of months after all the energy prices went nuts), I do like to keep an eye on what Agile is currently priced at, because there might come a time when it's safe to go back in the water, so to speak! |
Hi, First of all thank you for your concise and thorough response, its very much appreciated. At the moment my sticking point is the editing of the store_prices.py file. In the instructions on site it simply says 'edit the top lines where you need to change the tariff code.' however, I cant seem to find anywhere to insert a code and also cant find the relevant code on my dashboard! If you can point me in the direction of what line to edit and if you have a sample code I can use until I can find mine (Not bothered about what tariff its for, I just want to see it work) That would be great as at the moment im on the Inky Phat logo screen still :( Thanks again |
Can anyone help with the above? |
Hi again @Fing086 - sorry for the delay - I must have missed the notification about your reply. OK, I'm guessing you're referring to the comment in the readme: Open store_prices.py (using nano or whatever) and edit the top lines where you need to change the tariff code. which is out of date now. It's similarly referred to on line7 in the main inky python script:
I think in earlier versions, we had to do this manually, and edit the store-prices script to create the 'Octopus API' fetch URL specific to our DNO region. Now, though, I think it's handled semi-automatically by the store-prices script, via the function here: octopus-agile-pi-prices/store_prices.py Line 170 in c020582
If I remember right, you just invoke the store-prices script from the command prompt, with the DNO region as a commandline parameter (I think something like -r K would work (for south wales DNO, for example), but let me know if not. It's something like that. Remember you can invoke the store script with --help too, I think, and that will show you the region codes. However - big caveat! You'll have more issues with the fact that the original Agile tariff cited in these scripts is now defunct. I've got a little scraper set up in Node-Red, and that is telling me that today's most-recently available Agile based script is at "https://api.octopus.energy/v1/products/AGILE-FLEX-BB-23-02-08/" Interrogating that, I can see that to use that tariff, you'd have to change the humorously named lines here: octopus-agile-pi-prices/store_prices.py Line 17 in c020582
to use:
instead. There are other Agile tariffs on the Octopus system but without delving deeper I can't tell which ones are available now, and given that at the moment your investigation is academic, this one will probably do for now. But if you need an exact reference, either let me know, or have a dig on the main Octopus API website here: https://developer.octopus.energy/docs/api/#agile-octopus (though it will take a bit of effort to find historic tariffs, I think there is a method on there for finding current ones). Hope this helps. Shout back if you need further assistance, though I can't promise I'll spot it immediately, evidently! Must get my github notifications sorted some day :) |
Ok, that gets me a lot further than I was getting, the script now starts and looks for the tariff but then throws error: Selected region K |
Hi @Fing086 I'm getting the same database error, did you (or has anyone else) manage to find a solution to this? |
Unfortunately not, it seems octopus has changed the format in which it gives the data which is now incompatible with this software. |
@Fing086 I've managed to get mine working. It wasn't a problem with the data format from Octopus, it was a problem with the agileprices.sqlite database. The prices table in the database didn't have a valid_from field, so I added this at the end (it's a text field). This allowed store_prices.py to populate the database and it's all working now. Another thing to note, when running store_prices.py, I had to enter: |
Thats very interesting, any chance you can send me / upload the updated file(s) ? Glad you could get to the bottom of it :) |
This is how it looked after I'd added the 'valid_from' field. Using https://sqlitebrowser.org/ |
Thanks, ill certainly take a look at that :) |
I'm watching this repository, but haven't quite got around to implementing my version of it, but noted the bugs posted here. I'll have a look at doing a few updates, and making a Pull-Request to get changes into the main repo, and you'll probably see my fork as soon as I've fixed it appear 'ahead' of this repo if it doesn't get merged... |
Hi all - I'm not sure that this repo is still active. I'm going to make PR which will fix the prices issue, which may or may not get merged, but you may perhaps find my similar project useful as well: https://github.com/jerbzz/pi-eco-indicator |
Having looked into this a little, I'm not getting the same issue you guys are. Can you tell me a little more about your environments, specifically your Python version?
I get this error with the current version of this repo (fetched with git clone https://github.com/pufferfish-tech/octopus-agile-pi-prices), and the current version of Pimoroni's Inky pHat library, and Python 3.9.2...
This is fixed by inserting |
I'm still around if anyone has any PRs, I don't currently use this code so I can't offer a huge amount of assistance, I might be using it again in the near future though! |
Im on Python 2.7.16 on my Pi if that helps any? |
you need python 3, I'm pretty sure. |
I had tried Python 3 on a previous installation, I must have formatted and reinstalled a number of times, but had the same or similar issues. I'll give it another go whilst looking at some of the fixes above :) |
Mine has python 2 and 3.
I'm using python 3 |
Was this the error you were getting @squaq200 ? |
Yes thats correct |
Yes, I added a valid_from field to the table and that fixed it |
Well, im obviously doing something wrong but I have followed the instructions as far as I am aware, to the letter but when I reboot my Pi my Inkyphat screen just stays on its logo and nothing is happening!
The power/data light flashes for a good bit so I know the pi is doing something, but thats all I get.
Anyone else had this or can point me in a direction of how to test everything is installed correctly?
Only issue im getting is as follows:
python3 create_price_db.py
File "create_price_db.py", line 8
^
SyntaxError: invalid syntax
Thanks all
The text was updated successfully, but these errors were encountered: