Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


Visual Studio Code (vscode) for QuickApp development


jgab

Recommended Posts

There is still an issue with the HC3 connection, I have now tis type of error after few minutes:

Platform is win32
Web server port 5004 status 10061

Loading
Loaded
Waiting for debugger to attach...
Debugger attached

[07.02.2024] [09:42:19] [SYS   ] [boot   ]: Fibemu v0.41
[07.02.2024] [09:42:19] [SYS   ] [boot   ]: Web UI :

Please login or register to see this link.


[07.02.2024] [09:42:19] [SYS   ] [boot   ]: old Web UI :

Please login or register to see this link.


[07.02.2024] [09:42:19] [SYS   ] [boot   ]: API Doc:

Please login or register to see this link.


[07.02.2024] [09:42:19] [SYS   ] [boot   ]: API EP :

Please login or register to see this link.


[07.02.2024] [09:42:19] [SYS   ] [boot   ]: QA emulator started
[07.02.2024] [09:42:19] [SYS   ] [install]: QA 'examples\QA_UI.lua'
[07.02.2024] [09:42:19] [SYS   ] [resource]: refresh 'devices'
[07.02.2024] [09:42:22] [SYS   ] [refresh]: DeviceCreatedEvent ID:5000
[07.02.2024] [09:42:22] [SYS   ] [QUICKAPP5000]: Running 'main'
[07.02.2024] [09:42:22] [DEBUG ] [QUICKAPP5000]: Started 5000
[07.02.2024] [09:42:22] [SYS   ] [refresh]: DevicePropertyUpdatedEvent ID:5000 prop:'quickAppVariables' val:[{"name":"test","value":"HELLO"}]
[07.02.2024] [09:42:22] [SYS   ] [resource]: refresh 'globalVariables'
[07.02.2024] [09:42:22] [SYS   ] [refresh]: DevicePropertyUpdatedEvent ID:354 prop:'value' val:18.3
[07.02.2024] [09:42:22] [SYS   ] [install]: QA '.vscode/emufiles/lua/devices/binarySwitch.lua'
[07.02.2024] [09:42:22] [SYS   ] [refresh]: DeviceCreatedEvent ID:5001
[07.02.2024] [09:42:22] [SYS   ] [install]: QA '.vscode/emufiles/lua/devices/binarySensor.lua'
[07.02.2024] [09:42:22] [SYS   ] [refresh]: DeviceCreatedEvent ID:5002
[07.02.2024] [09:42:22] [SYS   ] [install]: QA '.vscode/emufiles/lua/devices/multilevelSwitch.lua'
[07.02.2024] [09:42:22] [SYS   ] [refresh]: DeviceCreatedEvent ID:5003
[07.02.2024] [09:42:22] [SYS   ] [install]: QA '.vscode/emufiles/lua/devices/multilevelSensor.lua'
[07.02.2024] [09:42:22] [SYS   ] [refresh]: DeviceCreatedEvent ID:5004
[07.02.2024] [09:42:22] [SYS   ] [install]: QA '.vscode/emufiles/lua/devices/temperatureSensor.lua'
[07.02.2024] [09:42:22] [SYS   ] [refresh]: DeviceCreatedEvent ID:5005
[07.02.2024] [09:42:22] [SYS   ] [install]: QA '.vscode/emufiles/lua/devices/humiditySensor.lua'
[07.02.2024] [09:42:22] [SYS   ] [refresh]: DeviceCreatedEvent ID:5006
[07.02.2024] [09:42:22] [SYS   ] [refresh]: DevicePropertyUpdatedEvent ID:354 prop:'lastChanged' val:1707295015
[07.02.2024] [09:42:23] [SYS   ] [QUICKAPP5001]: Running 'main'
[07.02.2024] [09:42:23] [SYS   ] [QUICKAPP5002]: Running 'main'
[07.02.2024] [09:42:23] [SYS   ] [QUICKAPP5003]: Running 'main'
[07.02.2024] [09:42:23] [DEBUG ] [QUICKAPP5003]: Turned off
[07.02.2024] [09:42:23] [DEBUG ] [QUICKAPP5003]: Set value 0
[07.02.2024] [09:42:23] [SYS   ] [QUICKAPP5004]: Running 'main'
[07.02.2024] [09:42:23] [SYS   ] [QUICKAPP5005]: Running 'main'
[07.02.2024] [09:42:23] [SYS   ] [QUICKAPP5006]: Running 'main'
[07.02.2024] [09:42:27] [DEBUG ] [QUICKAPP5004]: onAction:  {"args":["batteryLevel",50],"deviceId":5004,"actionName":"updateProperty","type":"onAction"}
[07.02.2024] [09:42:27] [SYS   ] [refresh]: DevicePropertyUpdatedEvent ID:5004 prop:'batteryLevel' val:50
[07.02.2024] [09:42:27] [DEBUG ] [QUICKAPP5004]: onAction:  {"args":["dead",true],"deviceId":5004,"actionName":"updateProperty","type":"onAction"}
[07.02.2024] [09:42:27] [SYS   ] [refresh]: DevicePropertyUpdatedEvent ID:5004 prop:'dead' val:true
[07.02.2024] [09:42:33] [SYS   ] [refresh]: DevicePropertyUpdatedEvent ID:399 prop:'lastChanged' val:1707295025
[07.02.2024] [09:42:33] [SYS   ] [refresh]: DevicePropertyUpdatedEvent ID:399 prop:'value' val:93
[07.02.2024] [09:42:33] [SYS   ] [refresh]: DevicePropertyUpdatedEvent ID:401 prop:'lastChanged' val:1707295026

 ...

