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


Recommended Posts

  • Topic Author
  • Posted
    15 hours ago, Brors94 said:

    So it is smart to setup most of the automasion in quickapps then? 🤔 If I understand you right :D 
    I tested on my HC3, it gave me 47s on scene and 11 on QA :) 

    The only thing you get from Lua scenes are the triggers - but there are RefreshStateSubscriber and some other libraries that gives you that for QAs too.

    • Like 1
    Posted
    30 minutes ago, jgab said:

    The only thing you get from Lua scenes are the triggers - but there are RefreshStateSubscriber and some other libraries that gives you that for QAs too.

    Yea, your eventlib does give me the triggers i need :D 

    • 2 months later...
    Posted

    I have been searching over the forum if it is possible to update the device hidden with lua.

    we can use this too update the other check and ui:

      self:updateProperty("log", "QA Started")
      self:updateProperty("deviceRole", "Other")
      self:updateProperty("categories",{"other"})
      self:updateProperty("useUiView",false)

     

    any1 know how to update the device hidden? 

     

    Please login or register to see this image.

    /monthly_2024_07/image.png.ee291f0148e434201711d0689c10c843.png" />

     

     

    Posted

    I guess you should update the "visible" property : true/false

    Posted
    8 hours ago, lazer said:

    I guess you should update the "visible" property : true/false

     

     

    I just found out how too.... And i tried everything like 

     

     
    self:updateProperty("visible", "false")
    self:updateProperty("visible", false)

     

    and api.post things... 

     

    but just realized it is api.put..... 😐

    this did it.... 

     

    api.put("/devices/"..QuickAppID,{visible=false})

     

     

     

     

     
  • Topic Author
  • Posted

    or just 

    Please login or register to see this code.

    :-) 

    • Like 2
    Posted

    Hi there, hopefully an easy question... 

     

    I have a quickapp that grabs all the "cover" type entities from Home Assistant, and creates child devices under itself for each one. The child devices have methods that send commands to Home Assistant via API. 

     

    The hardware in the blinds doesn't support setting an arbitrary level, so to fudge it I have a variable on each blind that stores how many seconds the blind takes to open or close, top to bottom. SetValue then calculates the right fraction of that and sends a command to HA to move the blind for that many seconds (there is a custom HA script to receive that). 

     

    I thought I was being clever doing it this way, as I could default every blind to 40 seconds, but for one or two that are significantly shorter than that I could just edit their variables to the right value. Apparently not!

     

    Please login or register to see this attachment.

     

    This is the code that sets up the variable:

     

    Please login or register to see this code.

     

    Is the issue that the devices were set up with initial properties that didn't include that variable? i.e. 

     

    Please login or register to see this code.

     

    If that is the case, is there a way I can now fix this without destroying and recreating all the devices with new IDs? (That's not impossible but I then have to update 3 separate Home Remote instances to get the new devices in there...)

     

    Thanks!

    Posted (edited)
    8 hours ago, jgab said:

    or just 

    Please login or register to see this code.

    :-) 

    OMG!!! 😆😆😆

     

    Plenty of roads to Rome am I right? 😂

     

     

     

    Edited by Brors94
    Posted

    Good morning. @jgab I am working with my Nest Thermostat Quick App (written and maintained by Guillaume Waignier). When I run it in fibemu it displays in °C which is the Fibaro system default. Is there a flag for fibemu that would allow me to change the emulator system setting to °F? (And, I suppose, change metric distance units to English distance units?). Or, I would suppose that reading those values from my Z-Box hub would overcome that challenge, at least when I'm not trying to run local.

     

    Thank you.

     

    Peter

    Posted

    @jgab,

     

    I also have a question about the debug console in VSC that has frustrated me. Is there a switch or option somewhere that would cause the debug console to be the active window when a debug session starts? Currently my panel always goes to Terminal when I start a debug session. Perhaps you could add that info to your fibemu.pdf file?

     

    Thank you

     

    @PeterV959

    • 3 weeks later...
  • Topic Author
  • Posted
    On 7/12/2024 at 6:47 PM, PeterV959 said:

    @jgab,

     

    I also have a question about the debug console in VSC that has frustrated me. Is there a switch or option somewhere that would cause the debug console to be the active window when a debug session starts? Currently my panel always goes to Terminal when I start a debug session. Perhaps you could add that info to your fibemu.pdf file?

     

    Thank you

     

    @PeterV959

    something here maybe? 

    Please login or register to see this link.

     

    On 7/6/2024 at 1:35 PM, PeterV959 said:

    Good morning. @jgab I am working with my Nest Thermostat Quick App (written and maintained by Guillaume Waignier). When I run it in fibemu it displays in °C which is the Fibaro system default. Is there a flag for fibemu that would allow me to change the emulator system setting to °F? (And, I suppose, change metric distance units to English distance units?). Or, I would suppose that reading those values from my Z-Box hub would overcome that challenge, at least when I'm not trying to run local.

     

    Thank you.

     

    Peter

    No, no option for that - it's just an emulator, and metrics is the future! :-) 

    Posted
    i am trying to create timer from mobile application play music daily at 7AM but when i try to select in what to do action tab i cant see any function related to sonos quick app ....please tell me now how i can acheive it 
    • 2 months later...
    Posted
    On 2/21/2022 at 12:11 PM, jgab said:

    Please login or register to see this link.

    Ok, this version monitors CPU usage too - thus the new name "Memory and CPU watcher"

    Sampling interval is selectable - 60s, 5min, 30min, 1hour, 24hours

    The cpu usage is in percent and is the os.clock() of the os.time() for the sample interval.

    os.clock measure the cpu used by the process and will not count time waiting for setTimeouts or hanging in net.HTTPClient():request(...) etc. ... so I believe it's a fair estimate.

    If your QA does a loop like

    Please login or register to see this code.

    it will report close to ~95%. We can't do a tight "while true do end" loop as it will  give no time for the QA to respond to the probe request.

     

    Please login or register to see this attachment.

     

     

     

     

    Love this quickapp @jgab. It helped my find a quickapp that was giving me some problems :D

    But may I ask, Is it alot of  memory use on a QA if it is 2.5 MB memory useage alot for a QA.
    I see your eventrunner do about 1MB. 
    And that is alot more Advanced then my Room controller quickapps 😅

     

    But my code isnt that effective I guess and that is why it uses more memory? 🤔

    it also uses about 3.6% cpu :)

    is this something to worry about? (the bad QA had over 30% cpu and +15MB memory 😅 )

    image.png.3da53864adf5a35efac3045d3ab90d8d.png

     

     

     

     

     

     

     

    Posted
    On 2/6/2023 at 1:18 PM, jgab said:

    So, continue the QuickAppChild journey. This library is probably the easiest to create and keep a pre-defined set of QuickAppChild devices in sync.

    Library:
     

    Please login or register to see this code.

     

    ...and then use it like this

    Please login or register to see this code.

     

    It's not so difficult to modify it for dynamically created children - the 'myChildrenTable' just needs to be modified with the added devices and persisted in a quickAppVariable.

    @jgab Jan using your library, i am trying to set a value on a child device either when it is created or when just QA restarts and reinitialize child devices.

     

    So this is how i am creating the childtable with values coming from a http response. I am adding an extra field initValue = m.

     

    Please login or register to see this code.

     

     

    and later in onInit i want to set these initValues to each device

     

    Please login or register to see this code.

     

    Where to do it please?

    On 2/6/2023 at 8:12 PM, jgab said:

    Sorry, was the international heritage of the code...

     @jgab Jan using your library, i am trying to set a value on a child device either when it is created or when just QA restarts and reinitialize child devices.

     

    So this is how i am creating the childtable with values coming from a http response. I am adding an extra field initValue = m.

     

    Please login or register to see this code.

     

     

    and later in onInit i want to set these initValues to each device

     

    Please login or register to see this code.

     

    Where to do it please?

  • Topic Author
  • Posted

    If you can set the values after the children is created, you can do

    Please login or register to see this code.

     

    If you need to set the value in the construction method for the child, you need to lookup the initValue from myChildren inside your child constructor method somehow...

    • Thanks 1
    Posted

    @jgab Jan this is the code that i use in from your child library

    Please login or register to see this code.

     

    later in oninit i am creating the myChildren table and running the child initilaization

     

     

    Please login or register to see this code.

     

    the problem is childs are created, with proper com.fibaro classes, but every time i restart the QA it complanis about missing classed, and uses the base class

    Class for the child device: 3657, with type: com.fibaro.windSensor not found. Using base class: QuickAppChild

     

    and when the loop triggers the datafetch again it seems that the whole init function runs again, what should not, as it is not called anymore, but i am getting these logs for every device agin and agin on every new poll

    Instantiating object Netatmo Bathroom Module_Humidity

     

     so where is the issue i cant find. It is related seomehow to the http call callbacks? So the code waits until the data is fetched, and then creates the childs upon the fetched data..and later just updates existing childs from self.children to new values from the http response..

    I can't see eny problem..

    Would you please assist a bit?

     

     

     

     

  • Topic Author
  • Posted

    Exactly which child library are you using - there are a couple of versions floating around...

    Can you try to add this line the first thing in your QuickApp:onInit()...

    Please login or register to see this code.

     

  • Topic Author
  • Posted
    1 hour ago, jgab said:

    Exactly which child library are you using - there are a couple of versions floating around...

    Can you try to add this line the first thing in your QuickApp:onInit()...

    Please login or register to see this code.

     

    You need to do that especially if you run initChildren after :onInit(),which you do in your case as it runs in the callback from an http request.

    Posted (edited)
    50 minutes ago, jgab said:

    You need to do that especially if you run initChildren after :onInit(),which you do in your case as it runs in the callback from an http request.

    I am using this one, and still getting these logs

    Instantiating object Kiss Zoli Home (Netatmo Livingroom Module)_Temperature[21.10.2024] [09:21:37] [DEBUG] [QUICKAPP3604]: Instantiating object Kiss Zoli Home (Netatmo Livingroom Module)_Humidity[21.10.2024] [09:21:37] [DEBUG] [QUICKAPP3604]: Instantiating object Netatmo Bathroom Module_Humidity[21.10.2024] [09:21:37] [DEBUG] [QUICKAPP3604]: Instantiating object... 

     

    Please login or register to see this code.

     

    Edited by Neo Andersson
  • Topic Author
  • Posted

    Well, the message

    Instantiating object Kiss Zoli Home (Netatmo Livingroom Module)_Temperature[21.10.2024] [09:21:37]

    is not an error. It's just logged when it creates the Lua object from QwikAppChild

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