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


HC3 QuickApps coding - tips and tricks


jgab

Recommended Posts

Jan,

I cant find why my allLightOn(823) plug is switched on. There is only one rule who is doing this.

Id QA= 802

allLightOn is modifyed and by testing get if there is alarm the cmd >>on.  If switche allLightOn>> off it switch off

[13:40:09] [DEBUG] [QUICKAPP802]: --------------------------------------------- Running ---------------------------------------------
[06.01.2021] [13:40:09] [DEBUG] [QUICKAPP802]: [true]>>'Rule:1[@{catch,05:00} => Util.checkForUpdates()]'

a lot of triggers pasing by

[06.01.2021] [13:44:16] [DEBUG] [QUICKAPP802]: Incoming trigger:{"type":"device","property":"value","value":true,"old":false,"id":823}
[06.01.2021] [13:44:16] [DEBUG] [QUICKAPP802]: [true]>>'Rule:7[alarmApp.alleVerlichting:isOn =>...]'

It seems this QA  has a restart??? Will that trigger the 823 on?? Does  a QA restart I gues you mentioned it starts once?

Plug is also mentioned in Arming, smokedetectors and outsidering security  scenes dont have any debug on that time.

After around one minute it switch off

If kitchen or toilet door are open it triggers allLightOn????? That I cant see but the light switch on!!! Also other triggers but cant find them.

The moved arming scene from HC2 shows tose doors unarmed and safe

In alarm chapter of HC3 all is off, I removed all vinks and now nothing happens if door opens. Remark: in HC3 there is no QA to trigger the alarm built in.

It is possible a glitch but how to discover who triggers?

Can you enlighten me?

//Sjakie

 

Link to comment
Share on other sites

On 12/30/2020 at 8:35 AM, jgab said:

This post explains a bit more what's going on with child devices. It is recommended to read the previous post on Lua functions and classes as well as Fibaro's own tutorial on QuickAppChild devices.

Please login or register to see this link.

If you spot any faulty information or something that could be clarified better let me know and I will update and give you credit.

 

Child devices are QAs that "belong" to and is created by a "mother" QA.

 

"Mother QA"

   |

   +--> Child 1 QA   

   |

   +--> Child 2 QA   

   |

   +--> Child 3 QA

   

Children are, and look like regular QuickApp devices on the HC3. They list among "other" devices and have device IDs. The difference is that they don't have their own code, instead the code for the children resides in the mother QA definition (file) - which typically is the QA that creates the children.

They are always listed directly under the mother QA, so it breaks sorting on deviceIDs, but it is usually more practical to have them grouped together.

 

Typically, child QAs represent external devices/services that we want to represent on the HC3. Usually, the external devices are accessed through HTTP or TCP. However, child QAs, like regular QAs, can serve any function. Maybe a QA that can create multiple alarm clock child QAs or something similar.

 

Like regular QAs, child QAs are also assigned a type. Because it's not possible to add custom UIs to child QAs (at the moment), we need to select the type with care as it decides what UI controls the child will have.

There are a lot of types to choose between. To print a list of types one can run this code:

Please login or register to see this code.

 

Not all devices have UIs, so it's a test and try.

 

We can access the QA structure of a child like we do with a regular QA.

  api.get("/devices/77")

will return the QA structure for a child device with id 77. What is special with child QAs is that they have a structure key named 'parentId', that is the id of the mother QA.

We can retrieve the children of a mother QA with

api.get("/devices?parentId=66")

if the mother QA has the id 66. The query will return all devices that has a parentId key equal to 66.

A child will also have an interfaces property of type quickAppChild

 

Please login or register to see this code.

 

So, we have said that child devices are like regular QuickApp devices. What happens when we press a UI button on a child device, or call fibaro.call(childID,"action",...) is that the action and UI events are sent to the parent of the child QA. The system sees the parentId of the device and sends the events to the parent.

The parent QA will receive events, where some of the events have IDs that corresponds to its children. It then finds the code for the child with that ID and call corresponding methods defined for that child.

 

