Jump to content
  • Announcements

    • T.Konopka

      DOWNLOADS - new way of sharing solutions!   01/17/18

      Dear users, We want you to have a great time here on the Forum, therefore, we are introducing a new tool for sharing solutions! DOWNLOADS - a system of file sharing for all of you. DOWNLOADS - support topics - this is a new category for support topics. Check the short guide for Downloads on how to add a solution (all files have to be approved).   Crowd's Solutions will be closed for new submissions, but still open for replies in remaining topics. We ask the authors of the solutions to add their solutions to Downloads with the link to the topic at the top of the description. We will merge the support topic with the one from Crowd's Solutions.   If you have any questions, feel free to ask our administrators - @T.Konopka and @I.Srodka!
    • T.Konopka

      DOWNLOADS - nowy sposób dzielenia się rozwiązaniami!   01/17/18

      Szanowni użytkownicy, Chcemy, abyście świetnie spędzali czas na Forum, dlatego przedstawiamy wam nowe narzędzie do dzielenia się rozwiązaniami! DOWNLOADS - system dodawania i pobierania plików. DOWNLOADS - support topics - to jest nowa kategoria z tematami wsparcia. Sprawdźcie przewodnik dla Downloads, aby wiedzieć jak dodać rozwiązanie (wszystkie pliki muszą zostać zatwierdzone).   Rozwiązania Społeczności zostaną zamknięte dla nowych tematów, jednak tematy już wczęśniej dodane będą nadal dostępne. Prosimy autorów rozwiązań do przenoszenia ich do Downloads - prosimy o dodanie linkiem do tematu na górze opisu. Połączymy wtedy temat wsparcia z tematem z Rozwiązań Społeczności.   W przypadku pytań, prosimy o kontaktowanie się z administratorami - @T.Konopka and @I.Srodka. (Rozwiązania mogą być dodawane w języku polskim!)
    • T.Konopka

      Technical Support Helpline - May Holidays   04/23/18

      Dear users, We would like to inform you that due to incoming holidays in Poland on 30th of April and on 1st and 3rd of May our Technical Support helpline will not be available. We apologize for the inconvenience. Sincerely, FIBARO Team
    • T.Konopka

      Linia Wsparcia Technicznego - Majówka   04/23/18

      Drodzy użytkownicy, W związku z nadchodzącą majówką, 30 kwietnia oraz 1 i 3 maja linia Wsparcia Technicznego nie będzie dostępna. Za utrudnienia serdecznie przepraszamy. Z wyrazami szacunku, Zespół FIBARO
AutoFrank

Tutorial - Using a Hometable to store device and scene ID's

Recommended Posts

Thanks. This doesn't seem to be the issue, but it made me think about the references.

I excluded the references one by one and I found that it is the erroneous referral to my own phone, which is named iErnst.

How should I refer to that? Obviously jT.iErnst is wrong....

(still don't understand how the line number is so different)

Share this post


Link to post
Share on other sites

Sorry, of course, that should be jT.iOS.iErnst

Then another questions about referencing the HomeTable.

In the definitions statement at the start of a scene, is it possible to refer to the hometabel too?

For example:

 

local jT = json.decode(fibaro:getGlobalValue("HomeTable"))

--[[
%% autostart
%% properties
120 value
%% events
%% globals
--]]

 

Instead of 120 I would like to refer to jT.kitchen.window.

But replacing 120 with that doesn't work, starting with local jT = ... doesn't help either.

Any suggestions?

Share this post


Link to post
Share on other sites
10 hours ago, ErnstH said:

Sorry, of course, that should be jT.iOS.iErnst

Then another questions about referencing the HomeTable.

In the definitions statement at the start of a scene, is it possible to refer to the hometabel too?

For example:

 

local jT = json.decode(fibaro:getGlobalValue("HomeTable"))

--[[
%% autostart
%% properties
120 value
%% events
%% globals
--]]

 

Instead of 120 I would like to refer to jT.kitchen.window.

But replacing 120 with that doesn't work, starting with local jT = ... doesn't help either.

Any suggestions?

 

Hi @ErnstH,

 

It is not possible to replace device ID's in scene header with HomeTable references. In scene header you have to keep ID numbers of the triggering devices and yes, you will have to edit header of all scenes that uses ID of device that changed its ID due to hard reconfiguration or exclusion/inclusion process. 

Share this post


Link to post
Share on other sites
  • Topic Author
  • HI @ErnstH

    Sorry for the late reply

     

    The hometable references need to be exact and ARE case sensitive. It has zero flexibility.

    I have seen an Error referenced at line 334 that is really an issue like the one above


    Sometimes the exception notification for the HC2 is sometimes a bit off a doesn't always flag the correct line.

    Line 74 in a scene almost always points to an issue with a global; variable (empty, nill or does not exist)

     

    I have also seen Errors referencing getselfId in a scene that is flagging a syntax error 

    There is a post here that talks to his - 

    Share this post


    Link to post
    Share on other sites

    Please login or register to see this code.

    Hello
    Have once again a question.
    I know the what I have shown below did not work, but how can I read the value from the json list.

    How can I sit down please can give me an example?

     

    Many Thanks.

     

    Edited by parip69

    Share this post


    Link to post
    Share on other sites

    hi @AutoFrank,

    thanks for another awesome tutorial!

    I started playing around with it today. Everything works as expected.

     

    I wanted a more readable output of the HomeTable in the Debug window.

    So I found a LUA script in the internet and adapted it for Fibaro Debug.

    Please login or register to see this attachment.

     

    For this screenshot I used a simple nested hometable:

    Please login or register to see this code.

    I have a standard function to write to the debug window which i use in every scene:

    Please login or register to see this code.

    The function for the output of the HomeTable in JSON Format is:

    Please login or register to see this code.

    To output the Json you can now use:

    Please login or register to see this code.

    maybe someone finds this usefull as well.

     

    keep up the goood work.

    kro

     

     

     

    Edited by kroeatschge

    Share this post


    Link to post
    Share on other sites

    Hi all,

     

    on the weekend I found some time and worked through the tut, and everything is really working great from the beginning.

    However, I found one thing that I could not figure out. There are iOS devices missing in my Table, but I do not have a clue why?

    I checked

    Please login or register to see this link.

     and all my devices are listed there...

     

    Hints?

    Cheers

    joystick

    Edited by Joystick

    Share this post


    Link to post
    Share on other sites

    Hi,

     

    not sure if this is mentioned elsewhere, so just in case.... there is no need to manually add scenes and users, as suggested in the script on page 1.

     

    - Scenes can be added automatically with this snippet:

    Please login or register to see this code.

    - There is actually a type for users. Just add this to the main for-do-block:

    Please login or register to see this code.

    Cheers,

    jayrock

    Share this post


    Link to post
    Share on other sites

    The topic has been moved from "

    Please login or register to see this link.

    " to "

    Please login or register to see this link.

    ".

     

    Temat został przeniesiony z "

    Please login or register to see this link.

    " do "

    Please login or register to see this link.

    ".

    Share this post


    Link to post
    Share on other sites

    this code create and complete HomeTable variable if not exit or update it if exit, adding all users, scenes, devices, VD and iOS.
     

    Please login or register to see this code.

      

    Share this post


    Link to post
    Share on other sites

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

    ×