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


Search the Community

Showing results for tags 'sourcetrigger'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • FIBARO Community
    • FIBARO Portal and Forum policy
    • FIBARO
    • Say hello!
    • Off-topics
  • FIBARO Update
    • FIBARO System Update
    • FIBARO Mobile Update
  • FIBARO Community Support
    • Scenes and Interface
    • FIBARO Products
    • FIBARO Mobile
    • FIBARO HomeKit
    • FIBARO Assistant Integrations
    • Other Devices / Third-party devices
    • Tutorials and Guides
    • Home Automation
    • Suggestions
  • FIBARO Społeczność
    • FIBARO
    • Przywitaj się!
    • Off-topic
  • FIBARO Aktualizacja
    • FIBARO System Aktualizacja
    • FIBARO Mobile Aktualizacja
  • FIBARO Wsparcie Społeczności
    • Sceny i Interfejs
    • FIBARO Urządzenia
    • FIBARO Mobilnie
    • FIBARO HomeKit
    • Integracja z Amazon Alexa i Google Home
    • Urządzenia Firm Trzecich
    • Poradniki
    • Automatyka Domowa
    • Sugestie

Categories

  • Scenes
  • Virtual Devices
  • Quick Apps
  • Icons

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Facebook


Google+


Skype


Website URL


WhatsApp


Country


Gateway/s


Interests

Found 2 results

  1. Hello All, Surfing on this forum, I understand that many of you would dream of a native event handler on Fibaro HC3. jgab made a huge library that provides it - and much more. Unfortunately as a rookie I have a hard time to figure out how to use it. I designed a couple of LUA scenes that work nicely. I often use sourceTrigger to figure out what event triggered the scene. An example will be much better than a long description: hub.debug("Scene81", json.encode(sourceTrigger)) if sourceTrigger.property == "execute" then -- i.e. this scene is called from another scene -- [do this...] else -- i.e. this scene was triggered by a user clicking on a Fibaro wall switch local Switch = tonumber(sourceTrigger.id) -- allows to understand which switch it was local Button = tonumber(sourceTrigger.value.keyId) -- upper or lower button local Press = tostring(sourceTrigger.value.keyAttribute) -- single click, double click, triple click, held down -- from there, a series of if then else end and different actions end I have transformed some of my LUA scenes into QuickApps, using small Block Scenes to trigger them. I'd love to get rid of the Block Scenes and implement an event handler into each QuickApp, but frankly it's above my reach for the time being. I tried using jgab's "Fibaro Extra" but I don't understand what I'm doing. I also tried to connect to my HC3 (defining variables ip = 192.168.1.123 and port = 22) and the connection worked, but from there I'm still incapable of getting "woken up" by an event such us "Device Id 88, Button #2, Pressed twice". There is surely a missing link, I probably should send an http request of some sort but I have no clue about the syntax, and if it would end up giving me what I need (device, button, how it was pressed). Just to tell you that I tried to get rid of Block Scenes, without success so far... that said, I could still cope with Block Scenes triggering my QuickApp, if I had a means to check what I described above for LUA scenes, i.e. a way to implement a sourceTrigger equivalent. Have a great day! JP
  2. Tried to combine two converted blok scenes to one, but now it wont trigger... Any suggestions ? ------------------------------------------------------------------------------------------------------------------------- --[[ %% autostart %% properties %% weather %% events %% globals --]] local sourceTrigger = fibaro:getSourceTrigger(); local currentDate = os.date("*t"); local startSource = fibaro:getSourceTrigger(); if ( ( ((currentDate.wday == 1 or currentDate.wday == 2 or currentDate.wday == 3 or currentDate.wday == 4 or currentDate.wday == 5 or currentDate.wday == 6 or currentDate.wday == 7) and string.format("%02d", currentDate.hour) .. ":" .. string.format("%02d", currentDate.min) == "04:00") ) or ( ((currentDate.wday == 1 or currentDate.wday == 2 or currentDate.wday == 3 or currentDate.wday == 4 or currentDate.wday == 5 or currentDate.wday == 6 or currentDate.wday == 7) and string.format("%02d", currentDate.hour) .. ":" .. string.format("%02d", currentDate.min) == "15:00") ) ) then fibaro:setGlobal("reclameverl", "1"); fibaro:debug("var reclverl set to 1") fibaro:sleep(60*1000) elseif ( ( ((currentDate.wday == 1 or currentDate.wday == 2 or currentDate.wday == 3 or currentDate.wday == 4 or currentDate.wday == 5 or currentDate.wday == 6 or currentDate.wday == 7) and string.format("%02d", currentDate.hour) .. ":" .. string.format("%02d", currentDate.min) == "09:00") ) or ( ((currentDate.wday == 1 or currentDate.wday == 2 or currentDate.wday == 3 or currentDate.wday == 4 or currentDate.wday == 5 or currentDate.wday == 6 or currentDate.wday == 7) and string.format("%02d", currentDate.hour) .. ":" .. string.format("%02d", currentDate.min) == "18:00") ) ) then fibaro:setGlobal("reclameverl", "0"); fibaro:debug("var reclverl set to 0") fibaro:sleep(60*1000) end ---------------------------------------------------------------------------------------------------------------------------------------------------- I,m hoping someone can give me a hint.... Gary set var reclverl.lua
×
×
  • Create New...