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


Recommended Posts

Posted

Hi guys,

Not a lot of personal project stories on here, but I thought i'd tell a little about what I'm trying to achieve...

I bought a Fibaro HC2 a few weeks ago with the idea for it to function as direct integration of my home. Unfortunately, both the web interface and the dedicated apps seem a little clunky and slow to use... So I set about trying to create my own frontend. So I've had to learn both PHP and Javascripting to get it to work... But now I've got those covered so I've created my basic setup. It registers and sets up all devices and rooms registered on the HC2 automatically, so if anyone would like to try it on for themselves I'll be glad to share my code. Only thing you should need to change is username, password and ip-address

Anyway, the design brief was pretty straight forward: it should look nice, be girlfriend friendly and work on any platform, so it is set up over a web server. I've bought a bunch of 7" tablets to function as room controllers, but I have 't got the interface for those ready yet. It does not need to have the full HC2 support, it just needs to take care of everyday stuff.

Right now, I've got support for all my dimmer and switch controls, input from smoke sensor temperature, smoke sensor alarms, light, temperature and humidity from my 4-in1s. Next up will be Hue integration, and then finally danfoss thermostat controls... But that will not be for another few months.

If you guys find it of any interest, I'll report a little on my progress as I get along.

*** Edit ***

now with a few screenshots

Please login or register to see this attachment.

Please login or register to see this attachment.

Please login or register to see this attachment.

Please login or register to see this attachment.

Guest Lode
Posted

Interesting .......i want to try it.....

Please login or register to see this image.

