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

Posted

A RefreshStateSubscriber class has been added to handle system events with methods for subscribing, unsubscribing, and starting/stopping event listening, providing better control over event-based actions.
How to use please?

Posted

I will share tomorrow docs here, we are in the progress of updating manuals.fibaro.com but it will take some time. 

  • Like 2
Posted
Quote

RefreshStateSubscriber

Class for handling system events.

RefreshStateSubscriber class methods

RefreshStateSubscriber

RefreshStateSubscriber classe constuctor.

Example

Please login or register to see this code.

RefreshStateSubscriber.subscribe(filter, handler)

Add a listener for system events. Returns subcription

Parameters

  • filter - function that will be fired when the event occurs. Have to return boolean.
  • handler - function that will be fired when the filter met conditions.

Example

Please login or register to see this code.

RefreshStateSubscriber.unsubscribe(subcription)

The method removes subcription

Parameters

  • subcription - array recieved from RefreshStateSubscriber.subscribe

Example

Please login or register to see this code.

RefreshStateSubscriber.run()

Method for starting to listen for events.

Example

Please login or register to see this code.

RefreshStateSubscriber.stop()

Method that stops listening for events.

Example

Please login or register to see this code.

 

  • Like 2
  • Thanks 4
Posted

Hi Michal,

RefreshStateSubscriber is a great new feature that simplifies the combination of QAs and scenes and will definitely help to reduce the load on HC, as now it is not necessary to run scripts in QA so often.

 

Is it also possible to use global variables as triggers?

I think events like changing the value of global variables are not in the event log.
Thank you

Posted
3 hours ago, marbe said:

Hi Michal,

RefreshStateSubscriber is a great new feature that simplifies the combination of QAs and scenes and will definitely help to reduce the load on HC, as now it is not necessary to run scripts in QA so often.

 

Is it also possible to use global variables as triggers?

I think events like changing the value of global variables are not in the event log.
Thank you

It is.

Please login or register to see this code.

 

Maybe someday we will get a list of all of them....

  • Like 2
Posted

Yes, it works great, thanks'!

Posted

May any1 have an exampel of how to use it in a QA to check if a Dimmer 2, S2 input is triggered? 

  • 4 months later...
  • Topic Author
  • Posted

    Anyone has a list of all the event types that we can listen to?

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