I just noticed the same thing (adding to group 2 and it didn´t work to change) I then selected group “all” and it started to work.
I could after this select group 2 again and it started to work as expected. Don´t know if this was just a coincidence though.
BTW, how do you add more groups than the default 4?
No luck I try all the suggestion, I also try RGB but not working, When I first power this thing ON it work then it rebooted and I had to add it again and it never works after. Are there no logs?
The logs are printed to a serial terminal. You can enable verbose logging by compiling the firmware with the DEBUG_PRINTF flag. It sounds like either you’re using a different RF config (RGB, RGBW, etc.) or your NRF is faulty or has loose connections. My setup’s stability improved dramatically when I switched to soldered connections.
You can set the device ID to whatever you want. You can only have four groups for a single device ID. That’s unfortunately a limitation of the underlying RF protocol.
Ah ok! Then maybe I misunderstood the feature with multiple groups.
So far I have only spoofed my old bridge which has 4 groups with 3 lights each.
This seems to work Ok but I would like to control each bulb separately, ie create 12 groups.
Certainly possible. Not exactly painless, but doable. You have to pair your bulbs with different device IDs. Pair bulbs 1-4 with groups 1-4 of device 0x0001, bulbs 5-8 with groups 1-4 of device 0x0002, etc.
Thank you for clarifying this.
Should then these new device id’s be added as I UDP Gateways with different ports so they can easily be included into HASS?
Alternatively, you can use a light.mqtt_json component. MQTT is more reliable because it’s over TCP, and since it’s over a pre-established connection, there’s not much of a latency cost. It’s also a little more intuitive because you don’t need to map device IDs to ports.
Hi! I’ve been using this for a couple of months now, it’s working perfectly. The only thing problem I encounter is this:
Whenever there is lack of electricity, when it comes back, NodeMCU won’t connect to the WiFi. I have to reconnect it manually. I don’t know where’s the problem, I guess that after the power goes on, the ESP is faster than the router, so it’s searching for a router to connect to, and it doesn’t exist (yet). Is there a way to change it in settings? Or add something in the code so that it waits a bit longer after being turned on?
Hey! I have a problem I can’t seem to fix. I can control the lights perfectly fine, but somehow my HASS refuses to update the state. it also shows the following errors:
Traceback (most recent call last):
File "uvloop/cbhandles.pyx", line 49, in uvloop.loop.Handle._run (uvloop/loop.c:48426)
File "/usr/lib/python3.6/site-packages/homeassistant/components/mqtt/__init__.py", line 232, in async_mqtt_topic_subscriber
hass.async_run_job(msg_callback, dp_topic, payload, dp_qos)
File "/usr/lib/python3.6/site-packages/homeassistant/core.py", line 253, in async_run_job
target(*args)
File "/usr/lib/python3.6/site-packages/homeassistant/components/light/mqtt_json.py", line 169, in state_received
if values['state'] == 'ON':
KeyError: 'state'
at the mqtt_topic_pattern I got: milight/command/:device_id/:device_type/:group_id
and at mqtt_update_topic_pattern: milight/updates/:device_id/:device_type/:group_id
There is no support in the light component for night mode however it can be easily done with a script (just use your own light id topic). Alternatively, the night mode could be setup as effect and then use an automation to forward it to the light (but is going to flicker when state changes). Do you need help for the setup?
Night mode is stateless thus it won’t publish it’s updates. As you are only trying to turn night mode on and off, the easiest way would be with a switch:
I have my lights setup as mqtt_json (except that there are FUT103 and FUT014 with rgb_cct profile) and it allows for all sort of magical things . However, when in night mode, the light shows as off thus, with automation I can include conditions that either light or the night mode (switch) for a specific light is on.
MiLight supports 9 effects however they are called “mode”. With the setup for the light included in the message above, the automation would be: automation
In automation/script the action part that calls for effects would be:
- service: light.turn_on
data_template:
entity_id: light.light_id
effect: any from 0 to 9
I use scripts (3 categories, for day, sunset and night) that are called from automations as the scenes do not allow for templating. This way, lights can be turned on with dimming and either white light (color temp) or color leds (providing separate r, g and b values).
Color names can be used (any color from CSS Color Module Level 3) with “color_name: xx”. I’ve made an input list with all of them (however some would resolve to white light) and use the option color_name: ‘{{ states.input_select.scenes_color_name.state}}’
Random colors can be used with rgb_color: [‘{{range(1,255)|random}}’, ‘{{range(1,255)|random}}’, ‘{{range(1,255)|random}}’]
MiLight platform doesn’t support transition but can be easily done with a script: