Closed huongminh closed 5 years ago
I am using milight hub version 1.8.5 and the latest hue emulator version. when I tried to make a clean installation of hue emulator on my second Pi hardware and added milight bulbs. Now, when setting color, now bulb would glow. While on the current production version, bulbs are glowing as described above. I have 20 real philip hue bulbs connected via the hue emulator as they all work normally. So it seems the issues are with milight bulbs only.
Hi,
One year ago i was forced to create a change with no automatic config fix. Hue introduces a logical sensor (sensor ID 1 for daylight). It seams your config is very old and don't have this.
For next error:
lights[light]["state"]["hue"] = light_data["hue"] * 180
KeyError: 'hue'
hue key seams to miss from the light. I believe i need to change this to get the rgb data and convert it to xy or hue/sat.
Thank you for quick response! Can you tell me how to update my config? I keep rerun the automatic installation script but as you said it would not update the config
Sent from Yahoo Mail for iPhone
On Tuesday, April 16, 2019, 6:13 PM, Motea Marius notifications@github.com wrote:
Hi,
One year ago i was forced to create a change with no automatic config fix. Hue introduces a logical sensor (sensor ID 1 for daylight). It seams your config is very old and don't have this.
For next error: lights[light]["state"]["hue"] = light_data["hue"] * 180 KeyError: 'hue'
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
do you have something under "sensors" in config.json file?
This is part of my config.json (I had to cut some part since too long to post)
this is the sensor part I find: "sensors": { "available": 63, "clip": { "available": 63 }, "zgp": { "available": 63 }, "zll": { "available": 63 }
Not in capabilities, check and the end of the file.
At the end of the file there is a “sensor” as well as seen in the file I sent. There is no value next to it.
Sent from Yahoo Mail for iPhone
On Tuesday, April 16, 2019, 8:29 PM, Motea Marius notifications@github.com wrote:
Not in capabilities, check and the end of the file.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.
add this sensor "1" in sensors:
"sensors":{
"1":{
"state":{
"daylight":null,
"lastupdated":"none"
},
"config":{
"on":true,
"configured":false,
"sunriseoffset":30,
"sunsetoffset":-30
},
"name":"Daylight",
"type":"Daylight",
"modelid":"PHDL00",
"manufacturername":"Philips",
"swversion":"1.0"
}
}
Thank you! It is supposed to fix the unreachable bulbs, am i correct?
Sent from Yahoo Mail for iPhone
On Tuesday, April 16, 2019, 9:40 PM, Motea Marius notifications@github.com wrote:
add this sensor "1" in sensors: "sensors":{ "1":{ "state":{ "daylight":null, "lastupdated":"none" }, "config":{ "on":true, "configured":false, "sunriseoffset":30, "sunsetoffset":-30 }, "name":"Daylight", "type":"Daylight", "modelid":"PHDL00", "manufacturername":"Philips", "swversion":"1.0" } }
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.
I will propose another fix for that...when inwill reach to hotel.
I reviewed the log file and now realized that there are 3 error in the logs:
timeout means the hue emulator was unable to communicate with the yeelight bulb, ensure better wifi coverage in your home.
For Milight error remove or comment the following code in /opt/hue-emulator/functions/lightRequest.py:
elif "bulb_mode" in light_data and light_data["bulb_mode"] == "color":
lights[light]["state"]["colormode"] = "hs"
lights[light]["state"]["hue"] = light_data["hue"] * 180
if (not "saturation" in light_data) and addresses[light]["mode"] == "rgbw":
lights[light]["state"]["sat"] = 255
else:
lights[light]["state"]["sat"] = int(light_data["saturation"] * 2.54)
Restart hue emulator for the changes to be applied.
I updated the config.json with sensors 1 as per your instruction. However, when I restart hue-emulator service. I still got the same error. I checked the config.json and found the code lines added now disappear as if I never added it before. So somehow the config.json gets updated every time hue-emulator starts? What should I do now? On Tuesday, April 16, 2019, 9:40:58 PM GMT+7, Motea Marius notifications@github.com wrote:
add this sensor "1" in sensors: "sensors":{ "1":{ "state":{ "daylight":null, "lastupdated":"none" }, "config":{ "on":true, "configured":false, "sunriseoffset":30, "sunsetoffset":-30 }, "name":"Daylight", "type":"Daylight", "modelid":"PHDL00", "manufacturername":"Philips", "swversion":"1.0" } }
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.
I followed your instruction and the hue key error does not occur any more. all hue light bulbs are now reachable and color state is reflected correctly. Many thanks for your fix. On Wednesday, April 17, 2019, 2:20:44 AM GMT+7, Motea Marius notifications@github.com wrote:
timeout means the hue emulator was unable to communicate with the yeelight bulb, ensure better wifi coverage in your home.
For Milight error remove or comment the following code in /opt/hue-emulator/functions/lightRequest.py: elif "bulb_mode" in light_data and light_data["bulb_mode"] == "color": lights[light]["state"]["colormode"] = "hs" lights[light]["state"]["hue"] = light_data["hue"] 180 if (not "saturation" in light_data) and addresses[light]["mode"] == "rgbw": lights[light]["state"]["sat"] = 255 else: lights[light]["state"]["sat"] = int(light_data["saturation"] 2.54)
Restart hue emulator for the changes to be applied.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.
For the time out issue with Yeelight Error with the yeelight: File "/opt/hue-emulator/protocols/yeelight.py", line 125, in get_light_state data = tcp_socket.recv(16 * 1024) socket.timeout: timed out I am pretty sure the lamp is within very good wifi coverage. I am controlling it very well with alternative connections, both officially released by Xiaomi like Alexa and Google Home (via Yeelight skills) and via homebridge yeelight plug in. The lamp is only unreachable in Hue app connected to Hue-emulator. I notice when I control it via alternative method, like Homebridge Home App and watch its status in Hue app. I can see the lamp shortly gets reachable (the unreachable word disappears), then becomes unreachable again. This lamp is xiaomi desk lamp. The other lamp (xiaomi bedside lamp) is always reachable.
Important is to have good connectivity from hue emulator host, not from other devices from your home. Is the ping stable to the yeelight bulbs from hue emulator host?
I set static IP for both hue-emulator and the yeeight bulb.
Sent from Yahoo Mail for iPhone
On Friday, April 19, 2019, 4:39 AM, Motea Marius notifications@github.com wrote:
Important is to have good connectivity from hue emulator host, not from other devices from your home. Is the ip stable to the yeelight bulbs from hue emulator host?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.
I added the sensor "1" in the config.json as per your instruction but still got this error after restart the hue-emulator service: it is found that the lines sdded are wiped out from config.json when restarting hue emulator.
Exception in thread Thread-9:
Apr 18 23:08:55 raspberrypi HueEmulator3.py[29358]: Traceback (most recent call last):
Apr 18 23:08:55 raspberrypi HueEmulator3.py[29358]: File "/usr/lib/python3.5/threading.py", line 914, in _bootstrap_inner
Apr 18 23:08:55 raspberrypi HueEmulator3.py[29358]: self.run()
Apr 18 23:08:55 raspberrypi HueEmulator3.py[29358]: File "/usr/lib/python3.5/threading.py", line 862, in run
Apr 18 23:08:55 raspberrypi HueEmulator3.py[29358]: self._target(*self._args, **self._kwargs)
Apr 18 23:08:55 raspberrypi HueEmulator3.py[29358]: File "/opt/hue-emulator/HueEmulator3.py", line 935, in daylightSensor
Apr 18 23:08:55 raspberrypi HueEmulator3.py[29358]: if bridge_config["sensors"]["1"]["modelid"] != "PHDL00" or not bridge_config["sensors"]["1"]["config"]["configured"]:
Apr 18 23:08:55 raspberrypi HueEmulator3.py[29358]: KeyError: '1'
On Tuesday, April 16, 2019, 9:40:58 PM GMT+7, Motea Marius <notifications@github.com> wrote:
add this sensor "1" in sensors: "sensors":{ "1":{ "state":{ "daylight":null, "lastupdated":"none" }, "config":{ "on":true, "configured":false, "sunriseoffset":30, "sunsetoffset":-30 }, "name":"Daylight", "type":"Daylight", "modelid":"PHDL00", "manufacturername":"Philips", "swversion":"1.0" } }
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 2 days if no further activity occurs. Thank you for your contributions.
This issue has been automatically closed as it has not had any recent activity. Thank you for your contributions.
Describe the bug I have 38 milight bulbs (RGB-CCT) set up in 7 rooms (from 2 to 7 bulbs per room). They all ran stably with the Hue Emulator and Milight hub for months. Recently I found some bulbs (usually 4 to 10 bulbs) show unreachable status. A restart of hue-emulator might fix the unreachable status. The bulbs still receive command well from the Hue app even though the status is unreachable, except that after I turn the unreachable bulbs on for a few seconds the switch will come back to Off position (but the bulbs are still glow and that make the bulb status in the app wrong). Now I came across another issue, not sure related to the one described above. All bulbs (unreachable or reachable) would glow if the command set is white (CCT) (and then some unreachable bulbs would show status OFF as described above). But when sending a color command (RGB) ALL bulb would glow but after 5-10 seconds they all show status as OFF in the app (bulbs actually are still glowing correctly in brightness and color).
Logs This log show when start up the hue-emulator but not controlling any bulb from the hue app yet. The similar would show when set color to bulbs.
Log 2 (when firing a color scene of spring blossom to the bulb group). When the status start to show OFF again then the error found in the log (actual bulbs are still glowing).