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


Sankotronic Lab - Universal Home Automation System (UHAS™)


Sankotronic

Recommended Posts

2 hours ago, tomisoft said:

Hi @Sankotronic,
Any progress with the work on UHAS? 

BR

Tomis

Hi @tomisoft,
@Sankotronic is currently extensively testing his lighting system. I believe release date is approaching. Ofcourse some manual need to be created in order to support the user in installation process.
My personal estimation goes to perhaps april if no grazy things happen. Believe me I also can't wait....

Link to comment
Share on other sites

  • Topic Author
  • Hello all,

     

    I'm really sorry for not updating progress for the last almost 3 months. Today I did it finally. I know that I'm a way behind the schedule for UHAS release. Updating code in all VD's and scenes to better handle memory usage and removing need for Emoji VD which is also related to the memory usage took me almost 5 weeks :-( Much more than I anticipated. I had to invest more than two weeks on my future job with interviews, certificates, visas and courses.

     

    I'm finally working on Philips HUE integration using new API v2. Until now code is working as expected during testing, but since Philips is still actively working on their new API v2 I also have to modify my code on new firmware releases. More info in my first post.

     

    I hope I will finish HUE in next few days and then will still need almost a week to update ALC and VSL scenes to support this new integration.

    After that I have to finish, blinds control, burglar alarm and appliance module and write some User manual. After that UHAS will be released.

     

    After UHAS is released I will work on some other promised integrations and will also help with modification of any user solution to make it UHAS compatible.

     

    I might also release UHAS SDK with all necessary code snippets and functions on one place and some guide how to make UHAS compatible VD and scene.

     

    Next project then is UHAS for HC3, but I just learned that my preproduction HC3 will not be possible to upgrade anymore which means that I will have to get one. Will see.

     

    Thank you!

     

    • Like 5
    • Thanks 5
    Link to comment
    Share on other sites

  • Topic Author
  • Please check my first post for latest update on progress with UHAS.

     

    Good news is that I have working HUE2 Preview VD and scene. For more details please check first post.

     

    THANK YOU! :-)

    Link to comment
    Share on other sites

  • Topic Author
  • Who has more notifications badges?

     

    Please login or register to see this image.

    /monthly_2022_03/IMG_8900.PNG.dd67a9599c3e41448be794299d4ec6ca.PNG" />

     

    This is result of UHAS Advanced Notification Center (ANC) extensive testing and also usage since latest UHAS is running our home :-)

     

    • Thanks 2
    Link to comment
    Share on other sites

  • Topic Author
  • Philips HUE VD+scene family for new HUE API v2 is DONE :-)

    Next job is to upgrade ALC to support this new integration.

     

    • Like 6
    Link to comment
    Share on other sites

    • 1 month later...
    • 4 weeks later...
  • Topic Author
  • Hello all!

     

    Apologies for being silent for last two months. I found new job and was really busy adjusting for my new role. I still have one month to work before I will return home and continue work on UHAS for HC2.

     

    I will do my best to write installation manual and publish UHAS in September if not earlier.

     

     

     

    • Like 1
    Link to comment
    Share on other sites

    • 1 month later...
  • Topic Author
  • Hello all,

     

    I'm finally return home. Need a few days to adapt and then will continue to work on UHAS.

    After 3 months of testing I noticed some issues that also needs to correct such as:

     

    - some VD's loose their icons setup after automatic backup

    - if sonos-api device fails and UHAS is restarted then TTS will stop working even if sonos-api device is rebooted

     

    Solutions

    For icons there might be some problems with HC2 ability to handle multiple open global variables with tables.

    For sonos-api solution is to just restart ANC TTS VD after rebooting sonos-api device so it can find all speakers.

     

    • Like 3
    • Thanks 1
    Link to comment
    Share on other sites

  • Topic Author
  • Hello all and @A.Socha, @m.roszak, @petergebruers, @jgab, @cag014,

     

    I'm finishing UHAS for HC2 and during last 3 months of testing I have noticed some 'strange' errors that I need to address and maybe get some explanation.

     

    All errors occurs ONLY during rebooting of HC2 or after making backup and restarting services. Testing was done on HC2 with FW 4.620. Errors are detected by my Watchdog scene which records every occurrence of VD main loop not running and by saving last found debug line to my Event Recorder VD database.

     

    1) ERROR line 119: attempt to index field 'properties' (a nil value)

    Part of code that generate error is (code is simplified for easier understanding):

    Please login or register to see this code.

    It seems that function api.get("/devices/"..selfId) during startup SOMETIMES (NOT ALWAYS) returns empty response or response with some missing parts. As soon as system is up and running this error does not occur any more no matter how many times VD is restarted. Also not every reboot generates this error on the same VD so it is absolutely random.

    QUESTION: Is it better to use other code to get device properties instead of api.get and which one?

     

    2) ERROR line 10: '=' expected near 'local'

    Code that generates this error is:

    Please login or register to see this code.

    Since '=' is definitely not missing in code, how this error can occasionally happen during starting up of the VD main loop?

    QUESTION: Since HC2 is running 110 UHAS compatible VD's I have implemented code that actually delays execution of main loop code based on server status time. Still I have 36 VD's that control lights and they start with almost same delay. Is it possible that sometimes HC2 does not read VD code properly due to too many opened code instances?

     

    3) ERROR line 34: bad argument #4 to 'format' (string expected, got nil)

    Code that generates this error is:

    Please login or register to see this code.

    Function itself checks if any of the arguments is missing and sets a value, but still sometimes only during reboot it fails.

    QUESTION: How it is possible that one of the arguments still has no value during code run? What I'm not seeing?

     

    There are also some other errors that occur only during system reboot (starting services), but never once system is up and running. Mostly are caused either by empty response from api.get function or missing argument (nil) even I make sure that argument always has value.

     

    It may help if I give some more information about my current system:

    HC2 on 4.620 with 2Gb of RAM (added)

    112 z-wave device included

    110 - Virtual devices with main loop running

    85 scenes of which 3 is constantly running

    Average CPU usage 50%

    Free memory 33%

     

    Link to comment
    Share on other sites

    Very long time since I used a HC2, but this is what I remember...

    12 minutes ago, Sankotronic said:

    1) ERROR line 119: attempt to index field 'properties' (a nil value)

    Part of code that generate error is (code is simplified for easier understanding):

    Please login or register to see this code.

    It seems that function api.get("/devices/"..selfId) during startup SOMETIMES (NOT ALWAYS) returns empty response or response with some missing parts. As soon as system is up and running this error does not occur any more no matter how many times VD is restarted. Also not every reboot generates this error on the same VD so it is absolutely random.

    QUESTION: Is it better to use other code to get device properties instead of api.get and which one?

    If selfId is "" or something that is not a number you get all the devices in an array and .properties doesn't exist.

    I never saw the behaviour the api.get returned nil (but I mostly did HC2 scenes)

     

    12 minutes ago, Sankotronic said:

    2) ERROR line 10: '=' expected near 'local'

    Code that generates this error is:

    Please login or register to see this code.

    Since '=' is definitely not missing in code, how this error can occasionally happen during starting up of the VD main loop?

    QUESTION: Since HC2 is running 110 UHAS compatible VD's I have implemented code that actually delays execution of main loop code based on server status time. Still I have 36 VD's that control lights and they start with almost same delay. Is it possible that sometimes HC2 does not read VD code properly due to too many opened code instances?

    Never seen that. Are you generating code dynamically?
    Sometimes I got strange syntax error because invisible unicode characters sneaked in - pain to find them . On the Mac it seems it's easy to get them while typing '}' '{' as option-{ creates an invisible unicode..
    Anyway, these errors should always be there then.

     

    12 minutes ago, Sankotronic said:

    3) ERROR line 34: bad argument #4 to 'format' (string expected, got nil)

    Code that generates this error is:

    Please login or register to see this code.

    Function itself checks if any of the arguments is missing and sets a value, but still sometimes only during reboot it fails.

    QUESTION: How it is possible that one of the arguments still has no value during code run? What I'm not seeing?

    This is the most strange - it looks like Lua fails., which I don't think it does....

    Is span overwritten/replaced with some other span function?

     

    12 minutes ago, Sankotronic said:

    There are also some other errors that occur only during system reboot (starting services), but never once system is up and running. Mostly are caused either by empty response from api.get function or missing argument (nil) even I make sure that argument always has value.

    In general, if things sometimes behave strange at startup, it usually depends on a race condition. Things you expect would happen in a specific order happens in another order due things starting up slightly different.

    These are usually hard things to find but if you have 110 VD's accessing and maybe writing globals it may cause issues. These race conditions can also happen later at runtime if you have more than one VD/process updating a single resource (like a fibaro global)

    Link to comment
    Share on other sites

  • Topic Author
  • Hi @jgab ,

     

    Thank you for your prompt answer.

    37 minutes ago, jgab said:

    If selfId is "" or something that is not a number you get all the devices in an array and .properties doesn't exist.

    I never saw the behaviour the api.get returned nil (but I mostly did HC2 scenes)

    selfId is set at the beginning of main loop code:

    Please login or register to see this code.

    I do not check it after in the code. Maybe function fibaro:getSelfId() can also fail during startup. Maybe I can add some debug lines to see, but will have to wait till it happens again since this error occur only when HC2 is rebooted or after backup is generated and not always for same VD.

     

    42 minutes ago, jgab said:

    Never seen that. Are you generating code dynamically?
    Sometimes I got strange syntax error because invisible unicode characters sneaked in - pain to find them . On the Mac it seems it's easy to get them while typing '}' '{' as option-{ creates an invisible unicode..
    Anyway, these errors should always be there then.

    No code is generated dynamically or changed and since error occur only sometimes during startup and never after HC2 is already running it is definitely not invisible unicode. This one is definitely very strange.

     

    45 minutes ago, jgab said:

    This is the most strange - it looks like Lua fails., which I don't think it does....

    Is span overwritten/replaced with some other span function?

    I agree it is very strange. I have lots of calls to this function within the code and it never fails when system is up and running. Even if I call this function without any arguments it still works due to checks made before returning composed string. Function is declared only once in the beginning of the code and never overwritten or replaced.

     

    59 minutes ago, jgab said:

    In general, if things sometimes behave strange at startup, it usually depends on a race condition. Things you expect would happen in a specific order happens in another order due things starting up slightly different.

    These are usually hard things to find but if you have 110 VD's accessing and maybe writing globals it may cause issues. These race conditions can also happen later at runtime if you have more than one VD/process updating a single resource (like a fibaro global)

    Race condition definitely exists and is main reason why I removed global variables that where used by multiple VD's as much as possible. Also, I have implemented delays to UHAS modules so they start running in a sequence and not all at once. I had to do that also to prevent system to fill up RAM memory and then get stalled during system start up.


    Later at runtime I do not have any problems, it is only during system startup when some of the above errors occur and sometimes VD looses icons setup which is stored in global variable probably due to race condition which causes failure to read global variable and then VD main loop code rebuilds it and loosing previously done user settings.

     

    It would help greatly if I know how system is started up, what is the sequence and when scenes and VD's main loops start to execute.

     

    Link to comment
    Share on other sites

    On 7/19/2022 at 2:26 PM, Sankotronic said:

    1) ERROR line 119: attempt to index field 'properties' (a nil value)

    2) ERROR line 10: '=' expected near 'local'

    3) ERROR line 34: bad argument #4 to 'format' (string expected, got nil)

    You're absolutely correct. I do familiar with all these errors, but as you said - it happens on startup only.

    Link to comment
    Share on other sites

  • Topic Author
  • Hi @cag014 ,

     

    thanks for confirmation. I guess there is no easy solution for this? I was hoping that Fibaro will participate and give some useful info, but I guess it is holiday time ;-)

     

    This errors are not fatal in UHAS since Watchdog takes care that everything is running and restarts all code that was stopped by errors. Still it would be really nice to know more about how system starts and what has priority scenes or VD's or whatever etc.

     

     

    Link to comment
    Share on other sites

    @SankotronicMy question is if u could release a "stand alone" solution for netatmo welcome? I've a solution today but the code hangs up after a few hours so I'm really interested in a working setup....

     

    Best regards

    Link to comment
    Share on other sites

  • Topic Author
  • Hi @pettzon ,

     

    Netatmo announced that they will remove Client credentials grant type authorization in October 2022 which I use in all my solutions for Netatmo. This means that all integrations with this type of authorization will cease to work.

     

    Until I or somebody else find working solution for Code authorization grant type which at this moment looks quite complicated and requires personal server between Fibaro and Netatmo I do not have plans to do more standalone solutions for Netatmo. Sorry :-(

     

    Currently I'm following Netatmo forum and their developer site hoping to get some answers.

    Link to comment
    Share on other sites

    Ah! Bad news then....  But I know that ure watching it....  Thanks! 

    Link to comment
    Share on other sites

    • 2 weeks later...
  • Topic Author
  • 2 hours ago, tomisoft said:

    Hi @Sankotronic,
    I will ask shyly .... how are the UHAS tests going ?
    BR

    Tomis

     

    Hi @tomisoft ,

     

    UHAS for HC2 will be published before end of September even if some things will still not to be finished. At this moment I'm modifying ALC (Advanced Lighting Control) so that only one ALC Setup VD will be needed instead of installing VD for each room. After testing ALC for several months on my HC2 I find this modification very important to save some resources.

     

    For the rest, bugs that I could find are cleared. Today we where without electricity for several hours which helped me to find some more bugs that I'm now sorting out.

     

    Plan is to finish with coding and modifications till the end of this month and then will need about two weeks to write installation and setup manual.

     

    I also still need to see how to distribute UHAS. If I go for one package, size will be around 100-120Mb including 49 scenes, 90 Virtual Devices, complete set of icons and manuals.

     

    I think I will have to split it to at least 15 packages, one for each UHAS module. I might also distribute scenes and VD's with manuals and provide icons separately. Anyway, most of my icons are already available in download section, might just sort them out.

     

    • Like 1
    • Thanks 1
    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...