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


Test Lua Codes Before Using in HC2


Yolo

Recommended Posts

Hello, 

Am a learner and currently practicing lua coding, i would like to know how to identify errors before i use the codes on HC2 . Am not really sure what am doing. 

Am worried i may Crush the system. 

 

For instance, can't identify the problem... (i was trying to tell the TVwallplug to detect if the TV is Off then Turn it On, and if TV is On then Turn it Off)  i want to use it when running scenes.

The TV has 1 Button for On/Off

 

Hop to get help from here. Thank you

 

 

Please login or register to see this attachment.

Edited by Yolo
To add the codes
Link to comment
Share on other sites

  • Topic Author
  • Thanks @jgab i will try to try it out. Though seem to be sophisticated ...lol;D

    Edited by Yolo
    Link to comment
    Share on other sites

    7 hours ago, Yolo said:

    Hello, 

    Am a learner and currently practicing lua coding, i would like to know how to identify errors before i use the codes on HC2 . Am not really sure what am doing. 

    Am worried i may Crush the system. 

     

    For instance, can't identify the problem... (i was trying to tell the TVwallplug to detect if the TV is Off then Turn it On, and if TV is On then Turn it Off)  i want to use it when running scenes.

    The TV has 1 Button for On/Off

     

    Hop to get help from here. Thank you

     

    Since HC2 system has it's own function, you cannot try it using standard LUA editors.

    But the good news, don't be afraid  to make  mistake, the system doesn't crash so easily

    Link to comment
    Share on other sites

  • Topic Author
  • @cag014 Thanks for the encouragement, and i know some times we learn from mistakes but HC2 am using its not mine.

    so do you suggest i run the codes in HC2..?

    Link to comment
    Share on other sites

    @Yolo

    Yes, go ahead... I have HC2 for several years and never got any problem with that.

    Although I need to warn you, that you could have some issues when you trying to write new values into devices using API commands, (like api.put(), api.post() ). But even so, reboot always works and helps to clear the memory, always.....

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