How do we implement the code for a child in a QuickApp?

 

Like the QuickApp class that helps us to define the main/mother QuickApp, quickApp children are usually implemented with the class QuickAppChild.

A side note, QuickAppChild is not a subclass of QuickApp. QuickApp and QuickAppChild are subclasses of the class QuickAppBase. QuickAppBase implements everything a QuickApp needs, except for handling children. QuickAppChild is a simple subclass of QuickAppBase and doesn't seem to add any child specific methods

 

class QuickAppBase (self:debug, self_trace,... self:updateView, self:updateProperty,...)

   |

   +--> QuickApp (self:createChildDevice, self:removeChildDevice, self:initChildDevices )

   |

   +--> QuickAppChild ()

 

Please login or register to see this code.

 

class Child1(QuickAppChild)

says that our new Child1 class should be a subclass of QuickAppChild.

This statement actually defines a method Child1() that we can use to create a new Child1 instance. We call it a 'constructor'.

Please login or register to see this code.

 

It's a bit more complicated. We usually want to initialize our new child in some way. That is accomplished with the function

Please login or register to see this code.

This defines an 'initializer' function, Child1:__init(device), that is called by the Child1's constructor. The first thing we do inside the initializer is to call the parent's initializer

QuickAppChild.__init(self,device).

The QuickAppChild's initializer expects 2 arguments. The 'self' of the object we are creating and the definition 'device' that is the table structure we get if we do api.get("/devices/77") - assuming that 77 was a QuickAppChild.

  

The initializer for QuickAppChild will add fields to self, like self.id, self.name, self.type, self.properties.*.

It copies those values from the 'device' structure.

 

Where does 'self' come from in the initializer?

Functions defined with ':' like

function Child1:__init(device) 

is a shortcut for 

function Child1.__init(self,device) 

 

Our construnctor Child1() on a high level is defined something like

Please login or register to see this code.

 

the '...' parameter makes sure that any argument, like 'device', that is passed as an argument to Child1 is passed on to the .__init function.

 

Let's make a child device with a constructor that takes the nick name of a device.

Please login or register to see this code.

 

Now we can create a Child2 object with nickname 'Bob'

Please login or register to see this code.

As we will see later, additional arguments to child constructors are not so useful in practice, and there are other means to pass data to children when they are created.

 

Anyway, where does 'device' come from?

Creating a Child2 object doesn't actually create a child device. We should view the Child2 object as a "code" wrapper around the real child device that we create. Every time the QA starts/restarts it needs to re-create this code wrappers and associate them to the existing child devices. We will talk more about that later when we come to loading children at startup.

    

The normal way to create a QuickAppChild object is to use the QuickApp function 

function QuickApp:createChildDevice(options,constructor)

Please login or register to see this code.

 

This function does 2 things. It creates a child device on the HC3 and it creates a Lua object with the constructor that is associated with the device. It looks something like this:

 

Please login or register to see this code.

 

The /plugins/createChildDevice creates the QuickApp child device in the system. The QuickApp will be assigned the next available deviceId number. We can't choose IDs for devices we create. The api call returns the QuickApp child structure, where we can find the id that it got assigned.

It then creates the Child instance, using the constructor we have specified, Child2. It sends the device structure as an argument and that is how our QuickAppChild objects get that 'device' argument.

 

The QuickApp also has a table, self.childDevices, where it maps the childrens ID's to the object it creates. It's a convenient way to keep track of child devices for the QA.

 

It also assigns the child's 'parent' field to be the QuickApp, the 'mother'. It means that inside a child method we can call a parent method easily.

 

Please login or register to see this code.

 

Note, looking at the createChildDevice definition above, we see that the child object is created before we assign it's parent field to the mother QA. This means that inside the child's initializer, .__init(), parent is not available. It's not until we exit .__init() it becomes set. So, don't use self.parent inside child's .__init method.