...

[07.02.2024] [09:44:20] [SYS   ] [refresh]: DevicePropertyUpdatedEvent ID:222 prop:'lastChanged' val:1707295131
[07.02.2024] [09:44:21] [SYS   ] [refresh]: DevicePropertyUpdatedEvent ID:229 prop:'value' val:22.1
[07.02.2024] [09:44:22] [SYS   ] [refresh]: DevicePropertyUpdatedEvent ID:229 prop:'lastChanged' val:1707295131
Exception in thread Thread-2 (refreshRunner):
Traceback (most recent call last):
  File "C:\Users\ASUS\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\urllib3\connection.py", line 198, in _new_conn
    sock = connection.create_connection(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\ASUS\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\urllib3\util\connection.py", line 60, in create_connection
    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2032.0_x64__qbz5n2kfra8p0\Lib\socket.py", line 962, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
socket.gaierror: [Errno 11001] getaddrinfo failed

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\ASUS\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\urllib3\connectionpool.py", line 793, in urlopen
    response = self._make_request(
               ^^^^^^^^^^^^^^^^^^^
  File "C:\Users\ASUS\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\urllib3\connectionpool.py", line 496, in _make_request
    conn.request(
  File "C:\Users\ASUS\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\urllib3\connection.py", line 400, in request
    self.endheaders()
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2032.0_x64__qbz5n2kfra8p0\Lib\http\client.py", line 1289, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2032.0_x64__qbz5n2kfra8p0\Lib\http\client.py", line 1048, in _send_output
    self.send(msg)
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2032.0_x64__qbz5n2kfra8p0\Lib\http\client.py", line 986, in send
    self.connect()
  File "C:\Users\ASUS\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\urllib3\connection.py", line 238, in connect
    self.sock = self._new_conn()
                ^^^^^^^^^^^^^^^^
  File "C:\Users\ASUS\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\urllib3\connection.py", line 205, in _new_conn
    raise NameResolutionError(self.host, self, e) from e
urllib3.exceptions.NameResolutionError: <urllib3.connection.HTTPConnection object at 0x000001F46AE06710>: Failed to resolve 'hc3-00006080' ([Errno 11001] getaddrinfo failed)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\ASUS\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\requests\adapters.py", line 486, in send
    resp = conn.urlopen(
           ^^^^^^^^^^^^^
  File "C:\Users\ASUS\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\urllib3\connectionpool.py", line 847, in urlopen
    retries = retries.increment(
              ^^^^^^^^^^^^^^^^^^
  File "C:\Users\ASUS\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\urllib3\util\retry.py", line 515, in increment
    raise MaxRetryError(_pool, url, reason) from reason  # type: ignore[arg-type]
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='hc3-00006080', port=80): Max retries exceeded with url: /api/refreshStates?lang=en&rand=0.09580020181569104&logs=false&last=306903 (Caused by NameResolutionError("<urllib3.connection.HTTPConnection object at 0x000001F46AE06710>: Failed to resolve 'hc3-00006080' ([Errno 11001] getaddrinfo failed)"))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\ASUS\Documents\fibemu\.vscode\emufiles\fibenv.py", line 107, in refreshRunner
    resp = requests.get(nurl, headers = options['headers'], timeout=30)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\ASUS\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\requests\api.py", line 73, in get
    return request("get", url, params=params, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\ASUS\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\requests\api.py", line 59, in request
    return session.request(method=method, url=url, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\ASUS\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\requests\sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\ASUS\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\requests\sessions.py", line 703, in send
    r = adapter.send(request, **kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\ASUS\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\requests\adapters.py", line 519, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='hc3-00006080', port=80): Max retries exceeded with url: /api/refreshStates?lang=en&rand=0.09580020181569104&logs=false&last=306903 (Caused by NameResolutionError("<urllib3.connection.HTTPConnection object at 0x000001F46AE06710>: Failed to resolve 'hc3-00006080' ([Errno 11001] getaddrinfo failed)"))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2032.0_x64__qbz5n2kfra8p0\Lib\threading.py", line 1045, in _bootstrap_inner
    self.run()
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2032.0_x64__qbz5n2kfra8p0\Lib\threading.py", line 982, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\ASUS\Documents\fibemu\.vscode\emufiles\fibenv.py", line 123, in refreshRunner
    except exceptions.TimeoutError as e:
           ^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'requests.exceptions' has no attribute 'TimeoutError'

[07.02.2024] [09:59:50] [DEBUG ] [QUICKAPP5000]: UIEvent:  {"eventType":"onReleased","elementName":"test","deviceId":5000,"values":[],"type":"UIEvent"}
[07.02.2024] [09:59:50] [DEBUG ] [QUICKAPP5000]: B pressed

 

Link to comment
Share on other sites

  • Topic Author
  • 2 hours ago, Christb said:

    There is still an issue with the HC3 connection, I have now tis type of error after few minutes:

    Platform is win32
    Web server port 5004 status 10061

    Loading
    Loaded
    Waiting for debugger to attach...
    Debugger attached

    [07.02.2024] [09:42:19] [SYS   ] [boot   ]: Fibemu v0.41
    [07.02.2024] [09:42:19] [SYS   ] [boot   ]: Web UI :

    Please login or register to see this link.


    [07.02.2024] [09:42:19] [SYS   ] [boot   ]: old Web UI :

    Please login or register to see this link.


    [07.02.2024] [09:42:19] [SYS   ] [boot   ]: API Doc:

    Please login or register to see this link.


    [07.02.2024] [09:42:19] [SYS   ] [boot   ]: API EP :

    Please login or register to see this link.


    [07.02.2024] [09:42:19] [SYS   ] [boot   ]: QA emulator started
    [07.02.2024] [09:42:19] [SYS   ] [install]: QA 'examples\QA_UI.lua'
    [07.02.2024] [09:42:19] [SYS   ] [resource]: refresh 'devices'
    [07.02.2024] [09:42:22] [SYS   ] [refresh]: DeviceCreatedEvent ID:5000
    [07.02.2024] [09:42:22] [SYS   ] [QUICKAPP5000]: Running 'main'
    [07.02.2024] [09:42:22] [DEBUG ] [QUICKAPP5000]: Started 5000
    [07.02.2024] [09:42:22] [SYS   ] [refresh]: DevicePropertyUpdatedEvent ID:5000 prop:'quickAppVariables' val:[{"name":"test","value":"HELLO"}]
    [07.02.2024] [09:42:22] [SYS   ] [resource]: refresh 'globalVariables'
    [07.02.2024] [09:42:22] [SYS   ] [refresh]: DevicePropertyUpdatedEvent ID:354 prop:'value' val:18.3
    [07.02.2024] [09:42:22] [SYS   ] [install]: QA '.vscode/emufiles/lua/devices/binarySwitch.lua'
    [07.02.2024] [09:42:22] [SYS   ] [refresh]: DeviceCreatedEvent ID:5001
    [07.02.2024] [09:42:22] [SYS   ] [install]: QA '.vscode/emufiles/lua/devices/binarySensor.lua'
    [07.02.2024] [09:42:22] [SYS   ] [refresh]: DeviceCreatedEvent ID:5002
    [07.02.2024] [09:42:22] [SYS   ] [install]: QA '.vscode/emufiles/lua/devices/multilevelSwitch.lua'
    [07.02.2024] [09:42:22] [SYS   ] [refresh]: DeviceCreatedEvent ID:5003
    [07.02.2024] [09:42:22] [SYS   ] [install]: QA '.vscode/emufiles/lua/devices/multilevelSensor.lua'
    [07.02.2024] [09:42:22] [SYS   ] [refresh]: DeviceCreatedEvent ID:5004
    [07.02.2024] [09:42:22] [SYS   ] [install]: QA '.vscode/emufiles/lua/devices/temperatureSensor.lua'
    [07.02.2024] [09:42:22] [SYS   ] [refresh]: DeviceCreatedEvent ID:5005
    [07.02.2024] [09:42:22] [SYS   ] [install]: QA '.vscode/emufiles/lua/devices/humiditySensor.lua'
    [07.02.2024] [09:42:22] [SYS   ] [refresh]: DeviceCreatedEvent ID:5006
    [07.02.2024] [09:42:22] [SYS   ] [refresh]: DevicePropertyUpdatedEvent ID:354 prop:'lastChanged' val:1707295015
    [07.02.2024] [09:42:23] [SYS   ] [QUICKAPP5001]: Running 'main'
    [07.02.2024] [09:42:23] [SYS   ] [QUICKAPP5002]: Running 'main'
    [07.02.2024] [09:42:23] [SYS   ] [QUICKAPP5003]: Running 'main'
    [07.02.2024] [09:42:23] [DEBUG ] [QUICKAPP5003]: Turned off
    [07.02.2024] [09:42:23] [DEBUG ] [QUICKAPP5003]: Set value 0
    [07.02.2024] [09:42:23] [SYS   ] [QUICKAPP5004]: Running 'main'
    [07.02.2024] [09:42:23] [SYS   ] [QUICKAPP5005]: Running 'main'
    [07.02.2024] [09:42:23] [SYS   ] [QUICKAPP5006]: Running 'main'
    [07.02.2024] [09:42:27] [DEBUG ] [QUICKAPP5004]: onAction:  {"args":["batteryLevel",50],"deviceId":5004,"actionName":"updateProperty","type":"onAction"}
    [07.02.2024] [09:42:27] [SYS   ] [refresh]: DevicePropertyUpdatedEvent ID:5004 prop:'batteryLevel' val:50
    [07.02.2024] [09:42:27] [DEBUG ] [QUICKAPP5004]: onAction:  {"args":["dead",true],"deviceId":5004,"actionName":"updateProperty","type":"onAction"}
    [07.02.2024] [09:42:27] [SYS   ] [refresh]: DevicePropertyUpdatedEvent ID:5004 prop:'dead' val:true
    [07.02.2024] [09:42:33] [SYS   ] [refresh]: DevicePropertyUpdatedEvent ID:399 prop:'lastChanged' val:1707295025
    [07.02.2024] [09:42:33] [SYS   ] [refresh]: DevicePropertyUpdatedEvent ID:399 prop:'value' val:93
    [07.02.2024] [09:42:33] [SYS   ] [refresh]: DevicePropertyUpdatedEvent ID:401 prop:'lastChanged' val:1707295026

     ...

    ...

    [07.02.2024] [09:44:20] [SYS   ] [refresh]: DevicePropertyUpdatedEvent ID:222 prop:'lastChanged' val:1707295131
    [07.02.2024] [09:44:21] [SYS   ] [refresh]: DevicePropertyUpdatedEvent ID:229 prop:'value' val:22.1
    [07.02.2024] [09:44:22] [SYS   ] [refresh]: DevicePropertyUpdatedEvent ID:229 prop:'lastChanged' val:1707295131
    Exception in thread Thread-2 (refreshRunner):
    Traceback (most recent call last):
      File "C:\Users\ASUS\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\urllib3\connection.py", line 198, in _new_conn
        sock = connection.create_connection(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\ASUS\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\urllib3\util\connection.py", line 60, in create_connection
        for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2032.0_x64__qbz5n2kfra8p0\Lib\socket.py", line 962, in getaddrinfo
        for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    socket.gaierror: [Errno 11001] getaddrinfo failed

    The above exception was the direct cause of the following exception:

    Traceback (most recent call last):
      File "C:\Users\ASUS\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\urllib3\connectionpool.py", line 793, in urlopen
        response = self._make_request(
                   ^^^^^^^^^^^^^^^^^^^
      File "C:\Users\ASUS\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\urllib3\connectionpool.py", line 496, in _make_request
        conn.request(
      File "C:\Users\ASUS\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\urllib3\connection.py", line 400, in request
        self.endheaders()
      File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2032.0_x64__qbz5n2kfra8p0\Lib\http\client.py", line 1289, in endheaders
        self._send_output(message_body, encode_chunked=encode_chunked)
      File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2032.0_x64__qbz5n2kfra8p0\Lib\http\client.py", line 1048, in _send_output
        self.send(msg)
      File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2032.0_x64__qbz5n2kfra8p0\Lib\http\client.py", line 986, in send
        self.connect()
      File "C:\Users\ASUS\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\urllib3\connection.py", line 238, in connect
        self.sock = self._new_conn()
                    ^^^^^^^^^^^^^^^^
      File "C:\Users\ASUS\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\urllib3\connection.py", line 205, in _new_conn
        raise NameResolutionError(self.host, self, e) from e
    urllib3.exceptions.NameResolutionError: <urllib3.connection.HTTPConnection object at 0x000001F46AE06710>: Failed to resolve 'hc3-00006080' ([Errno 11001] getaddrinfo failed)

    The above exception was the direct cause of the following exception:

    Traceback (most recent call last):
      File "C:\Users\ASUS\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\requests\adapters.py", line 486, in send
        resp = conn.urlopen(
               ^^^^^^^^^^^^^
      File "C:\Users\ASUS\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\urllib3\connectionpool.py", line 847, in urlopen
        retries = retries.increment(
                  ^^^^^^^^^^^^^^^^^^
      File "C:\Users\ASUS\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\urllib3\util\retry.py", line 515, in increment
        raise MaxRetryError(_pool, url, reason) from reason  # type: ignore[arg-type]
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='hc3-00006080', port=80): Max retries exceeded with url: /api/refreshStates?lang=en&rand=0.09580020181569104&logs=false&last=306903 (Caused by NameResolutionError("<urllib3.connection.HTTPConnection object at 0x000001F46AE06710>: Failed to resolve 'hc3-00006080' ([Errno 11001] getaddrinfo failed)"))

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "C:\Users\ASUS\Documents\fibemu\.vscode\emufiles\fibenv.py", line 107, in refreshRunner
        resp = requests.get(nurl, headers = options['headers'], timeout=30)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\ASUS\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\requests\api.py", line 73, in get
        return request("get", url, params=params, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\ASUS\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\requests\api.py", line 59, in request
        return session.request(method=method, url=url, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\ASUS\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\requests\sessions.py", line 589, in request
        resp = self.send(prep, **send_kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\ASUS\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\requests\sessions.py", line 703, in send
        r = adapter.send(request, **kwargs)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\ASUS\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\requests\adapters.py", line 519, in send
        raise ConnectionError(e, request=request)
    requests.exceptions.ConnectionError: HTTPConnectionPool(host='hc3-00006080', port=80): Max retries exceeded with url: /api/refreshStates?lang=en&rand=0.09580020181569104&logs=false&last=306903 (Caused by NameResolutionError("<urllib3.connection.HTTPConnection object at 0x000001F46AE06710>: Failed to resolve 'hc3-00006080' ([Errno 11001] getaddrinfo failed)"))

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2032.0_x64__qbz5n2kfra8p0\Lib\threading.py", line 1045, in _bootstrap_inner
        self.run()
      File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2032.0_x64__qbz5n2kfra8p0\Lib\threading.py", line 982, in run
        self._target(*self._args, **self._kwargs)
      File "C:\Users\ASUS\Documents\fibemu\.vscode\emufiles\fibenv.py", line 123, in refreshRunner
        except exceptions.TimeoutError as e:
               ^^^^^^^^^^^^^^^^^^^^^^^
    AttributeError: module 'requests.exceptions' has no attribute 'TimeoutError'

    [07.02.2024] [09:59:50] [DEBUG ] [QUICKAPP5000]: UIEvent:  {"eventType":"onReleased","elementName":"test","deviceId":5000,"values":[],"type":"UIEvent"}
    [07.02.2024] [09:59:50] [DEBUG ] [QUICKAPP5000]: B pressed

     

    Fixed in latest push. I've become a bit lazy working with strictly typed languages so I thought I would get a compile warning when using TimeoutError instead of Timeout - but python is not so strict... .

    6 hours ago, ClaudeH said:

    Hey @jgab,

    Don't know what happening, I can use the fibemu in multirootfolder mode, launching via the debug, and but none of the debugging feature,breakpoints, watches, works. 

    Running on windows, so python seems all ok and local lua debugger extension installed. 

     

    Even simpe lua is not debugging. 

     

    Any idea where I should try to seek for the issue

    I will investigate and come back...

    Link to comment
    Share on other sites

    @jgab Jan i am pretty list when, where to use brackets and semicolons when using if else inside  a rule. I am not using || >> format becuase i am even more lost there, but i want to do some if else statements. this is a test code, that doesnt throw error without <if else> part, but throws error when there is a <if else? part

    Please login or register to see this code.

     

     

    Please login or register to see this code.

    Please login or register to see this attachment.

    Link to comment
    Share on other sites

  • Topic Author
  • 6 hours ago, ClaudeH said:

    Hey @jgab,

    Don't know what happening, I can use the fibemu in multirootfolder mode, launching via the debug, and but none of the debugging feature,breakpoints, watches, works. 

    Running on windows, so python seems all ok and local lua debugger extension installed. 

     

    Even simpe lua is not debugging. 

     

    Any idea where I should try to seek for the issue

    Are you on PC or Mac?

    I've pushed a fix that I think will work for both. Now (hopefully) the debugger will get the right path to the source file.

    Multi-root is a bit tricky and I haven't understod all nuances yet...

    • Thanks 1
    Link to comment
    Share on other sites

  • Topic Author
  • 29 minutes ago, Neo Andersson said:

    @jgab Jan i am pretty list when, where to use brackets and semicolons when using if else inside  a rule. I am not using || >> format becuase i am even more lost there, but i want to do some if else statements. this is a test code, that doesnt throw error without <if else> part, but throws error when there is a <if else? part

     

     

    Please login or register to see this code.

    Please login or register to see this attachment.

     

    The last example throws a parser error because there is no statements in the then or the else branch.

    I could allow for empty branches, but at the moment it's not.

    This doesn't

    Please login or register to see this code.

     

    Edited by jgab
    Link to comment
    Share on other sites

    Hi Jan,

    Im' using a Windows 11 and debugging is back 😀

    Many thanks !

    Edited by chelson
    • Like 1
    Link to comment
    Share on other sites

  • Topic Author
  • 41 minutes ago, chelson said:

    Hi Jan,

    Im' using a Windows 11 and debugging is back 😀

    Many thanks !

    Good, I believe that multi-root is the future for project setups...

    Link to comment
    Share on other sites

    hi Jan,

     

    I have found a new strange issue:

    When I am using :

    571        cZd=api.get("/panels/climate")
    572        print(json.encode(cZd[1]))

    I have printed the correct table of key [1].

     

    But when I am trying to get the details of climate zone 1 like:

    576          currentZoneDetail = api.get("/panels/climate/"..ZoneId)-- why it does not work now?? get null...
    577          __print(json.encode(currentZoneDetail))
     

    I am getting a "null" response and then the QA crashes when any element of currentZoneDetails is requested.

    [14.02.2024] [20:07:20] [DEBUG ] [QUICKAPP5000]: connected to HC3, ZoneId: 1
    null
    [14.02.2024] [20:07:21] [ERROR ] [QUICKAPP5000]: onAction: QuickApp:manualButton(...):attempt to index a nil value (global 'currentZoneDetail'), C:\Users\ASUS\Documents\fibemu\test\Manual_Heating_Override_Vs.lua:getClimateZoneDetails:577

     
     
     
    [14.02.2024] [20:07:20] [DEBUG ] [QUICKAPP5000]: connected to HC3, ZoneId: 1
     
     
     
    null
     
     
     
    [14.02.2024] [20:07:21] [ERROR ] [QUICKAPP5000]: onAction: QuickApp:manualButton(...):attempt to index a nil value (global 'currentZoneDetail'),

    Please login or register to see this link.

    :getClimateZoneDetails:577
    [14.02.2024] [20:07:20] [DEBUG ] [QUICKAPP5000]: connected to HC3, ZoneId: 1
     
     
     
    null
     
     
     
    [14.02.2024] [20:07:21] [ERROR ] [QUICKAPP5000]: onAction: QuickApp:manualButton(...):attempt to index a nil value (global 'currentZoneDetail'),

    Please login or register to see this link.

    :getClimateZoneDetails:577

     

    even the direct api call for zone id=1 api.get("/panels/climate/1") gives also a null result.

    I AM SURE THAT THIS API COMMAND  WAS WORKING PERFECTLY 1 WEEK AGO...

     

    Were can be the problem?

    note: in the first declaration of the QA, I load fibaroExtra.lua

    --%%file=examples/fibaroExtra.lua,fibaroExtra
    Link to comment
    Share on other sites

  • Topic Author
  • The emulator doesn't have an emulation of panels/climate/<id>

    If you do

    local res, err = api.get("/panels/climate/1")

    you see that the err is 500.

    If you want to work against the HC3 climate panels do

    api.get("/panels/climate/1","hc3")

    and condition it with if fibaro.emu exists....

     

     

    Link to comment
    Share on other sites

    jgabwrote:

    If you want to work against the HC3 climate panels do

    api.get("/panels/climate/1","hc3")

     

    Everything working fine now

    Thank you.👍

    Link to comment
    Share on other sites

    I have been a little to quick to say everything OK: I have now the same issue with api.put(“panels/climate/”..zoneID, tableData).

    I tried api.put(“panels/climate/”..zoneID, taleData,”hc3”) but it seems to not work: have you a solution?

     

    Also api.get("/devices/267") or api.get("/devices/267","hc3") are not working as well .

     

    By what type of lua code I need to use for getting what I want?

    Edited by Christb
    add 2 lines
    Link to comment
    Share on other sites

  • Topic Author
  • 1 hour ago, Christb said:

    I have been a little to quick to say everything OK: I have now the same issue with api.put(“panels/climate/”..zoneID, tableData).

     

    I tried api.put(“panels/climate/”..zoneID, taleData,”hc3”) but it seems to not work: have you a solution?

     

    What do you get as result?

    Please login or register to see this code.

    With the "hc3" flag the command is passed directly to the HC3 so the result is coming from the HC3.

     

     

    Link to comment
    Share on other sites

    With your format (local a,b = api...) I am getting

    nil 501

     

    Link to comment
    Share on other sites

  • Topic Author
  • Ok, now I see it. The path is missing a slash prefix

     api.put(“/panels/climate/”..zoneID, tableData,"hc3")

    Link to comment
    Share on other sites

    Sorry, the missing "/" was a typing error, the actual lines are :

        print(json.encode(climZTable))
       
    local a,b = api.put("/pannels/climate/"..ZoneId,climZTable,"hc3")
       
    print("c1; ",tostring(a),tostring(b))

    and I am getting still:

    [17.02.2024] [11:32:45] [DEBUG ] [QUICKAPP5000]: c1;  nil 501

     

    Is it possible to get more detailled info about the error?

     

    Do you think that the error 501 may come from a non compliant HC3 format of the climZTable?

    What is strange is that using the file "climZTable" in the Swagger, it is accepted (Code 200) and changes I have made in the file are accepted.

    Edited by Christb
    Link to comment
    Share on other sites

  • Topic Author
  • 6 minutes ago, Christb said:

    Sorry, the missing "/" was a typing error, the actual lines are :

        print(json.encode(climZTable))
       
    local a,b = api.put("/pannels/climate/"..ZoneId,climZTable,"hc3")
       
    print("c1; ",tostring(a),tostring(b))

    and I am getting still:

    [17.02.2024] [11:32:45] [DEBUG ] [QUICKAPP5000]: c1;  nil 501

     

    Is it possible to get more detailled info about the error?

     

    Do you think that the error 501 may come from a non compliant HC3 format of the climZTable?

    What is strange is that using the file "climZTable" in the Swagger, it is accepted (Code 200) and changes I have made in the file are accepted.

    How does the table look?

    print(json.encode(climZTable))

    What is ZoneId?

     

    Could you also set

    Please login or register to see this code.

    so we see the request (unfortunately not the payload)

    Link to comment
    Share on other sites

    [17.02.2024] [12:38:41] [DEBUG ] [QUICKAPP5000]: climZTable:  {"created":1707927223,"mode":"Manual","active":true,"properties":{"friday":{"evening":{"temperatureHeating":21,"temperatureCooling":23,"hour":17,"minute":0},"day":{"temperatureHeating":24,"temperatureCooling":26,"hour":10,"minute":15},"morning":{"temperatureHeating":21,"temperatureCooling":23,"hour":7,"minute":0},"night":{"temperatureHeating":21,"temperatureCooling":23,"hour":22,"minute":0}},"saturday":{"evening":{"temperatureHeating":21,"temperatureCooling":23,"hour":17,"minute":0},"day":{"temperatureHeating":21,"temperatureCooling":23,"hour":9,"minute":0},"morning":{"temperatureHeating":21,"temperatureCooling":23,"hour":7,"minute":0},"night":{"temperatureHeating":21,"temperatureCooling":23,"hour":22,"minute":0}},"monday":{"evening":{"temperatureHeating":21,"temperatureCooling":23,"hour":17,"minute":0},"day":{"temperatureHeating":21,"temperatureCooling":23,"hour":9,"minute":0},"morning":{"temperatureHeating":21,"temperatureCooling":23,"hour":7,"minute":0},"night":{"temperatureHeating":21,"temperatureCooling":23.5,"hour":22,"minute":0}},"handTimestamp":1711769920,"wednesday":{"evening":{"temperatureHeating":21,"temperatureCooling":24,"hour":17,"minute":0},"day":{"temperatureHeating":21,"temperatureCooling":23.5,"hour":9,"minute":0},"morning":{"temperatureHeating":21,"temperatureCooling":23,"hour":7,"minute":0},"night":{"temperatureHeating":21,"temperatureCooling":24.5,"hour":22,"minute":0}},"handSetPointHeating":21,"vacationEndTime":1709765940,"vacationSetPointHeating":17.5,"handSetPointCooling":24,"currentTemperature":22.3,"mode":"Heat","vacationMode":"Heat","currentTemperatureHeating":21,"tuesday":{"evening":{"temperatureHeating":21,"temperatureCooling":23.5,"hour":17,"minute":0},"day":{"temperatureHeating":21,"temperatureCooling":23,"hour":9,"minute":0},"morning":{"temperatureHeating":21,"temperatureCooling":23,"hour":7,"minute":0},"night":{"temperatureHeating":21,"temperatureCooling":24,"hour":22,"minute":0}},"calculationStrategy":"avg","devices":[267],"vacationStartTime":1707174000,"temperatureSensors":[209],"handMode":"Heat","vacationSetPointCooling":24,"incompatibleDevices":[],"currentTemperatureCooling":24,"thursday":{"evening":{"temperatureHeating":21,"temperatureCooling":23,"hour":17,"minute":0},"day":{"temperatureHeating":21,"temperatureCooling":23,"hour":9,"minute":0},"morning":{"temperatureHeating":21,"temperatureCooling":23,"hour":7,"minute":0},"night":{"temperatureHeating":21,"temperatureCooling":23,"hour":22,"minute":0}},"sunday":{"evening":{"temperatureHeating":21,"temperatureCooling":23,"hour":17,"minute":0},"day":{"temperatureHeating":21,"temperatureCooling":23,"hour":9,"minute":0},"morning":{"temperatureHeating":21,"temperatureCooling":23,"hour":7,"minute":0},"night":{"temperatureHeating":21,"temperatureCooling":23,"hour":22,"minute":0}}},"modified":1707927223,"id":14,"name":"Vestibule"}
    [17.02.2024] [12:38:41] [DEBUG ] [QUICKAPP5000]: c1;  nil 501
    [17.02.2024] [12:38:41] [DEBUG ] [QUICKAPP5000]: ZoneId:  14

    Link to comment
    Share on other sites

    Hi Jan,

    I have tested the same function code in TQAE (zeroBrane) and I got the same resul: nil, 501 and the "climateZTable" data are also accepted in Swagger...

    Link to comment
    Share on other sites

    Again my fault, my huge fault...

    The comand to work has to be 🙂:

    local a,b = api.put("/panels/climate/"..ZoneId,climZTable,"hc3")

    previously I wrote: api.put("/pannels/... then 501 error is expected☹️

    • Like 1
    Link to comment
    Share on other sites

    dear JGAB,

    it seems that the json function: local AutoTemp = json.util.InitArray({}) is not yet accepted; I got error:

    [18.02.2024] [11:21:05] [ERROR ] [QUICKAPP5000]: :onInit() :attempt to index a nil value (field 'util'), C:\Users\ASUS\Documents\fibemu\examples\QA_UIselect.lua:_onInit:124
    --> C:\Users\ASUS\Documents\fibemu\examples\fibaroExtra.lua:onInit:111
    --> @.vscode/emufiles/lua/quickApp.lua:_init:194
    --> C:\Users\ASUS\Documents\fibemu\examples\fibaroExtra.lua:init:117
    --> @.vscode/emufiles/lua/class.lua:QuickApp:41

     

     

    Link to comment
    Share on other sites

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Reply to this topic...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.

    ×
    ×
    • Create New...