EspMilightHub new binding for milight limitlessLED and easybulb

@vzorglub
Currently the binding only has the IP of the broker and not the hub as it never speaks to the hub directly, only through MQTT. I would suggest you try doing the following which is a lot less work and should be already doable.

  1. Create a GLOBAL (STATIC?) variable in a rule file, something like this I have seen other doing it and my syntax may be off as I don’t have an VS code in front of me.
static var myString="http://192.168.1.168:80"
  1. Create a rule that uses that global var on openhab startup and sets a String item if you need to use it in a sitemap. Or if you only use the var inside the same rule file and not in a sitemap you can use the var directly. The var must be at the top of the file outside the rules which is what makes it a global var that any rule can use. It probably works fine as a local var if only 1 rule needs the string.

@devax
Yes 3 hubs probably makes more sense and my post was simplified over being 100% correct. Have to wait and see what the feature is when it gets added. I have 2 hubs built already just waiting on some spare time to finish it off as I also want multiple hubs in case 1 fails when I am not at home. Even if you only have 1 globe you get far better performance with the halogen emulation feature that I added to the binding. You see the globe change brightness and then colour with high RF repeats, you do the same thing with lower RF repeats and the globe works exactly how you imagine a halogen globe to change color as the brightness changes.

Hello everyone.

First of all, matt1 really appreciate your great effort to your project. I’m really amazed about work you’ve already done.

Ofc, I’ve setup ESP+NRF and openhab2 binding flawlessly. Everything works like a charm.
I can bind all 4 channels of my remote - all of them are discovered by openhab. But still don’t know how to bind openhab2 in “all” mode (by “all” mode I mean the mode you can switch by pressing top switch on remote). Maybe I missed something, if so then please let me know.

I understand I can use openhab2 grouping feature, to drive selected items, but by this way all actions are performed by separate messages. So is it possible to use it described way?

Yes it can be done if you use textual thing setup which is described in post number 2 of this thread.

Thing   rgbw 0xabc20 "Bathroom Mirror All"

The reason this is not supported by the discovery service is it appears that openhab is heading towards supporting automatic tags for alexa and googlehome. Then you have the case that extra commands get sent because more virtual globes get seen. Also I do not know if the controls in openhab will update correctly for the individual globes. I have not tested this in a while…

If the reason is the delay to switch multiple globes, search this thread about reducing the RF repeats as this is the key to really getting fast response from lots of globes. I use 27? globes around my house.

Thanks, matt1.
It seems it works for ‘0’ channel with textual config as you described.

I’ll try to play with that RF repeats settings as you suggested.

Matt thank you very match, I just setup 4 MR16 bulbs and two 1 meter CCT Led stripes and all things work fine.

1 Like

I got the parts together and went with the quality NFR board initially rather than the external aerial.

The speed is MUCH quicker than the mibridge hub thing. I’ve just used UDP at the moment, as I wanted to get it in place with Openhab without too much work.

But will look into MQTT as we do have someone who likes using the remote to turn the lights red for his playtime (fire apparently).

I received a new batch of Milight goodies recently and am having trouble with my new FUT092 remote.
I think my issue is due to my lack of understanding of how this should work so I’m looking for some guidance.

  • The remote successfully pairs to my bulbs and controls them correctly.
  • When I turn on traffic sniffing on the hub I can see the packets being received from my remote.
  • The Hub is correctly set up as I have other bulbs linked to it that are being controlled via this binding in OH.

I am watching the MQTT traffic with MQTT.fx and when I control a bulb from OH I see the expected MQTT messages.
When I control a bulb via the remote, I don’t see any MQTT messages but the bulb does react and I see the sniffed traffic on the hub.
When I control a bulb via the hub web interface, the bulb reacts but I don’t see any MQTT messages.

I think the problem may be something to do with the MQTT topics, but I think I have everything set up per the instructions:
image

Any ideas?

That is the remote that I use, so it will work.

Is “listen_repeats” set to 3? besides that I have no ideas and it may be two or more issues to find. Hopefully listen_repeats is one of them as that would explain the remote not getting passed back.

listen_repeats is set to 3

image

Am I correct in thinking there is no additional setup required on the ESP hub to get the remote commands relayed to MQTT?
i.e. You just insert batteries into the remote and start pushing buttons then messages appear on the MQTT bus? (Assuming the packets are detected by the hub as evident in the ‘sniff traffic’ window)

Correct, I setup two new hubs 2 months ago and it worked fine first go with firmware 1.7.0-dev5. Also it may be a bug in the firmware, since the hub never sends it to the MQTT broker it can not be a binding bug.
When you SNIFF does the remote show up as a cct_rgb type? Also the NRF radios are known to sometimes have reception issues due to a lot of them being fakes, does the sniffing only work close to the hub, try sniffing longer distances.

Sniffing shows remote as rgb_cct - I assume that is what you meant? :slight_smile:

rgb_cct packet received (9 bytes):
Raw packet: E6 BC C0 58 A6 7C 73 69 88 

Decoded:
Key      : E6
b1       : 20
ID       : 5546
Command  : 01
Argument : 04
Sequence : 8A
Group    : 04
Checksum : D8

Remote is working great from the other side of the house on a different floor, I was actually impressed that it worked from here but it’s very consistent.

Will try upgrading the firmware, looks like I am running v1.6.5.

Grabbed the latest off Github, v1.7.1 apparently.
Upgraded and it works, I now activity MQTT.fx when I press buttons on the remote!
Now on to configuring OH…

Thanks @matt1

Sorry, but I have to ask about this step
what does it exactly means the step below?:Which particular object is involved in the operation described below? The ESP HW ? A configuration section on OH? What is the Control Panel itself?

Before setting up Openhab2 the following is required to be setup:

> Enter the control panel for the ESP8266 by using any browser and entering the IP address

.
Set the following options:

mqtt_topic_pattern
milight/commands/:device_id/:device_type/:group_id
mqtt_state_topic_pattern
milight/states/:device_id/:device_type/:group_id

It’s there:

https://blog.christophermullins.com/2017/02/11/milight-wifi-gateway-emulator-on-an-esp8266/248/

From set-up firmware down

OK, find out what control panel was (bundle the domestic wi fi) adn entering IP to surfing the Web UI emulator

Only one and last question is, are these parameters to setup via OH or wherever else?

Really thank you
By the way, trying B0 controller and a few RGB-CCT spotlights, and normally intercepted by the sniffer on emulator firmware

You set these parameters in the ESPmilight controller control panel

See the link Vincent gave. The text quotes from there is…

Setup firmware

Note that you’ll have to do all of these things before you can use the UI, even if you used the pre-compiled firmware:

Connect the device to your WiFi. Once it’s booted, you should be able to see a WiFi network named “ESPXXXXXX”, where XXXXXX is a random identifier. Connect to this network and follow the configuration wizard that should come up. The password will be milightHub.
Find the IP address of the device. There are a bunch of ways to do this. I usually just look in my router’s client list. It should be listening on port 80, so you could use nmap or something.
You should now be able to navigate to http://<ip_of_isp>.

Sorry, I’m really a noob
Do we need somewhere to create MQTT Broker anyway?

Just install mosquitto

1 Like

Created an account just to say ‘amazing work’!

Spent the evening killing my two factory milight controllers. Now just the single ESP version (fits with the other 16 ESP devices also on MQTT around the house), really great work Matt!

I’d originally got your rule based MQTT version going before I found this thread and the verbosity in the rules I knew was going to be a headache once you had loads of lights - this binding works tremendously!