In fact, QuickAppChild object has a :onInit() method like the main QuickApp has. It's called from the QuickAppChild's initializator. However, it also means that self.parent is not set.

 

Fibaro gives us 2 ways to initialize the child object. In the .__init() method or the :onInit() method of the child object. What's better is a matter of taste. Because we need to define the .__init() anyway, to call the QuickAppChild.__init(self,device), I personally prefer to do the rest of the initialization there and ignore the child's :onInit() function.

 

Ok, now we know how to create QuickAppChildren.

 

This means that your QA needs to deal with two tasks. 

1. create children that are needed

2. when starting up, load existing children.

 

The first task is usually done by some initialization code that knows what child devices to create. It can be that we want to create child devices for various sensors from an external device that we access via HTTP. It could also be that we dynamically create children when we press a UI button on the mother QA. In any case, your main QA knows what children to create.

 

However, when the QA restarts it may already have created children, children that exists as devices registered in the HC3. It is then the QA's responsibility to load in these existing children, create the corresponding QuickAppChildren objects and make the association.

  

...and there is a function for that. 

function QuickApp:initChildDevices(map)

The map is a table that maps device types to class constructors for our children.

Ex.

{["com.fibaro.binarySwitch"] = Child1}

 

That function is quite primitive and will only allow one type to have one constructor (but several types can have the same constructor)

The way it works is something like to:

Please login or register to see this code.

 

This means that your QA at startup first needs to load devices and if not the number of devices expected, create the missing ones.

One way to do that could be

Please login or register to see this code.

 

The createMissingChildren function needs to see what children are missing and create them.

The reason we may need this logic is that users may delete child devices in the UI by clicking on their trashcan icon.

The good thing is that the list self.childDevices is updated when that happens. However, the mother QA doesn't get any warning or callback.

A way to trap that is to listen on /refreshStates and see the DeviceRemovedEvent for a child beloning to the QA. Other approaches are to patch QuickApp:removeChildDevice(id) or install an onAction handler. We will come back to that later.

 

If we use the QuickApp function self:removeChildDevice(id) the child device is removed and self.childDevices is also updated. 

 

The Fibaro guide to QuickAppChildren advices us using a table to map between created QA children and the external services/devices they represent. So the example is a table that maps the child HC3 deviceIds to the deviceIds of external Hue devices.

The reason for having this table is that a typical structure of the QA is that the main QA runs a loop polling the external devices and then calls a method with the new data to the corresponding child QA

  

"main QA":

Please login or register to see this code.

 

fetchData's second argument is the "success handler" that is called when data is read. Usually, HTTP requests are asynchronous so this model is needed.

        

If each child QA do their own polling, we don't need this map.

  

"child QA":

Please login or register to see this code.

 

What we need to do is to give the external_ID to the child so it knows where to fetch data from.

Here we use a function 'setup', but another method is to put that data in a quickAppVariable of the child.

 

We can solve a couple of the above problems by creating our own 'initChildDevices'...

First the ceateChild...

 

Please login or register to see this code.

 

This is similar to to provided QuickApp:createChildDevice(options,constructor) but is a bit more convenient.

Please login or register to see this code.

We give the name and type of the child. Then we provide the name (string) of the class that should be used to create a child QA. We can also add quickAppVariables that the child should have.

The advantage is that we store the external_ID talked about above in the child QA's quickAppVariable when we create the child. It also stores the name of the class as a quickAppVariable. We use that in our own initialize function.

 

Our function uses the original QuickApp:createChildDevice function to create the child. We could have used the api function

Please login or register to see this code.

or the provided function

Please login or register to see this code.

to create the child QA.

Note, that these primitives only create the child QA device, not the class object in our code.

 

Please login or register to see this code.

 

This function is similar to 'initChildDevices' but it leverages the fact that the class name is stored as a quickVar in the child so it knows what type of object it should construct for the child. This way we don't need the map that the original 'initChildDevices' needs, and we have more flexibility in how to map classes and types.

A bonus is that it returns the number of child devices it loaded so we can compare that to how many child devices we expect to have...

 

