HomeGenie icon indicating copy to clipboard operation
HomeGenie copied to clipboard

Python 3.7

Open soxfan1966 opened this issue 4 years ago • 5 comments

Is your feature request related to a problem? Please describe. I have a Python script I want to run for Meross sensors but they require version 3.7 at least. HG is running 2.7 and appears to be integrated into the build? I had updated Python on my pi itself and could run the script from the command line but running within HG does not work.

Describe the solution you'd like Update HG to use the newest version, minimum 3.7, of Python.

Describe alternatives you've considered I tried manually update Python on my pi (which I did and it allowed me to use) but HG still appears to use the older version.

Additional context Add any other context or screenshots about the feature request here

soxfan1966 avatar Jul 20 '20 10:07 soxfan1966

As you probably know Iron Python is deployed in HG and the latest version of this is 2.7. You might want to read up on Iron Python v Python to see the difference between both https://ironpython.net/download/

mralapete avatar Jul 20 '20 11:07 mralapete

You may have to adapt your Python code to run in Iron Python 2.7 if this warning is anything to go by https://github.com/IronLanguages/ironpython3

mralapete avatar Jul 21 '20 23:07 mralapete

The problem is that the code I was trying to implement in HG is part of a library of external files which I have no control over. In order to be able to use that library, Python 3.7 is required, so if that is not currently possible given how HG implements Python scripts then my request would need to wait until that is possible.

soxfan1966 avatar Jul 22 '20 09:07 soxfan1966

Hi, there are several solutions to this:

  • implement a REST service using Python 3.7+ and call it from HG.
  • If you already use MQTT you can do a Python program that sends the sensor data to it and use the HG MQTT module to get the values.
  • You can store the values in a database and read it from HG -etc...

So you don't have to wait.

Good luck.

gitbjo avatar Oct 06 '20 06:10 gitbjo

Thank you for those suggestions, I appreciate it. The only downside is that I would need to install Python 3.7 (which I had, but have since removed) in addition to the Python version that HomeGenie uses. I have requested via the GitHub site for HomeGenie that the application be updated to use the newest release of Python, and there is some enhancement work going on there so I am hopeful that ends up being part of the solution. If not, I can pursue one of your suggestions - Thanks again.

soxfan1966 avatar Oct 06 '20 12:10 soxfan1966