Habapp job execution time

Ok now it is working,
it was a misunderstanding of the print output in the loaded script.
So there is no real output. The output was generated from and inside the callback.

So it is working now, without any warnings.

What is that with the absolute and relative path?
Must it a absolut? The relativ was not working on the first try.
Or what is the starting Point for the rel path? The working dir of the Script?

The output is generated from the process correclty but only collected when the process is finished (just shortly before the callback).
Thatā€™s why you only see it only in your callback.

I think itā€™s the relative path to the HABApp working directory.

Ok, will try it.
The printing of the future object is that only in the development version?
<Future at 0x1f3dba6bcd0 state=pending>

There is no print in the HABApp code - it comes from here:

myOutput = self.execute_python( self.speedtest_finished, c:/Development/Smarthome/dev_habapp/files/lib/myspeedtest.py','arg1_for_script')

print(myOutput) # <-------

ok,
last question:

        myOutput = self.execute_python( self.speedtest_finished,
                                        './files/lib/myspeedtest.py',
                                        'arg1_for_script')

leads to

C:\Development\python\python3.10\python.exe: can't open file 'C:\\Development\\SmartHome\\dev_habapp\\files\\lib\\files\\lib\\myspeedtest.py': [Errno 2] No such file or directory

and

       myOutput = self.execute_python( self.speedtest_finished,
                                        'myspeedtest.py',
                                        'arg1_for_script')

leads to

C:\Development\python\python3.10\python.exe: can't open file 'C:\\Development\\SmartHome\\dev_habapp\\myspeedtest.py': [Errno 2] No such file or directory

So it is only working with the absolute path. If I enter something before myspeedtest.py
already files/lib is before in the path

Yes - itā€™ll probably make sense to make this always relative to the HABApp config.
Iā€™ll change this before the release

1 Like

Ok, thanks. Then I will wait until it is released m thanks for the support. And in general. I love it , habapp ist much more better for rules than JavaScript. From m Side of View.

Great job

1 Like

If you update the dev branch the relative path should be resolved properly.
Could you check if it works as intended?

Hi, yes will check it later in the day

Hi Sebastian,
I deleted my dev version and reinstalled it newly.

Then I tested the following:

'./lib/myspeedtest.py'

leads to

C:\Development\python\python3.10\python.exe: can't open file 'C:\\Development\\SmartHome\\dev_habapp\\files\\lib\\lib\\myspeedtest.py': [Errno 2] No such file or directory

and

'myspeedtest.py'

leads to

ERROR |   C:\Development\python\python3.10\python.exe: can't open file 'C:\\Development\\SmartHome\\dev_habapp\\files\\myspeedtest.py': [Errno 2] No such file or directory
'lib/myspeedtest.py',

leads to

 C:\Development\python\python3.10\python.exe: can't open file 'C:\\Development\\SmartHome\\dev_habapp\\files\\lib\\lib\\myspeedtest.py': [Errno 2] No such file or directory

on some reason if I add a path to the script the lib appears

'./files/lib/myspeedtest.py',

leads to

 ERROR | Creating subprocess failed! Call: "C:\Development\SmartHome\dev_habapp\Scripts\python.exe" "./files/lib/myspeedtest.py" "arg1_for_script"
[2022-11-07 11:39:14,050] [           HABApp.execute]    ERROR | Error [WinError 267] Der Verzeichnisname ist ungƃĀ¼ltig in execute_python:

Only the absolute Path is working.

Is there a chance to check if I downloaded the correct version?
I did:
python3 -m pip uninstall habapp
python3 -m pip install git+https://github.com/spacemanspiff2007/HABApp.git@Develop

Hm - I just pushed another fix - could you try again please?

Yes but now later .actually Iā€™m out of the House

ok, now it is working.
Great

       myOutput = self.execute_python( self.speedtest_finished,
                                        './lib/myspeedtest.py',
                                        'arg1_for_script')

This config works!
Thanks

1 Like