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

Dear @jgab,

I just notice this message in the vs code DEBUG CONSOLE during a QA running with a timoutTimer set to 24*60*60*1000 (may not be related to the QA code):

Unknown event type:     {"type":"EntitiesAmountChangedEvent","created":1712586690,"createdMillis":1712586690336,"data":{"source":"Zwave","entitiesAmount":57}}
Unknown event type:     {"type":"EntitiesAmountChangedEvent","created":1712587723,"createdMillis":1712587723999,"data":{"source":"Zwave","entitiesAmount":58}}
Unknown event type:     {"type":"EntitiesAmountChangedEvent","created":1712587811,"createdMillis":1712587811110,"data":{"source":"Zwave","entitiesAmount":58}}
Unknown event type:     {"type":"EntitiesAmountChangedEvent","created":1712587880,"createdMillis":1712587880676,"data":{"source":"Zwave","entitiesAmount":57}}
Unknown event type:     {"type":"EntitiesAmountChangedEvent","created":1712587973,"createdMillis":1712587973648,"data":{"source":"Zwave","entitiesAmount":58}}

Will it be comming from the addition, at that time, of 2 door/window sensors?

Edited by Christb
Link to comment
Share on other sites

  • Topic Author
  • 15 hours ago, Christb said:

    Dear @jgab,

    I just notice this message in the vs code DEBUG CONSOLE during a QA running with a timoutTimer set to 24*60*60*1000 (may not be related to the QA code):

    Unknown event type:     {"type":"EntitiesAmountChangedEvent","created":1712586690,"createdMillis":1712586690336,"data":{"source":"Zwave","entitiesAmount":57}}
    Unknown event type:     {"type":"EntitiesAmountChangedEvent","created":1712587723,"createdMillis":1712587723999,"data":{"source":"Zwave","entitiesAmount":58}}
    Unknown event type:     {"type":"EntitiesAmountChangedEvent","created":1712587811,"createdMillis":1712587811110,"data":{"source":"Zwave","entitiesAmount":58}}
    Unknown event type:     {"type":"EntitiesAmountChangedEvent","created":1712587880,"createdMillis":1712587880676,"data":{"source":"Zwave","entitiesAmount":57}}
    Unknown event type:     {"type":"EntitiesAmountChangedEvent","created":1712587973,"createdMillis":1712587973648,"data":{"source":"Zwave","entitiesAmount":58}}

    Will it be comming from the addition, at that time, of 2 door/window sensors?

    fibemu listens to all events from the HC3 to be able to update internal states of devices etc.

    If there is an event that I haven't seen before it logs this "warning" - it's nothing to worry about but it can be a bit annoying. I have added it to known events now. Thanks.

    • Like 1
    Link to comment
    Share on other sites

  • Topic Author
  • Updated requirements.txt.

    It will support Python 3.12 now.

    launch.json now runs the python that is configured under in settings.json

    Ex.

    Please login or register to see this code.

    In my case I point it to the python in my workspace venv.

    The important part is that it needs to point to a python that has the requirements (python libraries) installed.

    • Thanks 1
    Link to comment
    Share on other sites

    6 hours ago, jgab said:

    Updated requirements.txt.

    It will support Python 3.12 now

    dear @jgab, is it possible after a git pull to continue to use python 3.11 ?

    I have the fear that after the update I get in the same trouble that I experienced earlier after a windows update.

    Link to comment
    Share on other sites

  • Topic Author
  •  

    1 hour ago, Christb said:

    dear @jgab, is it possible after a git pull to continue to use python 3.11 ?

    I have the fear that after the update I get in the same trouble that I experienced earlier after a windows update.

    Yes, I tried it with both 3.11 and 3.12. You need to install the libraries for the right version.

    • Like 1
    Link to comment
    Share on other sites

    dear @jgab,

    I got in the trap: after the git pull, fibemu was no more working but with a different message:

    Le chemin d'acc�s sp�cifi� est introuvable. which means that the specified path cannot be found.

    I have changed the "settings.son" line "fibpython" with my python.exe path and fibemu works again ok 👍.

    File settings.json is not in the ".gitignore" which means that I will have to update "settings.json" after any git pull. True?

    Is there a way to add this path into "config.json" which will protect my settings? 

     

     

     

    Link to comment
    Share on other sites

  • Topic Author
  • 9 hours ago, Christb said:

    dear @jgab,

    I got in the trap: after the git pull, fibemu was no more working but with a different message:

    Le chemin d'acc�s sp�cifi� est introuvable. which means that the specified path cannot be found.

    I have changed the "settings.son" line "fibpython" with my python.exe path and fibemu works again ok 👍.

    File settings.json is not in the ".gitignore" which means that I will have to update "settings.json" after any git pull. True?

    Is there a way to add this path into "config.json" which will protect my settings? 

    True and yes, that's bad. The path needs to be set in vscode before my code is run and config.json is read... Let me think about it. It would be better to be able to use an environment variable

    • Thanks 1
    Link to comment
    Share on other sites

    Good Morning Jan,

    I would like to ask two questions about VSC.

    1. Is it a way to import QA to VSC including interface? I have one with quite complex UI and don't want to recreate in manually in VSC.

    2. To check above first I tried to "Run task", download and unpack. But was confronted with the following error:

    Please login or register to see this code.

    What can I do wrong? Download fqa task leads to the same result.

    Link to comment
    Share on other sites

  • Topic Author
  • 4 hours ago, Łukasz997 said:

    Good Morning Jan,

    I would like to ask two questions about VSC.

    1. Is it a way to import QA to VSC including interface? I have one with quite complex UI and don't want to recreate in manually in VSC.

    2. To check above first I tried to "Run task", download and unpack. But was confronted with the following error:

    Please login or register to see this code.

    What can I do wrong? Download fqa task leads to the same result.

    No, the code had gone bad as I moved io to another place and never tested the tasks...

    I have fixed it now and pushed the changes to GitHub

    • Thanks 1
    Link to comment
    Share on other sites

    2 godziny temu, jgab napisał:

    No, the code had gone bad as I moved io to another place and never tested the tasks...

    I have fixed it now and pushed the changes to GitHub

    Thank you, its working and the interface is imported as well.

    Link to comment
    Share on other sites

    One more remark: when importing a "switch" item of UI, the result in VSC seems to be wrong. One of the switches import like that ("button" part is OK):
     

    Please login or register to see this code.

    and switch part should be:
    switch="dataBase", text="Tabela odczytów", onReleased="PrintDataEnable"

    Link to comment
    Share on other sites

    hi @jgab, for your information, I have just got new Unknown event messages which seem to be related to a user id2 action but there was not action at all at that time.

    Unknown event type:     {"data":{"id":2},"createdMillis":1713945605977,"type":"UserModifiedEvent","created":1713945605,"objects":[{"objectId":2,"objectType":"user"}],"sourceType":"system"}
    Unknown event type:     {"data":{"id":2},"createdMillis":1713945688850,"type":"UserModifiedEvent","created":1713945688,"objects":[{"objectId":2,"objectType":"user"}],"sourceType":"system"}

     

    The debug Console of the running QA under development does not show any time stamp for the above message.

    Also for getting only debug message comming from the running QA, I have added: --%%debug=permissions:false,refresh:false which suppresses all event messages.

    But with --%%debug=permissions:false,refresh_quickAppVariables:false then I still get event messages for any QA variable change which is little anoying as some of my QuickApp variables are very important tables (one is just adding up to 100 lines in the debug console): why "quickAppVariables:false" does not work? Wrong syntax from me?

    Link to comment
    Share on other sites

    after update from GIT there is error message: The system cannot find the specified path.

    Link to comment
    Share on other sites

  • Topic Author
  • 5 minutes ago, petrkl12 said:

    after update from GIT there is error message: The system cannot find the specified path.

    Yes, launch.json and task.json now use the configuration variable "fibpython" to point at the python that should be used.

    So, in settings.json you need to set "fibpython" to pint at the python in use. I have it pointing at a python venv in my project.

    Please login or register to see this code.

    You can make it point at an "external" python. Just make sure that that python has the libraries, uvicorn etc.

     

    It's not ideal as settings.json will be overwritten when you update from git... I'm thinking how to solve it but I haven't been able to make launch.json use environment variables, at least on MacOS.

     

    Link to comment
    Share on other sites

    I have added:

        "fibpython":"e:\\Python312\\Scripts",

    but there is error:

    '"e:\Python312\Scripts"' is not recognized as an internal or external command, operable program or batch file.

     

     

    Link to comment
    Share on other sites

  • Topic Author
  • 31 minutes ago, petrkl12 said:

    I have added:

        "fibpython":"e:\\Python312\\Scripts",

    but there is error:

    '"e:\Python312\Scripts"' is not recognized as an internal or external command, operable program or batch file.

     

     

    It needs to point to the python interprter 

    Link to comment
    Share on other sites

    now it works, thanks 😀

     

    Installed python 3.12 including all libraries based on requirements.txt

    + added to settings.json this:

    "fibpython":"e:\\Python312\\python",

     

    Edited by petrkl12
    Link to comment
    Share on other sites

  • Topic Author
  • 16 hours ago, petrkl12 said:

    now it works, thanks 😀

     

    Installed python 3.12 including all libraries based on requirements.txt

    + added to settings.json this:

    "fibpython":"e:\\Python312\\python",

     

    Good. The problem now is that settings.json will be overwritten when you do a pull from the repo.

    So, what I have done is to remove settings.json from the repo and added .vscode/settings.json to .gitignore

    This way people can have their own settings file.

    I have added a settings.templ where I store an example of a settings.json, i.e. the ignored globals lists are useful to have in your settings.json

    • Like 1
    • Thanks 1
    Link to comment
    Share on other sites

    hi @jgab, just for your information new unknown events comming from the energy pannel (pricing parameters):

    Unknown event type:     {"createdMillis":1714161600078,"data":{"newTariff":"CREUSES","oldTariff":"PLEINES"},"type":"ActiveTariffChangedEvent","created":1714161600}
    Unknown event type:     {"createdMillis":1714168800107,"data":{"newTariff":"UNUSED","oldTariff":"CREUSES"},"type":"ActiveTariffChangedEvent","created":1714168800}
    Unknown event type:     {"createdMillis":1714190400190,"data":{"newTariff":"PLEINES","oldTariff":"UNUSED"},"type":"ActiveTariffChangedEvent","created":1714190400}

     

     

    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...