EspMilightHub new binding for milight limitlessLED and easybulb

@aart Glad you like the binding. The issue you are reporting is actually a feature called “POWERFAILS_TO_MINDIM” and can be turned on and off. My guess is yours is set to on for this feature and it is very handy to stop the lights coming back on whilst you are sleeping due to the power failing for a short period and then coming back on.

I doubt this binding will ever be built into openhab as another milight binding exists that works with the OEM bridge, it would only confuse users. Since the builds are not very close it may be time to add this to the marketplace.

1 Like

Yes, I can turn on and off that feature, but the behavior is the same in both settings.
Im running the latest build: 10-11-2018

Hello! I still do not use the binding, there is no time to do it, but I follow the topic from the very beginning. I am very upset that you are not going to make it the official binding of openhab. I think that it is necessary to make it official binding, just think about its name so that there is no confusion.

@aart
New build 13-11-2018 is now available and should have this bug fixed hopefully, thanks for reporting it.

Hi everybody

Thanks for all who contributed to this great project!

I have a question in regards of all the different items. Is there somewhere a documentation which items are available? I unsuccessfully tried to find it.

I’m asking that, because I miss the “White” switch which is available on the MiLight Hub web interface. I also would like to map it to my sitemap. Can I do that somehow?

And another question I have, is it somehow possible to switch light on and off just with a URL directly to the web interface of the MiLightHub? Reason for that is, because with my main home automation tool (digitalstrom) I’m only able to call an URL. And it would be great being able to control the milight like that.

Thanks for your help!

First of all, thanks for this great binding. It was very easy to setup. There is only 1 thing I haven’t figured out yet:

I’m trying to adjust the color through a rule. I use this code in my rule:

Milight_ID0x2_G1_Cmd.sendCommand("100,356,100")
Milight_ID0x2_G1_SndCmd.sendCommand(ON)

My items:

Switch Milight_ID0x2_G1_State     "Light On/Off"           {channel="espmilighthub:rgb_cct:Auto001:0x21:level"}
Dimmer Milight_ID0x2_G1_Level     "0x005"                  {channel="espmilighthub:rgb_cct:Auto001:0x21:level"}
Dimmer Milight_ID0x2_G1_CTemp     "White Color Temp"       {channel="espmilighthub:rgb_cct:Auto001:0x21:colourtemperature"}
Color  Milight_ID0x2_G1_Hue    "Color" ["Lighting"]        {channel="espmilighthub:rgb_cct:Auto001:0x21:colour"}
Number Milight_ID0x2_G1_Mode    "Discomode"                {channel="espmilighthub:rgb_cct:Auto001:0x21:discomode"}
String Milight_ID0x2_G1_Cmd 	    "Command to Send"      {channel="espmilighthub:rgb_cct:Auto001:0x21:bulbcommand"}
Switch Milight_ID0x2_G1_SndCmd    "Send Command" 		   {channel="espmilighthub:rgb_cct:Auto001:0x21:sendbulbcommand"}

When I set a color through the sitemap I see this in the log:

milight/commands/0x2/rgb_cct/1 {"state":"ON","level":100,"hue":2,"saturation":95}
milight/states/0x2/rgb_cct/1 {"state":"ON","level":100,"hue":1,"saturation":95,"bulb_mode":"color"}

When my rules gets executed:

milight/commands/0x2/rgb_cct/1 {"command":"100,100,356"}

What am I doing wrong?

EDIT: OK, after a good night sleep and reading through the topic from the previous version of this binding, I think the command should be more like this:

`Milight_ID0x2_G1_Cmd.sendCommand('{"state":"ON","level":100,"hue":1,"saturation":5,"bulb_mode":"color"}')`

Logs:

milight/commands/0x2/rgb_cct/1 {"command":"{"state":"ON","level":100,"hue":1,"saturation":5,"bulb_mode":"color"}"}
milight/commands/0x2/rgb_cct/1 {"command":"{"state":"ON","level":100,"hue":1,"saturation":5,"bulb_mode":"color"}"}

How do I send only the state to an item instead of a command with the state??

Trying to (partially) reply if I correctly understand your points

About “different Item”, I think you misunderstand and they are Channels instead of what you are looking for
Channels are visible from whitin the Thing definition inside Openhab when discovered starting this from the binde wich is the scope of this Thread discussing about
Anyway, there’s a SET_WHITE command you can send from the sendBulbcommand

About url, you can send url with REST protocol (This bind is MQTT based) and documentation is available on the right side of the Milight Hub descritption indicated at the top of this thread http://blog.christophermullins.com/2017/02/11/milight-wifi-gateway-emulator-on-an-esp8266/248 and https://github.com/sidoh/esp8266_milight_hub/

Thank you very much for your help.

Sorry, if i was not clear enough.

What I’m looking for is a switch which enables me to select the white mode. And from what I understood you normally do that in the items file if you configure manually. Didn’t know this are called channels. But thanks for the hint.

But how can I now map the SET_White Command to a switch? Is this somehow possible?

