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


Fibaro system, me and this forum :)


Sankotronic

Recommended Posts

I brought HC2 last year in December. Because of my work I had just little bit more than four months to play with it in all this time. HC2 came with 4.056 firmware and as soon as I took it out of the box and connected to it, it was offering upgrade to 4.070 so I did it. Despite some problems, system was growing pretty fast, but programming was (and still is) quite challenging. Thanks to many members of this forum on their work and help that I manage to do something useful.

 

I use jompa68's Alarm Clock, and Boomx's script to collect data for Netatmo wind and rain gauges. I also use cag014 solution for devices and scenes ID to be stored in global variable, and krikroff's Sonos remote and many many other solution given here by members petergebruers, chaicka and many others. Thank you, thank all of you for all good ideas, solutions, code and help!

 

So, here it is in one picture, and it wouldn't be possible without your help on this forum. It is now on 4.100 with 72 modules included and the rest is in my signature :-)

I promised some members here that I will share what I have done and I will keep my promise, but just not yet. I have to go to my work again and I have to leave my "Angelina" to wait for me to come home to clear some bugs in code that I made and to give her more abilities. Luckily for me my wife is very supportive so I get list of her wishes and improvements that I can make every time when I came home.  Thank you all and see you soon!

 

Here is updated layout of my Angelina on 28th March 2017:

 

 

 

To see it in all it's beauty click on picture, then on "Full size" in lower left corner. :-) 

Edited by Sankotronic
Attachment quota filled up / deleting older stuff sorry :-(
Link to comment
Share on other sites

Wowsers, thats some list of devices/scenes! Maybe Fibaro should make a virtual copy of your setup for automated testing of the releases ;-)

 

I'm looking forward to some of your example scenes, but the help you have given me already has let me progress my (very modest) system to have automated lights in hallway and dining room and semi-automation in lounge and bedroom. Current work in progress is the house alarm with RFID reader, but I think Fibaro needs to do some work to have that integration correct as it needs to be able to signal the keypad properly. 

 

Anyway, keep up the good work! 8-)

Edited by Cameleon
Link to comment
Share on other sites

Impressive Sankotronic ! I can see that you have a lot of hues and I've got a big problem with them, and maybe you can provide me some help. I've got 12 in my living room and when I send an all On or Off command using the plugin or a VD or scene, only half is reacting, and everything is de-synchronise (some goes on other stay off ...) , do you have the same problem? I can see that you have hue scenario, are you using the hue scenario API to drive them? if yes could you please provide the pice of code to use Hue scenes as I never get to make it work? thank you for your feedback and help. And once again very nice ecosystem !

