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

  • 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 3 results

  1. My problem: I want to change the "modified" of a global variable to trigger scenes as well, because if you assign global variable the same value it had before, Fibaro does not change the modified entry. Here is my global variable used to document if I this person is at home or somewhere else. { "name": "Christian", "value": "Office", "readOnly": false, "isEnum": true, "enumValues": [ "Office", "Sport", "Home", "ontheway" ], "created": 1644958957, "modified": 1645209384 } We all know the geofencing works only properly if app is active on the smartphone. So it might happen variable still reports "Home" although the Person is not at home. Now the person get's home and geofence switch the Variable to "Home" again. This will not trigger the "modified" because it's still the same value. This means. the globals Person I am using in scenes as trigger does not trigger, beause vaue remains the same. So my intention was to change the "modified". I receive a result 200 (means works), but the "modified" does not change, although I am able to change the "value" for debugging test. Here is the LUA, and my question is, why does it work for Persondata.value (value change) and does not work for Persondata.modified (value remains the original one) local value, modified = fibaro:getGlobal("Christian") print(os.date("%c", modified)) local Person = "Christian" local Persondata = api.get('/globalVariables/'..Person) Persondata.value = "Golf" print(os.date("%c", Persondata.modified)) Persondata.modified = tonumber(os.time() - 1) print(os.date("%c", Persondata.modified)) PersonJSON = json.encode(Persondata) local http = net.HTTPClient() http:request("http://127.0.0.1:11111/api/globalVariables/"..Person, { options = { method = 'PUT', headers = {}, data = PersonJSON, timeout = 10000 }, success = function(response) local result = response.data; if response.status == 200 or response.status == 201 then fibaro:debug(response.status) -- Display('lightgreen', Text, 999) else fibaro:debug(response.status) -- Display('red','Error: ' ..response.status.. ' - Zugriff verweigert',0) end end, error = function(err) fibaro:debug(err) --Display('red','[ERROR] ' .. err, 0) end }) fibaro:sleep(6000) value, modified = fibaro:getGlobal("Christian") print(os.date("%c", modified)) print(value) and the debug is:
  2. Hi Some problem with understanding Lua in the new HC3 , Trying to find out how Global variable works. What is it i am doing wrong fibaro.setGlobalVariable("c","1") fibaro.debug("Scene16", fibaro.getGlobalVariable("c")) I am trying to find out as in HC2 a Variables Panel but can not find it. Please advice
  3. Hi, I am looking for solution to get data from external MySql database to HC2. Has anyone found a way to directly get data from Mysql to the system? Or is there a good way to insert externally data to GlobalVariable through http get/put request? Google has not been a good mate to help on the matter or am I too lazy to see :(. HC2 should have a way to do this (communicate to external MySql as it stands on one itself)... Thanks for input.
×
×
  • Create New...