In regards of the URL, I tried to go through the documentation you sent. But I have my difficulties to understand how I can translate this into a URL I need. I tied with : http://192.168.1.10/gateways/0x2987/1/{"status": "on", "hue":0}. I get the response: unknow device type.

Sorry, I’m quite new to all this and I try to learn.

Thanks again for your help.

There is two ways to trigger white mode off top of my head from a switch.

  1. Create a virtual switch and use a rule to send the hue that trips white mode. You send the colour using the hue channel.

  2. The binding allows you to specify the default command that gets sent if nothing is selected. Set the defualt to be white mode using this to set the bridge setting called “DEFAULT_COMMAND”. Then use a switch to send the command. The very first post in this thread has examples to get the switch running and by default it will probably trip the night mode, leaving you to work out how to use that setting to change the default behaviour.

this binding is floating my logs few times a second

That log
Output is not from this binding but from the official milight binding. This thread is for the espmilighthub which is an open source hub you build and use instead of the milight hub.

sorry, i did not know
with this hub there is no such problems ?

also, how hard is it ? i’m new to openhab and not a programmer
thanks

Never had that problem with the open source hub and this binding. It uses mqtt which is known for being robust on bad networks.

It it very easy to program and you do not need to solder. Read the blog on how to setup the hardware hub.

hi, fightting with Milight RGBW to switch to white in rules. Using text files config.

I tried add RGBW_WHITEMODE_SAT_THRESHOLD=12 and send command

Bulb_hue.sendCommand(“12,0,100”) - it makes some mix white color (hue is colour channel)

I tried set hue to 36 or sat to 32 as i see in PaperUI EspMilightHub detail

Bulb_hue.sendCommand(“36,0,100”)
Bulb_hue.sendCommand(“100,32,100”) - again make some color but not white (hue is colour channel)

So what I am doing wrong? It would be too much create command and send command channel for each bulb and set white over set_white cmd …

Btw I dont understant this:

When i open milightESP bridge in PaperUI for editing, I dont see this constants and description. Just some other parameters like “The HUE value that Google home or Echo can use to turn globes back to true white.” but not parameters added over think file …

FAVOURITE_WHITE
DELAY_BETWEEN_MQTT
DELAY_BETWEEN_SAME_GLOBE
TRIGGER_WHITE_SAT
TRIGGER_WHITE_HUE
DEFAULT_COMMAND
1TRIGGERS_NIGHT_MODE
RGBW_WHITEMODE_SAT_THRESHOLD
POWERFAILS_TO_MINDIM
AUTOCTEMP_MAXDIMMED_TEMPERATURE

By looking in PaperUI at your bridge (click on the pencil icon) you will get descriptions on what these do and what valid ranges are. If you use manual text configuration you can not change them in paperUI otherwise you get a conflict message in paperUI.

Thnx

@CoolTom

The saturation is the middle number in Openhabs HSB and try 1 value under the threshold. Try this for example. Note this only works for RGBW globes and not the newer rgb-cct types.

Bulb_hue.sendCommand("40,11,100") 

If you try and trigger the google home method to switch to white try this command. This should work for newer and older globes.

Bulb_hue.sendCommand("36,32,100")

You don’t need to create both a select command control and a send command control if you globally change the binding to send the white mode using the DEFAULT_COMMAND control. You would only need to then create a single button and bind it to the send command channel as it would then send the white command by default. By default the night mode command is sent.

Thank you Matt! I endup with adding channel “colourtemperature” in espmilighthub.items for all bulbs (same like add one channel “sendbulbcommand”) and I send any number between 1-100 (as they are RGBW - it will be still same cold white).

espmilighthub.items

Dimmer Bulb_wt "bulb 01 WT" <light> {channel="espmilighthub:rgb_cct:001:0xXXXXY:colourtemperature"}

*.rules

Bulb_wt.sendCommand("100") - wt is colourtemperature channel

And it works.

Thank you

Can anyone please either show me som example on how to turn Milight RGBW bulb
to all white agin after colour ,please show some ithems and sitemaps so i can make it
work ,i am no coder ,but i have o/off and colour working in my 3 kids rooms thats nice , mabye show the disco mode rule,sitemap and item please so we dont have to use the remote to turn on
modes and to white agin

lots of exampels to us none coders helps a lot , thanks a lot :wink:

See the last few posts and that is exactly what they were about. For examples on sitemap and item setup see the very first two posts of this thread. All you are wanting to do is pretty simple, just see what channel/control needs to move to achieve your result and then use the item.sendCommand() in a rule to automate the control.

I need to transfer all the info from the first two posts and other info into a readme file for the github project, if anyone has time and can do this and do a PR that would be great and I will proof read it. After doing the readme and adding some further examples I will look at adding this binding to the marketplace.

1 Like

I will give it a go this week

1 Like

Hello,

This is probably a stupid question (i’m a complete noob) but if it isn’t nessecairy to install a seperate mqtt binding in openhab because the new milight binding uses paho library, where can i configure the mqtt broker? My problem is openhab will not connect to broker.

Thanks