Help with milight

Hi there.
I’m still having a problem with my milight.
It is in the network an i can control my rgb-controller via milight app. But i can’t control it via openHab :frowning:

Here is my config:
openhab.cfg:
milight:milight.host=192.168.1.160
milight:milight.port=8899

items:
Color Licht_WoZi_farbe (gTE) {milight=“milight;5;rgb”}

But no reaction to commands. In the log i see:
2015-08-18 20:48:26 - Licht_WoZi_farbe received command 120,34.90196078431372,100

Maybe someone can help?

As far as I Understand the Color picker this required the light already be ON and just changes the color. From the syntax everything looks fine.

It is already on

Similar situation here, seem that I’m missing something basic. Nothing is sent/received on neither IP addresses according to packet capture on the router. Can somebody suggest how to troubleshoot?

in openhab.cfg:

milight:hameleons0.host=192.168.1.30
milight:hameleons0.port=8899

in items:

Switch Light_FG_Living_Sofa_Switch      "Pie dīvāna"    (GF_Living, Lights)           {milight="hameleons0;8"}

Hi,
Please start openhab in debug mode after adding an according entry to logback_debug.
Post the log entries given by milight binding together with some more information about your system:
OS of openhab server, java version, milight bridge version, type of led you want to control.

Best
Hans-Jörg

An “according entry” to logback_debug.xml might look like the following, put it before the closing tag:

    <appender name="MILIGHTFILE"
            class="ch.qos.logback.core.rolling.RollingFileAppender">
            <file>${openhab.logdir:-userdata/logs}/milight.log</file>
            <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
                    <!-- weekly rollover and archiving -->
                    <fileNamePattern>${openhab.logdir:-userdata/logs}/milight-%d{yyyy-ww}.log.gz</fileNamePattern>

                    <!-- maximum number of archive files to keep -->
                    <maxHistory>26</maxHistory>
            </rollingPolicy>
            <encoder>
                    <pattern>%d{yyyy-MM-dd HH:mm:ss} - %msg%n</pattern>
            </encoder>
    </appender>

    <logger name="org.openhab.binding.milight" level="DEBUG">
            <appender-ref ref="MILIGHTFILE" />
    </logger>

Hi,
adding logger name=“org.openhab.binding.milight” level=“DEBUG” to logback_debug would be enough, but your solution makes it easier to just post the milight entries.

Thanks hakan

Thanks guys for helping to start the debug!

According to the log, milight binding thinks it sends out packets. IP address is right, port is right. Partial extract from the log:

2015-09-14 20:31:26.190 [DEBUG] [.o.b.m.internal.MilightBinding] - milight: item is of type brightness
2015-09-14 20:31:26.197 [DEBUG] [.o.b.m.internal.MilightBinding] - milight: sendOn
2015-09-14 20:31:26.204 [DEBUG] [.o.b.m.internal.MilightBinding] - milight: messageBytes to transform: '35:00:55'
2015-09-14 20:31:26.216 [DEBUG] [.o.b.m.internal.MilightBinding] - Sent packet '35:00:55' to bridge 'hameleons0' (192.168.1.30:8899)
2015-09-14 20:33:40.509 [DEBUG] [.o.b.m.internal.MilightBinding] - milight: item is of type brightness
2015-09-14 20:33:40.519 [DEBUG] [.o.b.m.internal.MilightBinding] - milight: sendOff
2015-09-14 20:33:40.529 [DEBUG] [.o.b.m.internal.MilightBinding] - milight: sendDecrease
2015-09-14 20:33:40.540 [DEBUG] [.o.b.m.internal.MilightBinding] - milight: Bulb '0' getting decreased to '91'
2015-09-14 20:33:40.547 [DEBUG] [.o.b.m.internal.MilightBinding] - milight: messageBytes to transform: '34:00:55'
2015-09-14 20:33:40.557 [DEBUG] [.o.b.m.internal.MilightBinding] - Sent packet '34:00:55' to bridge 'hameleons0' (192.168.1.30:8899)

Now I have some more info to process, like why item is said of type brightness while it is defined as on/off switch and what bulb number ‘0’ is actually meaning.

Additional info about my config:
OpenHAB v1.7.1 runs on Ubuntu v15.04 (upgraded from 14.04) on Raspberry Pi 2. So far I have successfully set up and running for a month or so a few things based on Arduino based mysensors.org via serial binding. Milight was intended as a next step.

Java:

openjdk version "1.8.0_45-internal"
OpenJDK Runtime Environment (build 1.8.0_45-internal-b14)
OpenJDK Zero VM (build 25.45-b02, interpreted mode)

