more G-Labs products

Author Topic: Philips Hue Remake  (Read 4790 times)

August 18, 2015, 06:58:37 PM
Read 4790 times

saue0

  • **
  • Information
  • Jr. Member
  • Posts: 40
Hi All,

I am new to HG, and Love It.
Here is a remake for the Philips Hue.

It autocreate the module for the Light and the Groups.
It may be a litle bugged.

Please Give me somme feedback.

Thanks

Edit: New version ....
« Last Edit: September 14, 2015, 06:27:42 PM by saue0 »

September 06, 2015, 03:53:21 AM
Reply #1

ebasta

  • *
  • Information
  • Newbie
  • Posts: 12
I am getting this error:

Runtime.Error = "CR: Invalid format."

September 08, 2015, 06:58:36 PM
Reply #2

saue0

  • **
  • Information
  • Jr. Member
  • Posts: 40
Can you gime me the moment at witch your getting this error ?

- On startup of the script (Creation of the virtual module)
- Every 10 second   (Refresh loop)
- On sending a command ?

This will help me finding the problem.

I have a system with 6 light (3 Hue and 3 Hue Lux)
and have 3 Groups.

September 08, 2015, 07:41:47 PM
Reply #3

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
Quote
Runtime.Error = "CR: Invalid format."

just guessing: perhaps different firmware version could give different output from what the app is expecting.

g.

September 09, 2015, 02:14:58 AM
Reply #4

ebasta

  • *
  • Information
  • Newbie
  • Posts: 12
It happens as soon as I try to activate the program.  If fails loading and gives the error. I cannot load the program at all. I have updated the hub to the latest Philips pushed firmware - if that helps.

« Last Edit: September 09, 2015, 03:00:22 AM by ebasta »

September 09, 2015, 07:08:11 PM
Reply #5

saue0

  • **
  • Information
  • Jr. Member
  • Posts: 40
Here is a new version with some log info.
please retry it and attach the log file.

September 09, 2015, 08:05:22 PM
Reply #6

ebasta

  • *
  • Information
  • Newbie
  • Posts: 12
Attached is the recent part of the log where I attempted to run.  I hope this helps.

September 09, 2015, 09:04:38 PM
Reply #7

saue0

  • **
  • Information
  • Jr. Member
  • Posts: 40
Have you setup your bridge IP and User ?
The first thing i do is call the brigde to get the light config. and it seem not to be done

Why is this line not complete in the log ?
"2015-09-09T17:57:39.5577150+00:00   HomeAutomation.HomeGenie.Automation   1000   Automation Program   Program.Notification   {""Title"":""MyPhilipsHue """

It is missing "API Call"  [ Program.Notify("MyPhilipsHue ", "API Call"); ]

September 09, 2015, 10:01:05 PM
Reply #8

ebasta

  • *
  • Information
  • Newbie
  • Posts: 12
Yes - I've set up and tested (via the api) the validity of the user and the IP.  All seems to be good.   I don't know why that part of the log is truncated.  I'll delete and reinstall and try again.

September 10, 2015, 03:09:55 AM
Reply #9

saue0

  • **
  • Information
  • Jr. Member
  • Posts: 40
I did a change, pleare retry

I also included an exemple of ly log file.

September 12, 2015, 06:15:31 AM
Reply #10

saue0

  • **
  • Information
  • Jr. Member
  • Posts: 40
Problem solve,
  I reinstall on a new PI 2 and I had the same problem.
     Level and ColorHSB were not initialise on the first creation of the virtual module.

On my window system, the VM where there with valid data. so no bug.

Please retry , and use the new widget as well

September 15, 2015, 09:20:37 PM
Reply #11

gustavo

  • *
  • Information
  • Newbie
  • Posts: 13
saue0,

Very cool module.  After your latest update, I'm not seeing the runtime errors either.

It looks like you have code to tell different light types?  E.g. it looks like it can tell the difference between my hue color, and my non-color lights (I'm using GE Link bulbs, but I think for all intents and purposes they are identical to luxe).

It appears, however, that my Hue Bloom bulbs are being detected as non-color bulbs ?

------------ EDIT -----------------
Looking here:

        if (ltype.Equals("Extended color light"))
            Program.AddVirtualModule(MODULES_DOMAIN, idx.ToString(), "Dimmer", MODULES_WIDGET);

Philips Hue Bloom: "Color light"
GE Link Bulbs: "Dimmable light"
Philips Hue Bulb: "Extended color light"

So I think the if state should be:
if ((ltype.Equals("Color light")) || (ltype.Equals("Extended color light")))

« Last Edit: September 15, 2015, 09:32:57 PM by gustavo »

September 17, 2015, 06:43:41 AM
Reply #12

ebasta

  • *
  • Information
  • Newbie
  • Posts: 12
The runtime errors are gone - however I cannot get a color selector on android client

September 17, 2015, 03:10:44 PM
Reply #13

saue0

  • **
  • Information
  • Jr. Member
  • Posts: 40
gustavo, yes this is correck to support the other type.
I only have 2 types at the moment. If you know other type, i will add them as well,
Or is there an oderway of finding out if the light support colors ?

ebasta, change this line in the code ,
const string MODULES_WIDGET = "erx/philips/hue";
To "homegenie/generic/colorlight";
This will replace the widget with te original one, but you will loose the new buttons.

The android application do not know wat to do whit my widget.

September 18, 2015, 02:27:37 PM
Reply #14

saue0

  • **
  • Information
  • Jr. Member
  • Posts: 40
I Have a small question, 

Is the widget stats save somewhere ?
Because when a restart the software, some widget do not keep the last state they had