Mttq light triggers MQTT log, but doesn't show up - going nuts here! help please. #coronamakingmegonuts

OH MY GOD !!! IT WORKS NOW !!! IT FINALLY WORKS !!!

this has been so stressful for me, those last days, not being able to sleep because of this!

thank you Patrica and Taras ! thanks a million!

do you have a github page or something? how can I thank you?!

and it’s only now I understood that the config of the milight hub mqtt has to be “undefined” not specifying already which light id of course, because you want to be able to use multiple…

You’re welcome

1 Like

Two days ago, I suggested you remove the manually created sensor configuration and allow MQTT Discovery to create it automatically. Instructions were listed at the bottom of this post.

:man_shrugging:

Glad to hear it’s all clear to you now.

Sorry - I know this thread is quite old, but is it required to create yaml in HA per light? My light is being discovered, but unlike tasmota, it’s not working. The gateway is publishing the command and state topics, so I thought it would work without config.

If the light platform supports autodiscovery then you don’t need to manually create lights configuration. This topic is about MiLight lights. Are you trying to control the lights with NRF24L01 on NodeMCU or through the native gateway for which the component is LimitlessLed in HA? (I ask as I see you also mentioned Tasmota)

Kindly include more details about your setup.

I have the NodeMCU - and just got it working. My problem was I entered a “Device ID” into the gateway hub, but don’t have an existing gateway. Once I removed that, then the mqtt messages were going and receiving on the right topic. It’s working fine without any config in home assistant.

Are you able to control the lights through the webpage of the NodeMCU flashed with the ESPMH firmware when you use the defined device ID?

I don’t understand this part. Do you want to say that you only have the NodeMCU gateway flashed as mentioned above but no native MiLight gateway? If this is the case then don’t worry as you don’t need a native gateway.

Correct. I’ve found some MR16 MiLights which I’m going to install outside. I’m going to install quite a few and they are half the price of the zigbee rgb_cct bulbs. Anyway, in the setup, I had assigned my hub a deviceid, which is where I went wrong. Just having the devices paired is all I need.

I did a subscribe on the mosquitto and saw the difference between toggling the light in HA (which did nothing) and toggling it on the gateway (which worked).

What have you configured in Settings->MQTT on the gateway for the command and state topics?

MQTT topic pattern: milight/commands/:device_id/:device_type/:group_id
MQTT update topic pattern:
MQTT state topic pattern: milight/state/:device_id/:device_type/:group_id
MQTT Client Status Topic: milight/hub0/LWT
HomeAssistant MQTT Discovery Prefix: homeassistant

All communication is on device 0x0 (not 0x1 like I first configured), and my one light is /1.

mosquitto_sub -v -h mqtt.home -p 1883 -t '#' | grep milight
homeassistant/light/milight_hub_14987443/rgb_cct_0x0_1/config {"schema":"json","name":"tree1","command_topic":"milight/commands/0x0/rgb_cct/1","state_topic":"milight/state/0x0/rgb_cct/1","uniq_id":"E4B0B3-tree1","device":{"manufacturer":"esp8266_milight_hub","sw_version":"1.10.7","identifiers":[14987443,0,"rgb_cct",1]},"brightness":true,"effect":true,"effect_list":["night_mode","white_mode","0","1","2","3","4","5","6","7","8"],"rgb":true,"color_temp":true}
milight/hub0/LWT {"status":"connected","firmware":"milight-hub","version":"1.10.7","ip_address":"192.168.254.231","reset_reason":"Software/System restart"}
milight/state/0x0/rgb_cct/1 {"state":"OFF","brightness":94,"color_temp":244,"bulb_mode":"white","color":{"r":255,"g":255,"b":255}}

I don’t understand this part. In the webpage of the ESPMH are you using 0x0 or 0x1 to control the light?

Although I have the lights set manually, your config looks fine and should work (although I’m unsure about the device ID 0x0; I think there was a post that is not valid but I could be mistaken).

It’s working fine, and zero config in HA. Initially, I put 0x1 in DeviceID, which cause a mismatch in the MQTT topics.

Could you compare MQTT payloads when you try to turn on the light from HA vs. the ones pushed by ESPMH when using the webpage?