Edited by Tony270570
Link to comment
Share on other sites

  • Topic Author
  • Hi Tony, I had same problems with my 27 HUE bulbs, they just wouldn't listen to turn on or off. So first thing what I did is removed main loop from all of them and moved code to the button I called Refresh. This greatly reduced network traffic between HC and HUE bridge and improved response from the bulbs. Next what I did I added a small delay between commands to the lamps so that HUE bridge buffer don't get filled up. Problem is with the bulbs that communicate with bridge through other bulbs and not directly. This helped little bit more so it happened only very rearly that one bulb sometimes go on but very diimed instead to predefined brightness.

     

    Few days ago I replaced old bridge v1.0 with the new version 2 and for now no problems at all anymore . I wrote scene that take care of our lighting, very cofigurable one with many options and it supports all kind of light controllers, VD, dimmer, RGBW module, switch, smart plug so we don't use any more HUE app or even Fibaro app. I'm still testing it and trying to compensate limitations of battery powered motion and light sensors. With this scene lights are triggered by motion and light sensors but can be also controlled by other devices and global variables depending on their state. Dimming levels can not only be controlled by time of day but also with the state of the house, awake, sleep, watching TV or having guests. I write this about smart light scene because last step is to incorporate scenarios.

     

    At the moment I don't use API to drive HUE scenarios but just table variable which contains color and hue setting for all or just selected bulbs. This is transfered to global variable with scene and then executed by VD. I decided to use this approach because I want that this scenarios also include RGBW modules and even other dimmable lights and that scenarios are executed by smart light scene depending on user settings. Anyway this is work in progress and it will probably change as I learn more about HC and LUA.

     

    Oh and just to mention that I use default scenario to adjust all HUE bulbs color after power loss because HUE bulbs turn on to yellowish color after power is restored what we don't like, and then other scene which turn them off depending on the state of our hose and time of day.

     

    Link to comment
    Share on other sites

    Hi Sankotronic, thank you very much for your useful feedback, I'll apply what you suggest me, I've already implemented delays but without success when using plugins or the VDs like they are with their main loops. I'll move the code to buttons, never thought about that! THANK YOU!! :) I don't have problems of communication as all HUEs are concentrated in 2 twins open rooms, but happy that it has fixed your problem and it's good to know as I stop buying HUEs  because of the really bad handling  with the HC, if I get to make it works with your tip, I'll buy few mores and probably the bridge v2 as well :)

     

    Edited by Tony270570
    Link to comment
    Share on other sites

    • 2 months later...
  • Topic Author
  • And it is time for little update.

     

    After two months from previous post I manage to improve many things, mostly under the hood by rewriting scenes. Main scene that takes care of all time based events I posted half hour ago but can't leave here link to it, because it is still pending for approval. I hope that it will be released until tomorrow because then I will post more solutions.

     

    Anyway, new is Smart coffee machine virtual device that make possible to integrate it to HC2. I posted this VD with instructions here:

    So if you own one of this coffee machines and HC2 then go and grab your copy!!! Finally we have coffee ready in the morning before even get up from bed! That is what I call smart home automation!!

     

    Since holidays are almost here I made simple VD "Holiday Lights" that turns on Christmas lights in the morning when we wake up, then turns them off at day time. It turns them on again just before sunset and turns them off again when we go to bed. For this I used some spare smart plugs, some relay modules, RGBW module and some of the HUE lamps to give our house holiday atmosphere.

     

    "Very Smart Lights™" scene is also finished and I added also possibility to dim lights to some special mood when holiday lights are turned on. It is actually a nice touch! So as soon as Main scene is released I will bring to you "Holiday lights" and "Very Smart Lights™" too.

     

    Since I brought Global Cache IP2IR device I bring control of our multimedia corner to higher level. It is really nice device, easy to learn codes from remotes. So I manage to  make remotes for our IP TV set-top box, Philips TV and Samsung sound-bar all in one afternoon. Next thing is to automate it even more but about that next time.

     

    There are also some new devices added, VD that is reading radiation from nearest station and Krikroffs VD for syncing HC's clock.

     

    Future plans. Uffff, there is still many things to do. But since I just get Smarter iKeetle 2.0 priority is to make nice VD to integrate it to our HC2. Already did some testing and will see. You can see Test VD at the bottom of the picture in room Tests. Then I still need to write scene to control HUE lamps to mimic Christmas lights as part of before mentioned "Holiday Lights" VD. Many other scenes need to be rewritten to be adopted for general use like I did for Main scene and Very Smart Lights™ scene.

     

    And here it is, my little Angelina:

     

    Please login or register to see this attachment.

     

    And it is free to use for commercial advertising if anyone cares! :-) 

    Happy coding!!

     

    P.S.

    When you click on picture and it opens then you have in left bottom corner button to see in Full size. When you click on it, picture will open in new tab where you can enlarge it to see all details!

    Edited by Sankotronic
    Link to comment
    Share on other sites

    @Sankotronic

     

    Impressive! :) Your code have helped me get started with my scenes and my automation a lot. Thank you for all your contribution here, it is invaluable!

     

    Cheers!

    Link to comment
    Share on other sites

    • 2 weeks later...
  • Topic Author
  • One winter day with Angelina (HC2)

     

                It is early morning of a quiet winter day. Sun is still behind distant hill preparing to show itself. We are all sleeping on this winter working day. Angelina is watching over our house. At exactly 6:30h in the morning she first turns on lighting in our bedrooms, very dimmed and in color of rising sun. This is our wake up time that we adjusted on Alarm clock last night before we went to bed. Then she (Angelina) turns on music on our Sonos speakers in living room and bedroom. Music started playing very silently. While lights gradually raise brightness and music volume gently becomes louder she activates our coffee machine to brew fresh morning coffee.

     

                I just opened my first eye to gentle raising sunlight that was coming from our HUE lamps in our bedroom and music that was just loud enough to wake us up. Smell of freshly brewed coffee get our attention when Angelina say on Sonos speaker in our bedroom: " Good morning! Today is friday, 6 and 35 o'clock and you are listening to Open radio. Coffee is ready for you. Today weather will be clear and sunny. Temperature outside is minus 4 degrees and humidity is 85%. Wind is blowing from east with speed of 4 km/h and gusts of 10 km/h. In last 24 hours there was no rain. Temperature inside is 21 degrees and humidity 67%. I wish you pleasant working day!" and then music comes back with volume adjusted for morning hours.

     

               I get up and on the way to bathroom lights were turning on with gentle brightness so that my eyes can adapt quickly. I saw that our son and daughter were still turning in bed in their rooms that where illuminated with gentle morning LED lights probably wishing that they never forget that beautiful dream that Angelina interrupted five minutes ago. Since holiday time is near normal lighting was complemented with Christmas lights that I instructed Angelina to turn on when we wake up. I just sometimes wish that they can be dimmed down like other lighting. Flashing colorful light was coming from all rooms. We sat at the table in the dining room ready to have our breakfast when Angelina raised blinds. Aha, it is sunrise time so we are ready to see sun showing up behind that distant hill that was still without snow hat.

     

               After breakfast we rushed to get in to the car to drive children to school and my wife and I planned to go to the town to do some shopping before Christmas. While I was driving our car out of the garage I press button on iPhone to activate "Going away" scene. Yes i would like I don't have to do that but since Fibaro app is eating our mobile phones batteries that is what we have, to press button! After pressing button I get message back that we forget to close window in big bathroom. My wife take care of that and I get informed that house is ready for us to leave and that music is stopped, all lighting will be turned off in a minute and also blinds lowered. Alarm will be armed in 3 minutes. I closed garage door and our gate and start driving to the school. On the way there I get push notifications on my Apple watch that lights and blinds are closed and alarm is armed successfully. So house is safe :).

     

              During shopping we get push notification that washing machine finished washing our laundry. I looked my wife with a smile. She asked me once if I can automate washing machine and dryer machine so that they move clothes from washing to dryer machine automatically. Of course I told her that she is irreplaceable! But maybe Fibaro will soon have some control module that can be implanted to wives and make them more controllable. We laughed! :D

     

              On the way home I pressed again button on iPhone to start scene "Returning home" and entered PIN. Angelina informed me with push messages that she will prepare house for our return in few minutes. Since it was still day she didn't turn on any lights, just raised blinds, started music and coffee machine. She would like also to check heating but that part I still didn't connect since I'm still looking for a solution.

     

              When we arrive home and opened entrance door Angelina welcomed us with her gentle voice and informed us that coffee is ready, also that temperature and humidity outside is now good to ventilate house, so we opened some windows. After one hour of ventilating house Angelina told us that CO2 level is now on zero, humidity in house has dropped to nice 56% but also temperature to 20 degrees celsius and heating will be started soon, so it is advisable to close all windows and she send popup message with the list of windows opened. How nice of her! :)

     

              Late afternoon thick clouds covered sky above our house making it dark so lights stared to turn on in the rooms where we were moving even was still day time. Also half hour before sunset Angelina turned on Christmas lights and house filled up with flashing vivid colors from many small LED's. Other lighting lowered brightness in that moment to raise festive mood. How nice that finally I don't have to run from one socket to another connecting Christmas lights. Now Angelina is doing that for me. Ten minutes after sunset Angelina lowered blinds and changed brightness on some lighting to evening levels and turned some of them On that suppose to be dimmed until bed time. She also told me that it is advisable to close swimming pool machinery room door and our basement door that I opened when we came home.

     

              After dinner I sat on my couch to watch TV that Angelina turned on at exactly 7 o'clock in the evening. She knows when I'm at home that I like to watch evening news so she also selected channel with my favorite news. I just wonder where I stored remote controls for TV and set top box, hmmm. Oh, no, I don't need them any more, I was just thinking if I removed batteries from them before storing. :D

     

             And it came time to go to bed. Our children was already dreaming new dreams. Lights in their room where turned off and bedrooms put to sleep. We just went to bed leaving everything still turned On. Well, Angelina will take care of everything anyway. I was first in bed so I swiped Fibaro swipe and Angelina first turned off TV and set top box. Then she told me that coffee machine is not ready for morning coffee. Ufff, my wife probably forgot to reset Smarter Coffee VD after replacing filter and coffee. I'm still waiting for one more Fibaro button to stick it on the coffee machine so that she can do that easy way. I use my iPad to reset VD and Angelina continued with complaining that I still didn't close doors to machinery room and basement that she mentioned before. Uff, why she can't do that for me. So I had to get up and close doors that I forget to close. After that she turned off all lighting, armed some of the sensors and said: "My dearest, coffee machine is ready for morning coffee. All doors and windows are closed and alarm armed. Everything is turned off and alarm clock is also turned  off. I wish you sweet dreams!"

     

    To be continued!

     

     

     

     

               

    Edited by Sankotronic
    Link to comment
    Share on other sites

  • Topic Author
  • 1 minute ago, mobbie said:

    @Sankotronic that is absolutely awesome.  Thankyou.  Now need the wife to read:)

    I actually read and translated to her before posting and we had a big laugh again. :D

    Link to comment
    Share on other sites

    2 hours ago, Sankotronic said:

    One winter day with Angelina (HC2)

     

                It is early morning of a quiet winter day. Sun is still behind distant hill preparing to show itself. We are all sleeping on this winter working day. Angelina is watching over our house. At exactly 6:30h in the morning she first turns on lighting in our bedrooms, very dimmed and in color of rising sun. This is our wake up time that we adjusted on Alarm clock last night before we went to bed. Then she (Angelina) turns on music on our Sonos speakers in living room and bedroom. Music started playing very silently. While lights gradually raise brightness and music volume gently becomes louder she activates our coffee machine to brew fresh morning coffee.

     

                I just opened my first eye to gentle raising sunlight that was coming from our HUE lamps in our bedroom and music that was just loud enough to wake us up. Smell of freshly brewed coffee get our attention when Angelina say on Sonos speaker in our bedroom: " Good morning! Today is friday, 6 and 35 o'clock and you are listening to Open radio. Coffee is ready for you. Today weather will be clear and sunny. Temperature outside is minus 4 degrees and humidity is 85%. Wind is blowing from east with speed of 4 km/h and gusts of 10 km/h. In last 24 hours there was no rain. Temperature inside is 21 degrees and humidity 67%. I wish you pleasant working day!" and then music comes back with volume adjusted for morning hours.

     

               I get up and on the way to bathroom lights were turning on with gentle brightness so that my eyes can adapt quickly. I saw that our son and daughter were still turning in bed in their rooms that where illuminated with gentle morning LED lights probably wishing that they never forget that beautiful dream that Angelina interrupted five minutes ago. Since holiday time is near normal lighting was complemented with Christmas lights that I instructed Angelina to turn on when we wake up. I just sometimes wish that they can be dimmed down like other lighting. Flashing colorful light was coming from all rooms. We sat at the table in the dining room ready to have our breakfast when Angelina raised blinds. Aha, it is sunrise time so we are ready to see sun showing up behind that distant hill that was still without snow hat.

     

               After breakfast we rushed to get in to the car to drive children to school and my wife and I planned to go to the town to do some shopping before Christmas. While I was driving our car out of the garage I press button on iPhone to activate "Going away" scene. Yes i would like I don't have to do that but since Fibaro app is eating our mobile phones batteries that is what we have, to press button! After pressing button I get message back that we forget to close window in big bathroom. My wife take care of that and I get informed that house is ready for us to leave and that music is stopped, all lighting will be turned off in a minute and also blinds lowered. Alarm will be armed in 3 minutes. I closed garage door and our gate and start driving to the school. On the way there I get push notifications on my Apple watch that lights and blinds are closed and alarm is armed successfully. So house is safe :).

     

              During shopping we get push notification that washing machine finished washing our laundry. I looked my wife with a smile. She asked me once if I can automate washing machine and dryer machine so that they move clothes from washing to dryer machine automatically. Of course I told her that she is irreplaceable! But maybe Fibaro will soon have some control module that can be implanted to wives and make them more controllable. We laughed! :D

     

              On the way home I pressed again button on iPhone to start scene "Returning home" and entered PIN. Angelina informed me with push messages that she will prepare house for our return in few minutes. Since it was still day she didn't turn on any lights, just raised blinds, started music and coffee machine. She would like also to check heating but that part I still didn't connect since I'm still looking for a solution.

     

              When we arrive home and opened entrance door Angelina welcomed us with her gentle voice and informed us that coffee is ready, also that temperature and humidity outside is now good to ventilate house, so we opened some windows. After one hour of ventilating house Angelina told us that CO2 level is now on zero, humidity in house has dropped to nice 56% but also temperature to 20 degrees celsius and heating will be started soon, so it is advisable to close all windows and she send popup message with the list of windows opened. How nice of her! :)

     

              Late afternoon thick clouds covered sky above our house making it dark so lights stared to turn on in the rooms where we were moving even was still day time. Also half hour before sunset Angelina turned on Christmas lights and house filled up with flashing vivid colors from many small LED's. Other lighting lowered brightness in that moment to raise festive mood. How nice that finally I don't have to run from one socket to another connecting Christmas lights. Now Angelina is doing that for me. Ten minutes after sunset Angelina lowered blinds and changed brightness on some lighting to evening levels and turned some of them On that suppose to be dimmed until bed time. She also told me that it is advisable to close swimming pool machinery room door and our basement door that I opened when we came home.

     

              After dinner I sat on my couch to watch TV that Angelina turned on at exactly 7 o'clock in the evening. She knows when I'm at home that I like to watch evening news so she also selected channel with my favorite news. I just wonder where I stored remote controls for TV and set top box, hmmm. Oh, no, I don't need them any more, I was just thinking if I removed batteries from them before storing. :D

     

             And it came time to go to bed. Our children was already dreaming new dreams. Lights in their room where turned off and bedrooms put to sleep. We just went to bed leaving everything still turned On. Well, Angelina will take care of everything anyway. I was first in bed so I swiped Fibaro swipe and Angelina first turned off TV and set top box. Then she told me that coffee machine is not ready for morning coffee. Ufff, my wife probably forgot to reset Smarter Coffee VD after replacing filter and coffee. I'm still waiting for one more Fibaro button to stick it on the coffee machine so that she can do that easy way. I use my iPad to reset VD and Angelina continued with complaining that I still didn't close doors to machinery room and basement that she mentioned before. Uff, why she can't do that for me. So I had to get up and close doors that I forget to close. After that she turned off all lighting, armed some of the sensors and said: "My dearest, coffee machine is ready for morning coffee. All doors and windows are closed and alarm armed. Everything is turned off and alarm clock is also turned  off. I wish you sweet dreams!"

     

    To be continued!

     

     

     

     

               

     

    wow, wow and wow.. this is where I am trying to go and it actually proves that the little HC2 is very capable.

    I have control of almost everything (tv's and media soureces, music zones, lights, gates, garage , alarm, heating a challenge as its a closed system and no blinds installed.. yet) and just about to purchase a Aoen multisensor 6 for each room. I bought one to check it out and have 4 more coming next week. I'll build up from there and your setup proves that the HC2 can manage the workload so for me it's mostly about the coding/automation.....

     

    I have a good bit of automation (away, night, home, morning modes, etc) and various sunset and sunrise and some voice feedback (using jishi simplified api) but in comparison to your setup I have hardly scratched the surface :-(

     

    When you decide to share some more I would be very interested in two things ( as well as all your code base :-) )

    1) How you organise the devices and scenes into rooms or house category or ???

    2) what does a typical room look like (a bedroom and something like a kitchen or living room)

     

    thanks

    -f

     

     

     

     

     

     

    Edited by AutoFrank
    Update
    Link to comment
    Share on other sites

    @Sankotronic if you have the time I'd love to know what/how each thing works in you story.  Ie alarm clock in morning is a scene that does xyz, hue lights is a scene with the sankotronic vd lights, voice into sonos done by xyz. 

     

    It will be really handy to understand the logic and how all this hangs together.  

     

    Also as the previous post how you structure and name the devices to make it logical would be great too.

     

    Thanks again too.  Im only at the start of the journey and it makes me excited to see this!

    Link to comment
    Share on other sites

  • Topic Author
  • 2 hours ago, AutoFrank said:

     

    wow, wow and wow.. this is where I am trying to go and it actually proves that the little HC2 is very capable.

    I have control of almost everything (tv's and media soureces, music zones, lights, gates, garage , alarm, heating a challenge as its a closed system and no blinds installed.. yet) and just about to purchase a Aoen multisensor 6 for each room. I bought one to check it out and have 4 more coming next week. I'll build up from there and your setup proves that the HC2 can manage the workload so for me it's mostly about the coding/automation.....

     

    I have a good bit of automation (away, night, home, morning modes, etc) and various sunset and sunrise and some voice feedback (using jishi simplified api) but in comparison to your setup I have hardly scratched the surface :-(

     

    When you decide to share some more I would be very interested in two things ( as well as all your code base :-) )

    1) How you organise the devices and scenes into rooms or house category or ???

    2) what does a typical room look like (a bedroom and something like a kitchen or living room)

     

    thanks

    -f

    Hello @AutoFrank,

     

    Even everything I wrote our Angelina can do, I have feeling that I still have a long way to go and it is becoming harder to follow everything since it is so much interconnected. For example, I can post here scene that is taking care of Alarm clock and since it is run by Main scene for time based events which I already posted, then Main scene should be installed first. Alarm clock scene then runs two scenes depending on alarm settings, one is Good morning scene and another is reminder scene. Good morning scene will run Wake up lamp and Wake up music scenes, will press button Brew on Smarter coffee machine, disarm cameras and alarm by calling Disarm alarm scene, open blinds if I set them to open at wake up time instead at sunrise/sunset time with calling Operate Blinds scene and it will prepare first part of Angelina morning greeting. This part with TTS is most demanding since I want to have one scene that will prepare part for weather forecast which then I can use and call in different situations. I also want to give her at least a little bit of freedom to change statements occasionally so that it looks more alive and that is the hardest part.

     

    All my scenes are responsible for one task only and this approach reduces amount of code needed but makes everything interconnected and harder to follow with some amount of global variables in place. Also when I started programming I was writing code very specific for our situation and habits so now I'm rewriting everything to be more universal and that can be used widely on many different systems. That task was more or less easy with Main scene for time based events control and I believe that with some modifications and few more features should become integrated part of the HC system. We all really need sunrise and sunset time used to change time of day, darkness, seasons, weekdays and months and source that will run other things at predefined intervals and schedules but exact ones and not using fibaro:sleep function. Same is with Very Smart Lights™ or VSL™ scene which does depend on Main scene and partly on Holiday Lights VD but that is all. Lighting is also demanding part of HA and it took me quite some time to build up this scene and find all kind of ways how to control them without need to reach out for any switches or remotes.

     

    And now answers to your questions.

    1) I have everything organized in the real and virtual rooms. You can actually see that from my picture posted in post #6.

     - All scenes that are part of automation and we don't need to run them manually are squeezed in virtual room named Scenes.

     - Scenes that we frequently use like Awake, Sleep, Away, Home, Holiday and Info are in virtual room named Our House and are on the top.

     - Scenes that are strictly bounded to specific room is in that room but last on the display since usually those scenes we don't need to run manually

     - All virtual devices that are used to change some setup and are rarely used are squeezed in virtual room Setup.

     - Multimedia remotes are in virtual room Living room Media so separated from Living room just to reduce scrolling on mobile phone or tablet.

     - Some VD's that are frequently used like Alarm Clock, Smarter coffee, Room sleep state, etc, resides in room to which they belong with their task and are on the top of the others.

     - Devices or modules are sorted in the way that actors are first in the room and then sensors so that if we still want to control lights or blinds or some plugs manually that they are under the finger first.

     

    2) As I already mention Living room is separated to Living Media with remotes and Living room with actors and sensors and look like this:

    Living room Media with remotes and button:

    Please login or register to see this attachment.

    Living room with actors, VD and sensors:

    Please login or register to see this attachment.

    Master bedroom with VD's on first place and then the rest:

    Please login or register to see this attachment.

    And kitchen with most important VD Smarter coffee :-) :

    Please login or register to see this attachment.

    You can also notice some of the scenes that are in rooms above but last on display because they are all run by Angelina or with swipe.

     

    For me it doesn't really matter how everything is arranged since I reduced need for any manual operation done by mobile devices or web GUI except for leaving and coming back home. For that I hope that geofencing will jump in as soon as Fibaro rectify battery drain when location services are turned on for their app.

    And I will continue to write our Angelina story and post some more code as soon as it is ready.

     

    Link to comment
    Share on other sites

  • Topic Author
  • 2 hours ago, mobbie said:

    @Sankotronic if you have the time I'd love to know what/how each thing works in you story.  Ie alarm clock in morning is a scene that does xyz, hue lights is a scene with the sankotronic vd lights, voice into sonos done by xyz. 

     

    It will be really handy to understand the logic and how all this hangs together.  

     

    Also as the previous post how you structure and name the devices to make it logical would be great too.

     

    Thanks again too.  Im only at the start of the journey and it makes me excited to see this!

    Hello @mobbie,

     

    I believe that I already partly answered your questions in my replay to @AutoFrank. But here is one example. Just one task to wake us up Angelina uses 9 VD and 12 scenes:

     

    1) Sunrise & Sunset VD is used to setup some basic time based events together with Main scene so it does influence complete system:

        

    Please login or register to see this image.

    /monthly_2016_12/58605a778e005_VDSunriseandSunset.jpg.50db2851cc4cb00ff59b1928190e0d36.jpg" alt="VD Sunrise and Sunset.jpg" />

    2) Alarm Clock VD used to adjust wake up time:

        VD - Alarm Clock.jpg

    3) Blinds setup is used to setup when and how blinds will be open and closed

        VD Blinds setup.jpg

    4) TTS Mode and TTS language VD's are used to setup Angelina voice and language. She speaks fluently Croatian, Italian, English and German.

        

    Please login or register to see this attachment.

    5) Main scene is running all the time and calls every minute Alarm Clock scene to check if it is time for wakeup or reminder to run

        Scene Main.jpg --> Scene Alarm Clock.jpg Checking every minute for proper time to wakeup

    6) If Alarm scene find out that there is time to wake up then it calls scene Good morning:

        Scene Alarm Clock.jpg --> Scene Good morning.jpgSetting up some globals for wakeup task and sending settings for next scenes

    7) Scene good morning calls scenes Wakeup lamp, Wakeup Music, Alarm & camera disarm, Open blinds, TTS Good morning, VD Smarter coffee

        Scene Good morning.jpg --> Scene Wakeup light.jpg Wake up lamp is setting color and raising brightness of our bedroom lights

        Scene Good morning.jpg --> Scene Wakeup music.jpg Wake up music starts favorite radio station and raises volume slowly

        Scene Good morning.jpg --> Scene Disarm alarm.jpg Disarms selected sensors and cameras

        Scene Good morning.jpg --> Scene Open blinds.jpg Depending on settings made with VD Blinds setup may not run

        Scene Good morning.jpg --> VD Smarter coffee.jpg Brews fresh morning coffee! :-P 

    8) Scene wakeup lamp when finished with raising brightness of our lights in bedrooms then sets our house to awake status and presses buttons on bedroom sleep status VDs. I have 3 of them but will show here only one:

        Scene Wakeup light.jpg --> VD Master bedroom sleep status.jpg Sets rooms to awake

    9) Scene wakeup Music after starting music and raising volume to predefined level then calls Auto volume scene and TTS Good morning scene:

        Scene Wakeup music.jpg --> Scene Auto volume.jpg Adjusts music volume depending on Time of day

        Scene Wakeup music.jpg --> Scene TTS Dobro jutro.jpg Prepares first part of Angelina morning speech

    10) TTS Good morning scene prepares first part of Angelina greeting and then calls TTS radio to tell us what we are listening:

        Scene TTS Dobro jutro.jpg --> Scene TTS Radio.jpg Adding info what we are listening at the moment

    11) TTS Radio calls TTS Weather report scene to complete morning speech of Angelina:

        Scene TTS Radio.jpg --> Scene TTS Prognoza.jpg Adding weather status report to the morning speech

    12) Finally TTS Weather report scene calls TTS Master Bedroom scene to make Angelina speak on our bedroom Sonos speaker:

        Scene TTS Prognoza.jpg --> Scene TTS Soba.jpg Sends prepared message to our bedroom Sonos speaker

     

     

     

     

     

     

    Link to comment
    Share on other sites

    @Sankotronic thanks again mate, yes you did answer it in the previous post but this extra detail has got me back into it today trying to get voice to work over my sonos :)

    Link to comment
    Share on other sites

    11 hours ago, Sankotronic said:

    Hello @AutoFrank,

     

    Even everything I wrote our Angelina can do, I have feeling that I still have a long way to go and it is becoming harder to follow everything since it is so much interconnected. For example, I can post here scene that is taking care of Alarm clock and since it is run by Main scene for time based events which I already posted, then Main scene should be installed first. Alarm clock scene then runs two scenes depending on alarm settings, one is Good morning scene and another is reminder scene. Good morning scene will run Wake up lamp and Wake up music scenes, will press button Brew on Smarter coffee machine, disarm cameras and alarm by calling Disarm alarm scene, open blinds if I set them to open at wake up time instead at sunrise/sunset time with calling Operate Blinds scene and it will prepare first part of Angelina morning greeting. This part with TTS is most demanding since I want to have one scene that will prepare part for weather forecast which then I can use and call in different situations. I also want to give her at least a little bit of freedom to change statements occasionally so that it looks more alive and that is the hardest part.

     

    All my scenes are responsible for one task only and this approach reduces amount of code needed but makes everything interconnected and harder to follow with some amount of global variables in place. Also when I started programming I was writing code very specific for our situation and habits so now I'm rewriting everything to be more universal and that can be used widely on many different systems. That task was more or less easy with Main scene for time based events control and I believe that with some modifications and few more features should become integrated part of the HC system. We all really need sunrise and sunset time used to change time of day, darkness, seasons, weekdays and months and source that will run other things at predefined intervals and schedules but exact ones and not using fibaro:sleep function. Same is with Very Smart Lights™ or VSL™ scene which does depend on Main scene and partly on Holiday Lights VD but that is all. Lighting is also demanding part of HA and it took me quite some time to build up this scene and find all kind of ways how to control them without need to reach out for any switches or remotes.

     

    And now answers to your questions.

    1) I have everything organized in the real and virtual rooms. You can actually see that from my picture posted in post #6.

     - All scenes that are part of automation and we don't need to run them manually are squeezed in virtual room named Scenes.

     - Scenes that we frequently use like Awake, Sleep, Away, Home, Holiday and Info are in virtual room named Our House and are on the top.

     - Scenes that are strictly bounded to specific room is in that room but last on the display since usually those scenes we don't need to run manually

     - All virtual devices that are used to change some setup and are rarely used are squeezed in virtual room Setup.

     - Multimedia remotes are in virtual room Living room Media so separated from Living room just to reduce scrolling on mobile phone or tablet.

     - Some VD's that are frequently used like Alarm Clock, Smarter coffee, Room sleep state, etc, resides in room to which they belong with their task and are on the top of the others.

     - Devices or modules are sorted in the way that actors are first in the room and then sensors so that if we still want to control lights or blinds or some plugs manually that they are under the finger first.

     

    2) As I already mention Living room is separated to Living Media with remotes and Living room with actors and sensors and look like this:

    Living room Media with remotes and button:

    Please login or register to see this attachment.

    Living room with actors, VD and sensors:

    Please login or register to see this attachment.

    Master bedroom with VD's on first place and then the rest:

    Please login or register to see this attachment.

    And kitchen with most important VD Smarter coffee :-) :

    Please login or register to see this attachment.

    You can also notice some of the scenes that are in rooms above but last on display because they are all run by Angelina or with swipe.

     

    For me it doesn't really matter how everything is arranged since I reduced need for any manual operation done by mobile devices or web GUI except for leaving and coming back home. For that I hope that geofencing will jump in as soon as Fibaro rectify battery drain when location services are turned on for their app.

    And I will continue to write our Angelina story and post some more code as soon as it is ready.

     

     

    Thanks @Sankotronic.

    that help a lot with my understanding.

     

    you secan m to use a lot of discrete and individual scenes and I assume this is to make sure that there is no need to run multiple instances of the same scene.

     

    in your explanation  to mobile you take about the morning greeting put s together the TTS for the time, the radio and the weather in 3 scenes. I'm curious as to why you wouldn't put these into one scene is they all run in sequence. is it because the HC2 doesn't order http requests very well or because you may call TTS weather separate to the other 2 scenes or just because your system has evolved organically. 

     

    Either way way it's a very impressive setup

     

    thanks for taking the time to write and to share the VD code.

     

    -frank

     

    Link to comment
    Share on other sites

    @Sankotronic Thank you very much for your contribution. The issues and discussion of how to structure and organize the different parts of code used to automate our homes has so far been almost absent on the forum. This is now becoming overdue as more and more users are reaching a volume of code and integration of code that pushes this upwards on their priority list. Hence Fibaro should, (as you point out), also prioritize this in their development of their system, and in their e-learning.

    Link to comment
    Share on other sites

  • Topic Author
  • 16 minutes ago, AutoFrank said:

     

    Thanks @Sankotronic.

    that help a lot with my understanding.

     

    you secan m to use a lot of discrete and individual scenes and I assume this is to make sure that there is no need to run multiple instances of the same scene.

     

    in your explanation  to mobile you take about the morning greeting put s together the TTS for the time, the radio and the weather in 3 scenes. I'm curious as to why you wouldn't put these into one scene is they all run in sequence. is it because the HC2 doesn't order http requests very well or because you may call TTS weather separate to the other 2 scenes or just because your system has evolved organically. 

     

    Either way way it's a very impressive setup

     

    thanks for taking the time to write and to share the VD code.

     

    -frank

     

    Hello @AutoFrank,

     

    I separated TTS messages for weather report and what is playing so I'm able to used them in different situations with different sequence or just directly. Also I want Good morning scene to be clean code with clean sequence what it has to do. I could easily leave TTS code for good morning greeting in that scene, but then again TTS part is still in development and I want code for good morning scene to stay intact and to work even if I mess something up with TTS greeting itself. Besides, my goal is to get to the level where I will have chunks of code which then I will be able to multiply or copy/paste and combine them to make new actions. 

     

    For example, code to send popup messages I plan to remove from all scenes and put it in one scene where it can be used by all other code. Since scenes allow to run in many instances that shouldn't be a problem. Only problem is how to transfer messages from one scene to another using global variables and that previous content sent by one scene is not overwritten by another scene before first one is sent. I was thinking of putting all messages in one global variable table and then just sending pointers to specific message. That I believe should do the trick. But this requires a lot of planning and organizing.

     

    Same can be done with TTS messages but here we need some kind of flag that is set when TTS is already busy with one message so that next one sent will then wait in buffer to be read after first one is done. At this moment Krikroff's Sonos remote doesn't provide this level of control and if new message is sent before previous one didn't finish then it will be just ignored.

     

    Link to comment
    Share on other sites

    15 minutes ago, Sankotronic said:

    Hello @AutoFrank,

     

    I separated TTS messages for weather report and what is playing so I'm able to used them in different situations with different sequence or just directly. Also I want Good morning scene to be clean code with clean sequence what it has to do. I could easily leave TTS code for good morning greeting in that scene, but then again TTS part is still in development and I want code for good morning scene to stay intact and to work even if I mess something up with TTS greeting itself. Besides, my goal is to get to the level where I will have chunks of code which then I will be able to multiply or copy/paste and combine them to make new actions. 

     

    For example, code to send popup messages I plan to remove from all scenes and put it in one scene where it can be used by all other code. Since scenes allow to run in many instances that shouldn't be a problem. Only problem is how to transfer messages from one scene to another using global variables and that previous content sent by one scene is not overwritten by another scene before first one is sent. I was thinking of putting all messages in one global variable table and then just sending pointers to specific message. That I believe should do the trick. But this requires a lot of planning and organizing.

     

    Same can be done with TTS messages but here we need some kind of flag that is set when TTS is already busy with one message so that next one sent will then wait in buffer to be read after first one is done. At this moment Krikroff's Sonos remote doesn't provide this level of control and if new message is sent before previous one didn't finish then it will be just ignored.

     

     

    that makes sense with the scenes and has been the same approach I have been taking....

     

    Re the TTS

    - I started with Krikroff remote which is very impressive. I came across simplified sonos API written by Jishi on git (

    Please login or register to see this link.

     ) and this provides a fantastic level of control. I have since moved completely to using this for both regular sonos control as well as TTS. The part that some people don't like is that it needs to be installed on a node/js device. I use a raspberry pi and have it running now for several months and it is very solid. Jishi also has a very active git and the api has evolved a huge amount in the last short while. If you don't mind that part about setting up the pi or something similar this may be worth looking into to. I have a 14 sonos zones (built up over 10 years) same issue as where where I wanted to have multiple zones say different message and at the same time. The api allows this. It use VoiceRSS for the TTS and also has a sayall command that broadcasts to all zones. It can also handle mp3 audio clips.

    I have attached a screenshot of a VD i use to monitor all zones.

    I can put together a quick VD for a zone to show you what it looks like before you dive in.

    I also plan on creating one that mimics the recently launched  "iPort xPRESS"

     

    I have been having issues with my sunset/sunrise setup so I might use your solution if that's okay. 

    I have also started to use cag014 approach to the storing device ID in a global variable so it looks like a busy few days ahead. 

     

    anyway - thanks again for your story and solution.

    -frank

     

    Please login or register to see this attachment.

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