In our loadChildren() function we redefine the regular initChildDevices() function to do nothing. This is because the QuickApp will call initChildDevices() it if we haven't called on it explicitly in our code. Redefining it to do nothing stops it from trying to "initialise" the children again.

 

So, this means that we have loaded all children and they are available in the table

self.childDevices.

If we know the id of a child we can get the child instance

Please login or register to see this code.

..and ex. call a method like turnOn() in this case

In createChild function presented earlier we could add quickVars to the children we created and in particular we could add the ID of the external device the child should mirror.

Ex. if our children our mirrors of Philips Hue devices we store the hueID as a quickVar in the child.

That means that when the child is initialised we can retrieve the quickVar and store it as a more accessible field in the child instance (quickVars are a bit inefficient to retrieve with self:getVariable)

Please login or register to see this code.

 

If we have the childID and we need the hueID we can just do

Please login or register to see this code.

One thing is missing now. We would like to have the reverse mapping. If we have the hueID we would like to get the childID. We could look through the self.childDevices table everytime

Please login or register to see this code.

It may be a bit inefficient, and instead we could have a reverse mapping table.

hueIDmap = {}

and everytime a child is initialised it will update the table with it's hueID and childID.

The issue we have is that if a child QA is deleted we would like to remove the mapping from the table.

The self.childDevices table is kept updated by the QuickApp but our own hueIDmap is not.

If we delete the child QA in our Lua code it's easy to update our table also. If the user deletes the child QA in the UI we don't get notified. Earlier in the post it was noted that we could monitor /refreshStates, patch self:removeChildDevice(id) or install an onAction handler to catch the fact that a child was removed. Lets do the second option.

Please login or register to see this code.

Every time a child is deleted we update our reverse map.

This means that we have self.childDevices and hueIDmap that can map between child ID and Hue ID and they are kept updated and in sync.

 

I would not recommend child QAs to run their own poll loops like in the previous example. The reason is that it is difficult to control the frequency of polls, taken all the children QAs together. It's usually much better to let the main QA poll the external devices and give the data to children.

 

We can still do that with the model above.

Assume that the Child class we have, uses the external_ID given as a quickVar when it was constructed.

Please login or register to see this code.

In the child's initializer we fetch the ID quickVar and store it in an instance variable (self.external_ID). We do that for convenience.

  

Our main loop in the QA can then look like

Please login or register to see this code.

 

...or we could have a child method that does the job of :newData and fetchData

Please login or register to see this code.

 

I have a Philips Hue QA that creates child QAs for the Hue devices.

If there are many children I decide to call the Hue hub to get all the devices data in each single poll.

I then loop over all my children giving them all the data, and the children select the data that is relevant for them.

This works well as each child QA knows what Hue ID it is associated with.

  

We could actually use child QAs without using the QuickAppChild class.

In the previous examples we have implemented createChildDevice and initializeChildDevices, so we could replace them with non-object oriented code.

The only problem is that we need to make sure that fibaro.call(childID,<method>,<args>) works, and we have to fix so that UI interactions, like button clicks are sent to the right piece of code handling the child logic.

 

...I will add to this post an example how to accomplish it. It's mostly an academic exercise but it gives some insights how events are handled for child QAs


Thank you for this very well documented article about QA Childs - I for fure need to read it a couple of times again;-)

 

I see you in several places uses your 
•    Toolbox
•    Toolbox child

My guess is that also would be a good way to start with QA Childs?
I’m a little unsure how to embed these files in ZBS?
Is there minimum template for QA + childs I could start using ?

