#๐Ÿ”’ Trying to make a little python project and need some Assistance!

17 messages ยท Page 1 of 1 (latest)

rigid boltBOT
#

@quasi terrace

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

plucky wedge
#

What's the problem?

quasi terrace
#

1sec

#

Hello!

Idea

So little while ago we switched electricity plans to have nordpool price changes per hour . (Official website) We also have a whole private solar system and since sun time is running out using the street electricity is needed to charge the home's battery's

My OG try with micropython

So what I wanted to do for past few months is make a python script (python because idk anything else yet) that fetches the Nordpool API, gets the hours with prices, picks X(3) amount of cheapest hours and activates a relay that will be hooked up to the house
I originally planned to do it all on ESP-32 but that has only micropython, not python, there for the package that gets nordpool api woudnt work unless microfied, which seemed too difficult to me, then i tried to use old api just to test if it would even work on esp32, and Let's just say it ain't got power to handle that much data, also micropython was just pain.

Raspberry 3 b+

Now since esp32 was kinda a waste, I upgraded to next smallest thing that can run real python with more POWER ๐Ÿ˜„ (budget friendly)
I had a raspberry pi3b+ laying around so I am trying that currently. rn as im typeing im updateing python to 3.8.0 to hopefully solve the issue with PEP668 or extrenal hardrives issue while installing packages. Editthe update failed and the 668p aka error: externally-managed-environment still is there, not sure what to do here either so any Raspberry pi/linux users maybe can help

I ran out of typeing space so let me continue the msg in comments of this post

GitHub

Python library for fetching Nord Pool spot prices. - kipe/nordpool

#

Code attempts & api

Of course as this being my 1st real python project I coudnt ressit ussing chatgpt, so most if not all of the code is generated by it.
My 1st working code was asking how many hours i wanted the cheapest hours and getting the X amount cheapest prices and showing the time with it (main.py) [if you dont know latvian ->'' cik stundas'' -> ''How many hours'']
that didnt go far because if felt way too overcomplicated + it has a flaw , it gets only the tomarrow prices after like <2pm (latvian time), before that it outputs inf as values as api doesnt have the values yet, I guess?

#

Now I got a code that still has the same flaw but i might know a solution by switching the elspot with elbas in the package but i am unsure, just look at the data
Thats the output by the https://github.com/kipe/nordpool example

tame sierra
#

uh so what's the problem

#

668p or extrenal hardrives issue while installing packages
is this what you are trying to fix?

quasi terrace
#

not only that

#

give a bit more time to add bit more files in another pastebin

#

4 copy is my 1st attempt at getting elbas in there
4 is another attempt
4-1 is original output by chatgpt

quasi terrace
# plucky wedge What's the problem?

So in summary problems are

  • getting the right values from package (elspot to elbas) i think it might be a solution (one of the chatgpt4's codes in 2nd pastebin)
  • 668pep external harddrives on rpi 3b+, but im trying to make the code work on pc currently
rigid boltBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.