/emoticons/default_icon_biggrin.gif" alt=":-D" />

  • Topic Author
  • Posted
    Interesting .......i want to try it.....

    Please login or register to see this image.

    /emoticons/default_icon_biggrin.gif" alt=":-D" />

    Great,

    I've attached a .rarfile with all the code I have. As it says it is a beta - and a very early one at it. So only the home and information buttons work.

    You have to open all the .php-files and change the "USERNAME:[email protected]" with your username, password and ip. once I've got something with a bit more polish, I'll make a config file for easy integration... But if you want to try it, it should only take a few minutes to open in notepad and change the necessary inputs.

    Also, it comes with a disclaimer... This is my very first try at php and javascripting, so the code might be a bit clunky.

    Anyway, just put the content of the .rar onto your webserver and go to the index page in your browser and you should be good to go.

    Oh yeah... And I might have borrowed a bit of graphics around the web - but it should all be free to use for personal use.

    Guest Lode
    Posted

    Thx, i will try this tonight.

    Right now duty calls

    Please login or register to see this image.

    /emoticons/default_icon_mad.gif" alt=":-x" />

    Posted

    Thaaaaank you!

    Posted

    Wow, thanks dude! This is really great, really curious to find out how it works and what it does. I agree with your view; a serious home automation system should have the basic functions available in a room controller. All the advanced features should either be not available in that controller at all, or tucked away in other screens.

    I'm at the point where I'm going to ask a good web-developer that I know to build something like this, even for serious money (I simply lack the time and competences to do it myself

    Please login or register to see this image.

    /emoticons/default_icon_wink.gif" alt=";-)" />). This at least helps to explain the concept and perhaps help him to get on the way with this new system.

    Posted

    good I would to do thing like that with a touchscreen.

    I will take look.

  • Topic Author
  • Posted

    Hi guys,

    No problem - would be great if someone else can benefit from the code. It works on a basic json dump which is taken every second for input and then a dedicated php document running inside a hidden iframe which activates a curl request to the HC2. It's not pretty, and when I get around to looking at the jquery http request, I'll make something a bit more sleek (codewise).

    As I only have my own devices to use for reference material, I can't make it work with other devices. So if I can get some JSON-dumps of other setups, I'll make an output file which can handle those devices as well... At some point, when I've got a little more spare time... Otherwise, feel free to poke around the code and addapt it to your own needs...

    Posted

    Excelleent work. You may want to also check out our little program

    Please login or register to see this link.

    . I was thinking about the GUI and connectivity to HC2 for that when I found your post. Seems you have a big chunk already covered.

    I'll go check it out now. Thanks for sharing!

    Ronald

    --- UPDATE:

    WOW! This is fantastic. I've been fiddling with it and now got it all configured for my house. Thanks! Please post any further updates as you continue working on this!

    Posted

    For actual powerconsumption on a Aeon Labs Home Energy Meter DSB09104-ZWEU on info page, add this to infosprite.php

    Please login or register to see this code.

  • Topic Author
  • Posted
    For actual powerconsumption on a Aeon Labs Home Energy Meter DSB09104-ZWEU on info page, add this to infosprite.php

    Please login or register to see this code.

    Hi Jompa,

    Thanks for the update. I've included it in my master file so it will be included when I update the package...

    If anyone else has any additions or mods, feel free to post them, and I'll include as much functionality as posible.

    Posted

    Another function to show consumed power this month in marquee (scrolling line)

    Add this to marquee.php

    Please login or register to see this code.

    and this to same file

    Please login or register to see this code.

    Replace user + password + ip_to_hc2 + ID of power meter (17)

    Please login or register to see this attachment.

  • Topic Author
  • Posted

    Okay,

    So just a quick update on my progress, I'm trying to build my tablet interface right now. It will feature a temperature display in the top of the screen with the possibility to change the active room temperature (on danfoss valves) directly from the screen. It will eventually link in to window sensors for heating off while windows are open, and it will also link into my night mode system (more on that further down).

    Furthermore, it will have device and scene activation buttons for the active room.

    I have also received a shipment of Hue light bulbs. I am going to make a direct output interface to these so the HC2 won't be bothered with these (unless they are part of a scene of course) these will also be linked in to my night mode system. I'm hoping that there is a similar JSON-array available for the HUE lights to allow me to integrate these as well into the interface as all the z-wave components.

    Finally, I am looking at creating a night mode select on certain rooms. This night mode is supposed to be activated when you go to sleep at night. It will disable some of the motion sensors (so the light won't come on because you turn in your sleep), turn down the heat in the bedroom (i can't stand sleeping in a hot bedroom) and initiate a dimmed light mode, so that when either me or my girlfriend turns on our bedlamp at night to go to the bathroom or whatever, it will automatically turn on a light path, but at very low power to light your way, but not wake up the other one. It will be set up to work either on a timer or on a push basis to disable night mode when you wake up. (heating will always come on at 05:00 in the morning). It will also turn off consumers in the rest of the house to reduce st.by consumption and it will be configureable so that it can be set up to deactivate automatically if certain motion sensors are activated or a smoke alarm sounds (in which case all lights will be turned to their full setting).

    As soon as I have a working beta, I'll upload it to you guys so you can fiddle around with it. It might take a few days though, as my girlfriend is getting jealous at my php-scripts for now

    Please login or register to see this image.

    /emoticons/default_icon_mrgreen.gif" alt=":mrgreen:" />

    *** EDIT ***

    Added a picture of the tablet mockup. The tablets are 800x480, so the picture is cropped a bit due to my iPad being 4:3 format.

    [ Added: 2014-02-12, 07:42 ]

    Quick update: got my Phillips HUE bulbs working and the tablet interface is well underway. A new version with tablet interface and HUE support will be uploaded within a few days.

    [ Added: 2014-02-16, 16:31 ]

    Hi guys,

    As promised, latest revision. I've included a "userinfo.php" file to fill in all your personal data (ip, username and password) the file also includes hue-activation. Change the hueenable variable to false to disable Philips hue support. Go to the settings tab to jump to the tablet interfaces. The main interaction will be through the tablet interface, so some of the functions here won't be reachable from the browser interface right now (maybe later).

    There might be some danish phrases hidden in there as I haven't ammended the data into english. I will once I have a final version (along with a proper installation guide and probably an entry in the general configuration forum - but it isn't really there yet).

    I have yet to implement the settings tab. It will eventually hold different options (i.e. standard on dim level, auto off for lighting and more).

    Anyway enjoy and feel free to ask questions or give suggestions for improvements. And if you do any modifications, I'd appreciate if you do it in separate php-files. Then I'll be happy to implement the modules into the code.

    Please login or register to see this attachment.

    • 2 weeks later...
    Posted

    Hi Dalle,

    I'm planning on installing old iPhones as room thermostats with a virtual device. Are you planning on adding support for those too? It's probably more complicated since devices can vary very much of course, from one label to something as extravagant as Robmac's Squeezebox plugin.

  • Topic Author
  • Posted

    Virtual device support is a bit more difficult as the json is somewhat more complex and the script need to be able to interprit all the different buttons and sliders. But as I have all my hue lamps set up as virtual devices with multiple buttons and sliders, I am trying to do something to add support...

    But if the virtual device simply has a temperature reading to transfer to your thermostats, I'll be happy to take a look at the json and see if I can extract the temp reading for the tablet interface... Shoulj be easy - but as i'm only receiving my thermostats today (hopefully) I have no support in there for those yet. But expect to have them included in the interface during the coming weekend.

    /Morten

    Posted

    Below is an example of one of my virtual thermostats. Still WIP, so I won't bother you with the code.

    As you say it's quite a lot of labels and buttons and stuff and with every little change in the device, the scripts wouldn't work anymore. I do however think that, especially since the virtual devices in the iPad are hard to reach and are plain ugly too, people will be very interested in VD-support in your script.

    Perhaps it can be solved by making an example or a tutorial of how we can can assign values or send button presses from the script to the HC2?

    Please login or register to see this attachment.

  • Topic Author
  • Posted

    My tablet interface includes a very simple +- setpoint modifier to change the preset room temperature. But I'm building a custom interface built on a scene or virtual device which then handles all the actual setpoints. It is going to include night, away, work, vacation etc. Modes. So it will be weekday based. I'm also looking at some server side scripting to handle everything to reduce the load on the HC2.

    So you'll be able to choose different time intervals for either rooms or the entire house, lower the temperature in the night, set it for an even lower temp during vacations and turn up the heat before you return from vacation.

    It will be device independant, so it will use the default temp sensor for the temp input and then it will locate all thermostatic valves in a certain room and apply the given setpoint for that room to them.

    I'll share the code once I have something working. Feel free to come up with suggestions or improvements.

    Posted

    Hmm, although this sounds like a very nice solution of course, you would rely on yet another device to handle parts of the heating. Although my Synology's have proven very reliable over the past years, it's always possible for it to fail due to a hardware crash or a faulty firmware update.

    Unless of course the heating schedule will still be handled in the HC2 and can work stand-alone, and only the modes are being controlled by the server. Then it would provide some very nice advantages, like being much more flexible in the amount of setpoints per day...

  • Topic Author
  • Posted

    To begin with, it will be handled by HC2 as I haven't set up a dedicated server yet (i'm using an old linux box which also performs several other tasks). So I will see how well the HC2 handles it and based on that i will decide whether to move to a proper server side solution. Because you are of course correct keep it simple, so fewer components are better. But i'm not sure that Lua is advanced enough to perform what I want.

    Posted
    Below is an example of one of my virtual thermostats. Still WIP, so I won't bother you with the code.

    I like to see how you coded your Virtual Thermostat. Did you posted it somewhere?

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