Not having the big picture of Childs, but I would like to create an QA – that maps/copy a fibaro switch into a motion sensor Device or other sensor by choice.
•    com.fibaro.doorWindowSensor
•    com.fibaro.windowSensor
•    com.fibaro.doorSensor
•    com.fibaro.motionSensor
The usecase for this- is to offer the possibility to change old non SMART PIR sensors into a SMART PIR sensor.
To do the physical conversion – a Fibaro Double Switch or Fibaro Double Switch 2 will be used
Very simple by looping the output from the old PIR into S1 and from Q1 to the Bulp – the problem with this is HC3 recognizes the switch as switch, and it not possible to change the switch to motionSensor or other sensors.
So this is what I want to create – a QA copying a switch (or several) switches status into each own Child Sensor Device.
Because its sensors - we don’t need feedback to the switch device – only one way communication.
I was thinking that I could use Variables UI for listing the Fibaro switches. And in the “Edit & Preview” a create child button for motionSensor, doorSensor eg.

Any thoughts – comments ?

 

Do I Need to download/import the toolbox from Github?
image.png.dec8cf74120d90e28fb2da8ef3c73790.png

  

I searched the forum for how to use - and found this

Please login or register to see this link.

ending with - How to load them and use them will be discussed in another post..

? does anyone see this post ?

 

 

Edited by ChristianSogaard
P
Link to comment
Share on other sites

Jan,

episode2

I discovered 2 devices reacting on same allLightOn plug

Plug removed from wallconector and later light was on.

So re-added this wallplug and awithing the result.

Question of restart stays open

//Sjakie

Link to comment
Share on other sites

Jan,

Error

[07.01.2021] [07:14:10] [ERROR] [QUICKAPP796]: Unknown error occurred: handleJsonRpc

