Milight bulb on ESP8266 help needed with integration

Hi everyone, Have been puzzling for a while and can’t figure it out. What I would like is to add my Milight lamps to HA. This via an esp8266 board. It works perfectly via the ip address in the web browsers but cannot get it done in HA.
Can someone explain to me how I apply a REST API and what it looks like?
What I have done so far: added lamps with a Mi-Boxer, if I put this ip address in HA in light.yaml as below it works fine, I can control the lamp.

- platform: limitlessled
  bridges:
  - host: 192.168.1.113
    groups:
    - number: 1
      type: rgbww
      name: testlamp

but when I add the ip-address of the esp8266 to light.yaml then I cannot operate the lamp (other lamp of course) but via the web-ui

- platform: limitlessled
  bridges:
  - host: 192.168.1.118
    groups:
    - number: 0x5555
      type: rgbww
      name: Test werkkamer
      fade: false

whatever I try, I can’t.
am almost tempted to replace all lamps with Zigbee lamps, but they do not have a nice wall switch like the milight wall-switch

any help is appreciated!

Thanks
bas

Hi @Bastiaan1977,

In order to use the Limitless component with ESPMH you need to define an UDP gateway and used that port in HA configuration. For Group number you need to use 1 to 4 (for FUT092) or 1 to 8 (for FUT089), not the device ID.

However, if you use an ESPMH then Chris has already posted config for MQTT json schema, which is far superior to the UDP gateway.

I can’t confirm if this is Zigbee or not, but I think it is quite similar to Milight’s T4/B4

@Petrica, thank you for your reply.
I followed chris description but can’t get the lights to work via mqtt. As I understand it now you use either the UDP settings or the MQTT. Can you leave the fields of UDP empty?
@sidoh , Chris thanks you for your replay on GitHub. I asked you to help me through teamviewer but that is actually not wanted on a forum. The power of a community is that everyone can learn from it. I apologize.
my question remains ‘open’. what I have now achieved is that I see the lamp in HA, I can even adjust the colours . But unfortunately the lamp does not respond to these commands. I can see in the log of the MQTT add-on (
what i have don this far, this is my lights.yaml

- name: "testlamp"
  command_topic: "milight/commands/0x22B/rgbw_cct/1"
  state_topic: "milight/states/0x22B/rgb_cct/1"
  <<: &MILIGHT_PARAMS
    platform: mqtt
    schema: json
    rgb: true
    brightness: true
    availability_topic: milight/client_status
    payload_available: 'connected'
    payload_not_available: 'disconnected'

in configuration yaml:

mqtt:
  broker: 192.168.1.101:1883
  discovery: true
  discovery_prefix: homeassistent

and my settings in espMH: (nothing in UDP settings!)

I don’t know what I’m doing wrong but now at least can see my “testlamp” bulb but it says 'unavailable"

Can anyone help me please?
Thanks in advance

I can’t really much help you with autodiscovery as I set all my lights manually, however there are a few problems with your setup:

  • discovery_prefix in ESPMH should be homeassistent not homeassistant (if you set it correctly in HA, I don’t know if it is correct in German :slight_smile:)
  • with manual settings command_topic in HA should be milight/0x22B/rgb_cct/1 (there is no “commands” in ESPMH topic and type should be rgb_cct not rgbw_cct).

Just a little tip that helps me, when I’m working with MQTT:


With it you can see where every state is posted.

@Syntox, thanks for the tip, I Had already install this on Windows pc but not yet looked into it. I will

@Petrica, thanks for helping me, I have made the changes witch you gave me but unfortunately no good result.

There has to be a typo somewhere… Could post again printscreens from ESPMH and HA?

Have you restarted Home Assistant?

Also, you don’t need these lines in HA (they refer to hub availability, not individual lights):

availability_topic: milight/client_status
payload_available: 'connected'
payload_not_available: 'disconnected'

Here are my settings on espMH:



My settings on HA:
in confirguration yaml:

mqtt:
  broker: 192.168.1.101:1883
  discovery: true
  discovery_prefix: homeassistent

in lights.yaml:

- platform: mqtt
  schema: json
  name: "testlamp"
  state_topic: "milight/states/0x22B/rgbw_cct/1"
  command_topic: "milight/0x22B/rgbw_cct/1"
  rgb: true
  brightness: true

Thanks in advance!

I’d bet this is the issue, but I was wrong before :slight_smile: . Should be:

  state_topic: "milight/states/0x22B/rgb_cct/1"
  command_topic: "milight/0x22B/rgb_cct/1"

Sorry, now cure.
I did try your solution. And even an other, rgbw without the _cct.
But both are not working…

rgb_cct command would not work on a rgbw only bulb.

Can you control the light from the ESPMH?

Yes I can control it perfectly.

One more thing: since you named both lights (the autoconfigured one and the manual light) as “testlamp”, can you check the Developer menu for all lights case they got renamed?

I don’t understand what you mean by that. Could you please explain me?

In the filter field look for light

Yes I can see this light there :

But when I toggle this button to on then within few seconds the toggle is going back to off.

Sorry, but at this time I can only advice naming your manual light to something different from what you have at the moment. Unless you made changes that you did not posted, check the following and name it to something very different:

name: "testlamp"

Then check again that you did not entered any illegal characters.

You said manually and automatically. Does it helps if I delete the automatic one?
So I delete in configuration yaml:
discovery: true
discovery_prefix: homeassistent

And in the espMH
‘homeassistent’ at discovery_prefix

This might affect your other integrations, so use it wisely.

This one is ok to remove from ESPMH.

Just try to check everything in ESPMH matches HA.

Correct me if I am wrong but I don’t have to specify any udp ports because I thought that this was necessary if I use esp8266 with mqtt.