Milight bridge is v3, to my best knowledge. At least pics seem the same and bridge initial config instructions of v3 worked. Bought it this year from China, iPhone app works with it, both Milight app and LimitlessLED app. I’d be glad to have a hint how to be sure about the version, as I know that port number changed from v2 to v3. I tried with both port values just out of curiosity, none worked.

What I’m trying to achieve is to control a few Milight RGBW bulbs and couple of RGB LED strip controllers I have working for a few months in my home. Initial config I’m trying to get working is for one group of 2 RGBW bulbs. Control with Milight remote and by iPhone app(s) works.

For me the next step now will be playing around in order to see what happens in logs when I change OpenHAB configuration around the Milight item. Probably I’ll try package capture on my WiFi router as currently I have tried it just on my internet router LAN port where almost nothing happens, except for when Milight tries to communicate to outside world.

Any more ideas would be appreciated.

Veiksmi,
Jānis

Bulb ‘0’ in the log says that your item is configured for channel/bulb ‘0’ which means all white led bulbs.
The different channels are well explained in the WIKi.

What I just saw is that ure are using OpenJDK, which is not the best solution.
The recommended JRE/JDK is Oracle Java. There are many error reporterted in the group/forum when using a different JRE.

It would be helpfull if you could post your item’s definition and let us know, what type of led bulb you would like to control.

Best
Hans-Jörg

Yes, I have read the Wiki, I know about channel numbers. Thanks for acknowledging that this is channel number indeed. I experimented with channel numbers previously and 0 channel was where I stopped by then.

Strange thing happened yesterday. After a few restarts of the OpenHAB service and when I changed channel number back to channel of exact bulb (group) number, Milight started to work suddenly.

Good that now I know that it can work, bad that I have no real clue what happened. Seem that need to experiment some more.

Either this was some network issue (I’m rebuilding my WiFi in parallel) or Java issue as you are pointing to. I could try to change Java, because there were Java crashes in the log previously and still are (related to Charts I can’t get working). It’s just close to impossible for me to know what those Java log entries mean, except that usually the log entry right before Java output starts seem to show where the problem should have happened.

I’ll post my config a bit later.

Veiksmi,
Jānis

Thanks again for suggestions. I’m posting this just to let you know that I have generally achieved what I wanted to do. I can control my bulbs for more than a month already.

Couple of conclusions.

First, change of Java made my system much more stable generally.

Second, a stable WiFi networking is essential. Mine is not so stable, strange overloads happen I haven’t managed to get to causes to, so I experience commands not reaching bulbs on quite regular basis.

hey there, i have the same problem now.

running openhab on my rpi2 and my milight dont receive any commands.
How can i see what openhab is sending to the bridge?

in my case, im using e27 rgbw bulbs 9W wit item command:

Switch Light_EG_Daniel_Table “Table” (EG_Daniel, Lights) {milight=“bridge1;1;whiteMode”}

Hi Daniel,
the rgbw bulbs are to be controlled with channel 6 to 10, as I wrote in the WIKI. Channel 1 is for white bulbs only.

Best
Hans-Jörg

I have just set up my new milight bridge and have a question regarding channels.
In the wiki channel 5 is mentioned to control all RGB bulbs. But which channel should I use to control just zone1 with rgb? If I use channel 7 (which according to the wiki is zone1 for RGBW) I get strange behaviour. Is there a channel for zone1 RGB?

Background: I have two controller for RGB stripes I want the use for 2 different zones.

Anybody else using these RGB strip controllers? Which items you use for them?
Hope somebody can help. Thanks in advance.

The Binding was never meant to be used with RGB stripes.
RGB bulbs did only have one group so just one channel was used.
As there is a oh2 binding in place, you could ask your feature request there. I will not add any new features to the oh1 version.

Ok, thanks for your answer.
That’s what I suspected. So I have to find a different solution.

Hi,
I have to bring this up again.

I’ve got the binding working for a rgb on channel 5 now. But after I updated my installation form OH 1.7.1 to 1.8.3 changing the brightness doesn’t work any more. There is no error and the log shows that the new hsv value was sent to milight, but the brightness doesn’t change. By replacing just the milight binding in the addons folder with version 1.7.1 everything works well.

Can anyone else confirm this behaviour?

No, I can not.
Please give us some more information about your system (hw/os/java version) and post your debug logfiles of both openhab versions.

Hi,
I’m using milight rgb strips with the rgb controller on address 1 with the following config:

Color Milight_Licht1 "Milight Licht" (G1OG_Esszimmer, AG_Lichter1OG) {milight="bridge1;7;rgb"}
Dimmer Milight_Licht1B "Milight Licht Brightness" (G1OG_Esszimmer, AG_Lichter1OG) {milight="bridge1;7"}

Thats fine, but what do you want to tell us?