Link to comment
Share on other sites

  • Topic Author
  • 16 hours ago, Sjakie said:

    Jan,

    I cant find why my allLightOn(823) plug is switched on. There is only one rule who is doing this.

    Id QA= 802

    allLightOn is modifyed and by testing get if there is alarm the cmd >>on.  If switche allLightOn>> off it switch off

    [13:40:09] [DEBUG] [QUICKAPP802]: --------------------------------------------- Running ---------------------------------------------
    [06.01.2021] [13:40:09] [DEBUG] [QUICKAPP802]: [true]>>'Rule:1[@{catch,05:00} => Util.checkForUpdates()]'

    a lot of triggers pasing by

    [06.01.2021] [13:44:16] [DEBUG] [QUICKAPP802]: Incoming trigger:{"type":"device","property":"value","value":true,"old":false,"id":823}
    [06.01.2021] [13:44:16] [DEBUG] [QUICKAPP802]: [true]>>'Rule:7[alarmApp.alleVerlichting:isOn =>...]'

    It seems this QA  has a restart??? Will that trigger the 823 on?? Does  a QA restart I gues you mentioned it starts once?

    Plug is also mentioned in Arming, smokedetectors and outsidering security  scenes dont have any debug on that time.

    After around one minute it switch off

    If kitchen or toilet door are open it triggers allLightOn????? That I cant see but the light switch on!!! Also other triggers but cant find them.

    The moved arming scene from HC2 shows tose doors unarmed and safe

    In alarm chapter of HC3 all is off, I removed all vinks and now nothing happens if door opens. Remark: in HC3 there is no QA to trigger the alarm built in.

    It is possible a glitch but how to discover who triggers?

    Can you enlighten me?

    //Sjakie

     

    No, it seems like the switch was turned on sometime just before the QA restarted, so when the QA starts up it gets the trigger. I will see if I can flush all recent triggers at startup.

    Link to comment
    Share on other sites

    Jan,

    I have had the idea it is self restarting. When that trigger came because I saw several times that catch ....... within 5 minutes

    //Sjakie

    Link to comment
    Share on other sites

  • Topic Author
  • 20 minutes ago, Sjakie said:

    Jan,

    Error

    [07.01.2021] [07:14:10] [ERROR] [QUICKAPP796]: Unknown error occurred: handleJsonRpc

     

    16 hours ago, ChristianSogaard said:


    Thank you for this very well documented article about QA Childs - I for fure need to read it a couple of times again;-)

     

    I see you in several places uses your 
    •    Toolbox
    •    Toolbox child

    My guess is that also would be a good way to start with QA Childs?
    I’m a little unsure how to embed these files in ZBS?
    Is there minimum template for QA + childs I could start using ?

    Not having the big picture of Childs, but I would like to create an QA – that maps/copy a fibaro switch into a motion sensor Device or other sensor by choice.
    •    com.fibaro.doorWindowSensor
    •    com.fibaro.windowSensor
    •    com.fibaro.doorSensor
    •    com.fibaro.motionSensor
    The usecase for this- is to offer the possibility to change old non SMART PIR sensors into a SMART PIR sensor.
    To do the physical conversion – a Fibaro Double Switch or Fibaro Double Switch 2 will be used
    Very simple by looping the output from the old PIR into S1 and from Q1 to the Bulp – the problem with this is HC3 recognizes the switch as switch, and it not possible to change the switch to motionSensor or other sensors.
    So this is what I want to create – a QA copying a switch (or several) switches status into each own Child Sensor Device.
    Because its sensors - we don’t need feedback to the switch device – only one way communication.
    I was thinking that I could use Variables UI for listing the Fibaro switches. And in the “Edit & Preview” a create child button for motionSensor, doorSensor eg.

    Any thoughts – comments ?

     

    Do I Need to download/import the toolbox from Github?

    Please login or register to see this link.

      

    I searched the forum for how to use - and found this

    Please login or register to see this link.

    ending with - How to load them and use them will be discussed in another post..

    ? does anyone see this post ?

     

     

     

    Yes I will do a more extensive post on this.

    There is a small post here.

    I would recommend that you install the ZBS plugin.

     

    under Edit -> "HC3 SDK templates" there are options to insert a QA skeleton, with or without toolbox.

    the code in the editor picture above is the QA with toolbox template.

    under File -> "download files" there is an option to download the toolbox files.

    Project -> "Deploy QuickApp" will build and deploy the QA to the HC3 with all the included files.

     

    3 minutes ago, Sjakie said:

    Jan,

    I have had the idea it is self restarting. When that trigger came because I saw several times that catch ....... within 5 minutes

    //Sjakie

    Yes, it will restart if there is any errors in the code/rule declaration.

    • Like 1
    Link to comment
    Share on other sites

    44 minutes ago, jgab said:

     

     

    Yes I will do a more extensive post on this.

    There is a small post here.

    I would recommend that you install the ZBS plugin.

     

    under Edit -> "HC3 SDK templates" there are options to insert a QA skeleton, with or without toolbox.

    the code in the editor picture above is the QA with toolbox template.

    under File -> "download files" there is an option to download the toolbox files.

    Project -> "Deploy QuickApp" will build and deploy the QA to the HC3 with all the included files.

     

    Yes, it will restart if there is any errors in the code/rule declaration.

     

    Hi Jan

     I tried to download the fibaroapiHC3plug.lua from 

    Please login or register to see this link.

    Upload in the zerobrane folder, in ZBS/packages/

    Close APP - and restart APP

    Please login or register to see this image.

    /monthly_2021_01/image.png.e822539ec6e89586210e30f22e4deb92.png" />

     

    Under file I get this - and I'm missing "download selected resource" and more.

     

    image.png.7bfe3c2baadb62acfa33a0fa48ee5ead.png

     

    Then i tried downloading fibaroapiHC3plug.lua from

    Please login or register to see this link.

    But still missing the menues.

     

    I have credentials.lua in same directory as fibaroapiHC3.lua and my working files

    image.png.821fe8fdf05cd6d19cf5df8a57ccc628.png

     

    What did i miss this time ? ? ?

    Link to comment
    Share on other sites

  • Topic Author
  • 5 minutes ago, ChristianSogaard said:

     

    Hi Jan

     I tried to download the fibaroapiHC3plug.lua from 

    Please login or register to see this link.

    Upload in the zerobrane folder, in ZBS/packages/

    Close APP - and restart APP

    Please login or register to see this link.

     

    Under file I get this - and I'm missing "download selected resource" and more.

     

    Please login or register to see this link.

     

    Then i tried downloading fibaroapiHC3plug.lua from

    Please login or register to see this link.

    But still missing the menues.

     

    I have credentials.lua in same directory as fibaroapiHC3.lua and my working files

    Please login or register to see this link.

     

    What did i miss this time ? ? ?

    Get the plugin from my GitHub. Post has old version.

    Please login or register to see this link.

     

    Link to comment
    Share on other sites

    3 minutes ago, jgab said:

    Get the plugin from my GitHub. Post has old version.

    Please login or register to see this link.

     

    Comfirmed that works 

     

    What is the difference between the one you posted and this one ?

    Please login or register to see this link.

    Link to comment
    Share on other sites

  • Topic Author
  • Just now, ChristianSogaard said:

    Comfirmed that works 

     

    What is the difference between the one you posted and this one ?

    Please login or register to see this link.

    It's just a link to the raw file, easier to download ;-) 

    Just now, jgab said:

    It's just a link to the raw version of the file, easier to download ;-) 

     

    Link to comment
    Share on other sites

    18 minutes ago, jgab said:

    It's just a link to the raw file, easier to download ;-) 

     

    I see - and now understood why it wasnt working

    When I right click at the first one - I saved the website, and not the file.

    I ran a file compare before I notice ??. What a rookie mistake

    Please login or register to see this attachment.

    .

     

     

    • Like 1
    Link to comment
    Share on other sites

    Jan,

    Good morning.

    Parser error in ER4

    slider(327,'slVolume')=25;
    in ER3 it was accepted
    Thanks in advance,
    //Sjakie
     
     
    Link to comment
    Share on other sites

  • Topic Author
  • 36 minutes ago, Sjakie said:

    Jan,

    Good morning.

    Parser error in ER4

    slider(327,'slVolume')=25;
    in ER3 it was accepted
    Thanks in advance,
    //Sjakie
     
     

    slider() is not supported in ER4 as it was the old VD model

    QAs have different UI model.

    If you want to set a QAs slider use

    rule("QA:updateView('slVolume','text','25')")

    Link to comment
    Share on other sites

    Hello Jan,

    Is it possible in your arming QA to get the info witch device  was breached and caused the alarm? Now I see witch partition is breached.

    Thanks in advance,

    //Sjakie

    Link to comment
    Share on other sites

    Jan,

    Working on the last points of arming.

    I had several rules to send a msg if somewhere in the complex a door is breached under different cinditions

    In arming QA I am using 11 partitions

    My main complex is 6 partions '1,2,3,4,5,6'

    I am able to divers alarm sound and msg

    but with 

    Rule.eval([[#alarm{property='homeBreached',value=false} =>  -- All alarm partitions safe
           user:msg = log("Complex is veilig te betreden beveiliging is uitgeschakeld")
    I am stucked.
    Is it posible to have 'homebreached' only for partitions '1,2,3,4,5,6'
    How to modify?
     
    Please advice,
    //Sjakie
     
    Link to comment
    Share on other sites

    Jan,

    Please skip the "homebreached"question its much more easy to create a simple rule, sorry for bothering.

    //Sjakie

    Link to comment
    Share on other sites

    On 1/5/2021 at 11:23 AM, jgab said:

    Ok, I have verified that there is something strange with the zone/group and childrenOfHue.

    I will look into it...

    Hi Jan - any new on Zones and groups for Children of Hue ? ??

    Link to comment
    Share on other sites

  • Topic Author
  • On 1/11/2021 at 7:33 PM, ChristianSogaard said:

    Hi Jan - any new on Zones and groups for Children of Hue ? ??

    Try this.

    Please login or register to see this attachment.

    You can copy main and toolbox from the new QA to your old so you don't have to regenerate ids.

    Let me know if it works better.

    • Like 1
    Link to comment
    Share on other sites

    @jgab

    I know that you published some QA that connected ie. motion sensors in one room/floor/house but I can't find it :(

     

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