Code Monkey home page Code Monkey logo

diyhue's Introduction

Please only open new issues at diyhue/diyHue

This project has rapidly grown in size and has therefore moved to it's own organisation diyhue Don't worry though, this is not the end of the project, just the next step in its development. It has also grown enough that we have split the repo into four so each can focus on it's own subject, be that the main code, diy Lights or sensors and controllers. You can find the new diy organisation and its repos here!

To migrate your existing install to the new repo please run the following command from the diyHue install directory. This is /opt/hue-emulator if you used the easy install script:

curl -s https://raw.githubusercontent.com/mariusmotea/diyHue/master/migrate.sh | sudo bash /dev/stdin

If your using docker, please just pull the latest image.

Thank you for your support. 😄

license CommitActivity ZenHub

JoinSlack SlackStatus

TravisCI DockerPulls

This project emulates a Philips Hue Bridge that is able to control ZigBee lights (using Raspbee module, original Hue Bridge or IKEA Tradfri Gateway), Mi-Light bulbs (using MiLight Hub), Neopixel strips (WS2812B and SK6812) and any cheap ESP8266 based bulb by replacing the firmware with a custom one. It is written in python and will run on all small devices such as the RaspberryPi. Arduino sketches are provided for the Hue Dimmer Switch, Hue Tap Switch and Hue Motion Sensor. Lights are two-way synchronized so any change made from original Philips/Tradfri sensors and switches will also be applied to the bridge emulator.

diyHue ecosystem

Requirements:

  • python 3
  • nmap package for esp8266 lights autodiscover sudo apt install nmap
  • python ws4py package only if zigbee module is used sudo pip install ws4py

To Do

  • Working directly with ZigBee lights, switches and sensors with RaspBee module
  • control IKEA Trådfri lights from HUE applications
  • Create ESP8266 bridge device to add MI Lights to Hue Bridge emulator.
  • On/Off control for other home devices using virtual lights
  • Alarm (email notification + eps8266 horn)
  • Hue Entertainment support

Working HUE futures:

  • Control lights (all functions)
  • Control groups (all functions)
  • Scenes (all functions)
  • Routines
  • Wake up
  • Go to sleep
  • Switches (custom esp8266 switches)
  • Autodiscover lights
  • Hue entertainment

Working devices and applications:

  • Amazon Alexa (control only the lights)
  • Logitech Harmony
  • Tradfri Gateway
  • Hue Bridge (original + other emulators)
  • Home Assistant
  • Domoticz
  • Openhab
  • Philips Ambilight TV's
  • Kodi Hue Ambilight
  • Jeedom
  • Hue Sync for PC

Working smartphone applications:

  • Hue (official application)
  • Hue Essentials - recommended
  • hueManic
  • OnSwitch
  • HueSwitcher
  • LampShade

Not working:

  • Home & Away future from Hue app (require remote api)
  • Google Home (require remote api)
  • Eneco Toon (very likely it use cloud service detection)

Supported lights:

  • WS2812B and SK6812 smart led strips
  • MiLight
  • Yeelight
  • LYT8266
  • Phillips Hue
  • Ikea Tradfri
  • Pwm RGB-CCT
  • Pwm RGBW
  • Pwm RGB
  • Pwm CCT
  • Pwm Dimming (up to 6 lights for every esp8266)
  • On/Off plugs/lights (up to 6 lights for every esp8266)
  • On/Off 433Mhz devices (multiple devices for every esp8266)

Stability:

All the lights in my house are controlled by this solution so the stability is very important to me as there is no turning back to classic illumination (all switches were replaces with Ikea Tradfri Remotes and holes covered). However I don't use all the functions, so i'm unable to perform full tests on every change. What I do currently use is Deconz with all Tradfri devices (lights + sensors), Xiaomi Motion Sensor, native ESP8266 bulbs, ESP8266 + WS2812B strips and Xiaomi YeeLight color bulb.

Please submit in this issue or on our slack team any other device/application that is working with this emulator.

Check the Wiki page for more details

Youtube Demo

I push updates fast so if you want to be notified, just watch this repo

Contributions are welcome

Hue living color light project for 3D printing: https://www.thingiverse.com/thing:2773413

qtHue

You may want to see also my new project qtHue that provide a simple user interface for controlling the lights. qtHue

Credits:

diyhue's People

Contributors

animii avatar avinashraja98 avatar basktrading avatar bb-benbridges avatar cad435 avatar camatthew avatar cwildfoerster avatar dependabot[bot] avatar freddebo avatar githobi avatar j3n50m4t avatar jdaandersj avatar kurniawan77 avatar mariusmotea avatar mcer12 avatar mreijnde avatar munkeyballs avatar nikfinn99 avatar pecirep avatar roelandkluit avatar scubiedoo avatar shbatm avatar shivasiddharth avatar sneak-thief avatar subnoize417 avatar ticed35 avatar topdrob avatar vknmnn avatar wqrld avatar yavadan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

diyhue's Issues

Unable to link existing Hue bridge

I am very exited about this project, and got it working to some extent (succesfully connected a ESP8266 RGB PWM ledstrip), but I have an issue with linking my existing Hue bridge. When I go to http://[BridgeEmulatorIP]/hue Firefox gives me an error:

SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data

And Chrome just displays the html code with no functionality. I am running the emulator on a Raspberry pi 1 model B with Raspbian stretch lite.

Fiecan lights flash

hey,
Fiecan Led Bulb are the cheapest light i found. and i bought few of them.
these lights using the ColorDream app as you mentioned in the readme file.
i have electronic skills i gathered over the past three years. and i would really like you to help me flash these bulbs.
i attached link to the pictures i took of the bulb, i cant find the RX or the TX .

need your help here.
thank you.

IKEA Tradfri

This is not an issue !!
In the Tradfri Wiki part is says: http://{bridgeIP}/tradfri
Which "tradfri" is going to be installed for the intergration with the bridge?
There are many tradfri applications here on github
BR Steen

Guide for modifying MiLight Bulbs

Hi i tried to follow your guide and could get the bridge and a WS2812b LED-Stripe working. Works all perfect, great work.

Now i want to head over to build some Bulbs. Im interested in the MiLight bulb but i cant rly follow the instructions u gave. Could you maybe make a step by step guide with some more Pictures? Would be rly helpfull.

THX

New "Timers" function from Hue application don't work

New Hue application update introduce the function "Timers". Before to add a timer the application check bridge capabilities to be sure it has available resources. After solving this problem the Hue application start to post the data in order to create the timer and at finish it crash. Some sample output from somebody with a real Hue Bridge will help to understand the reason why it crash. I expect a field added by hue bridge is missing on my bridge emulator

Port 22: Broken pipe

Hello diyHue runs perfect.
But after some minutes i couldn'd get a connection to emulated bridge and the HueEmulator.py stoped with the following error:
.....
192.168.178.63 - - [14/Sep/2017 22:18:03] "GET /api/a7161538be80d40b3de98dece6e91f904dc96170/groups HTTP/1.1" 200 -
192.168.178.63 - - [14/Sep/2017 22:18:05] "GET /api/a7161538be80d40b3de98dece6e91f904dc96170/lights HTTP/1.1" 200 -
192.168.178.63 - - [14/Sep/2017 22:18:06] "GET /api/a7161538be80d40b3de98dece6e91f904dc96170/groups HTTP/1.1" 200 -
packet_write_wait: Connection to 192.168.178.82 port 22: Broken pipe

The start looks like this:
pi@raspy-82:~/diyHue/BridgeEmulator $ sudo ./HueEmulator.py
Config loaded
LightRequest: http://192.168.178.50/api/2ypxD3CNUB4CZUmQ1oJ5Jslj7ChKhmxMbixxn4LH/lights/1/state
update status for light 1
LightRequest: http://192.168.178.33/set?light=1&on=False&bri=144&ct=447
update status for light 2
starting ssdp...
start ssdp broadcast
Starting httpd...
192.168.178.51 - - [15/Sep/2017 08:35:36] "GET /description.xml HTTP/1.1" 200 -
192.168.178.51 - - [15/Sep/2017 08:36:36] "GET /description.xml HTTP/1.1" 200 -

hue app wants to update the bridge

But it won't do it...
Tried the old app, but cannot connect with esp lights.

Also having trouble with that, The appear directly in my personal Wifi. Can see the settings for on/of and so on, but No SSID is broadcasted.

Dimmed single color output on different pins as different bulbs

Hi, First of all, great project! Love it!

I would like to use a ESP module as a diyHue but with just singel output for a mosfet, like a generic SingelColor output but with the option as multiple lights on the same module on different pins.

Specific I would like to connect ESP module to 6 channels output as 6 different emulated lights, as in the neopixel version "light count". Could you guide me or make a version of this?

Support PlatformIO

Right now, you aren't in any way documenting what kind of device you're compiling with.

Since ESP8266s are fragile and prone to frying when you give them the wrong compile type, this is actually important information.

If you switch from using the Arduino UI to using PlatformIO, that information will all be included in your repository.

Then other people will be able to build your code too and ALSO, create builds for other kinds of chipsets.

configuration Emulator with ESP8266

Hi, can someone please help me with the configuration of the Emulator?
At the Moment, the ESP8266 and Emulator is running.
I can connect with the Hue App to the Emulator, but how can i connect the ESP8266+ WS2812 LED with the Emulator(how to configure), that i can see the Light in the Hue App.

Thanks
Christian

Startup Systemd File Retry on Fail modification

I came across some problems with the Service file.
My Raspberry takes a bit to get a dhcp ip from my router. Meanwhile the service starts and fails at "getIpAddress()". I modified the Service File to try to restart the Service after a fail.

Here my modified version:

Description=Hue Emulator Service
After=multi-user.target

[Service]
Type=idle
Restart=always
RestartSec=30
StartLimitInterval=200
StartLimitBurst=5

WorkingDirectory=/home/pi
ExecStart=/home/pi/HueEmulator.py

[Install]
WantedBy=multi-user.target

It retrys to start the service after a fail 5 times with a delay of 30 seconds each time. Maybe add this to the Wiki?

Update not possible -> Functionality limited

Today there seems to be an update to the Hue Bridge. When I try to update, it fails. This is the output on the bridge:

192.168.0.33 - - [10/Jun/2017 01:14:00] "POST /updater HTTP/1.1" 200 -
in post method
_----------------------------------------------------------------------------
Exception happened during processing of request from ('192.168.0.33', 39512)
Traceback (most recent call last):
File "/usr/lib/python2.7/SocketServer.py", line 295, in _handle_request_noblock
self.process_request(request, client_address)
File "/usr/lib/python2.7/SocketServer.py", line 321, in process_request
self.finish_request(request, client_address)
File "/usr/lib/python2.7/SocketServer.py", line 334, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/lib/python2.7/SocketServer.py", line 655, in init
self.handle()
File "/usr/lib/python2.7/BaseHTTPServer.py", line 340, in handle
self.handle_one_request()
File "/usr/lib/python2.7/BaseHTTPServer.py", line 328, in handle_one_request
method()
File "HueEmulator.py", line 596, in do_POST
post_dictionary = json.loads(self.data_string)
File "/usr/lib/python2.7/json/init.py", line 338, in loads
return _default_decoder.decode(s)
File "/usr/lib/python2.7/json/decoder.py", line 366, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python2.7/json/decoder.py", line 384, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
_----------------------------------------------------------------------------

I assume that the script is designed to be updated like a bridge, but how can the update be circumvented? I was not able to find any changelogs online that would indicate the version that I could then use in the json.config...

Edit: I added underscores in front of the rows with dashes as otherwise all of the text is displayed as a Header...

ESP8266 with WS2812B LEDs oversaturated and white

Hello,

I setup a diyHue and a Lightstrip, wich is simply one WS2812B connected to a ESP8266-01.
Works flawless, except the LED is way to bright and if I chose for example 'green' on the color-palette its more like a greenish white type of thing.

I made a picture really close to the lit LED, so as you can see the setting "green" actually lights up the green subpixel, but also the red subpixel is really bright, wich gives a type of yellow/green/white light.

--> Pic: http://fs5.directupload.net/images/170921/zqa5e9bm.jpg

In general most of the colors are very white and washed out.

Any help would be appreciated and since the discussion on Hackaday.io was moved to github i guess this is the right place to adress it.

cad435

Discovering other types of bulbs

Hi there, does it also support discover of different types of bulbs other than the ESP8266 ones e.g. real HUE bulbs.?

Will it be possible to make a wrapper for interfacing with other kinds - e.g. milight bulbs, IKEA trådfri...?

Dimmed parts of the lights "flash" black on fadeout

Hey,

So, I noticed, when sending an "off" signal to the lamp, the dimmed parts of it went completely dark (or sometimes they go on full brighness) for lets say 50ms to 100ms, then go back to normal brightness and fade out like expected.

I use A ESP8266-01 for an RGBW light and mapped the pins like this:

//define pins
uint32 io_info[PWM_CHANNELS][3] = {
// MUX, FUNC, PIN
{PERIPHS_IO_MUX_MTDI_U, FUNC_GPIO12, 1}, //R
{PERIPHS_IO_MUX_MTCK_U, FUNC_GPIO13, 0}, //G
{PERIPHS_IO_MUX_MTMS_U, FUNC_GPIO14, 3}, //B
{PERIPHS_IO_MUX_GPIO5_U, FUNC_GPIO5 , 2},//W
};

I guess it may be the soft-PWM? but im not really sure.
Maybe you have an idea what I can do about this (beside waiting for my ESP8266-12 to arrive)

Ah yeah and all other things are working as expected :)

cad435

random times are not working

New Hue application update introduce random times for schedules that are not working. These will be fixed in next update

Not able to connect to the bridge

I firstly followed the steps of the 'Getting started' page on the GitHub wiki, started the emulator, but then the status says following:
`● hue-emulator.service
Loaded: loaded (/lib/systemd/system/hue-emulator.service; enabled; vendor pre
Active: failed (Result: exit-code) since Sun 2017-10-29 14:27:14 CET; 3min 28
Process: 15617 ExecStart=/home/pi/HueEmulator.py (code=exited, status=203/EXEC
Main PID: 15617 (code=exited, status=203/EXEC)

Oct 29 14:27:14 raspberrypi systemd[1]: Started hue-emulator.service.
Oct 29 14:27:14 raspberrypi systemd[1]: hue-emulator.service: Main process exite
Oct 29 14:27:14 raspberrypi systemd[1]: hue-emulator.service: Unit entered faile
Oct 29 14:27:14 raspberrypi systemd[1]: hue-emulator.service: Failed with result
lines 1-10/10 (END)...skipping...
● hue-emulator.service
Loaded: loaded (/lib/systemd/system/hue-emulator.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sun 2017-10-29 14:27:14 CET; 3min 28s ago
Process: 15617 ExecStart=/home/pi/HueEmulator.py (code=exited, status=203/EXEC)
Main PID: 15617 (code=exited, status=203/EXEC)

Oct 29 14:27:14 raspberrypi systemd[1]: Started hue-emulator.service.
Oct 29 14:27:14 raspberrypi systemd[1]: hue-emulator.service: Main process exited, code=exited, status=203/EXEC
Oct 29 14:27:14 raspberrypi systemd[1]: hue-emulator.service: Unit entered failed state.
Oct 29 14:27:14 raspberrypi systemd[1]: hue-emulator.service: Failed with result 'exit-code'.`

Thanks for your help!

Speed up PWM frequency to 17kHz

Hey,

is it possible to speed up the PWM from 5kHz to over 17kHz?

Its absolut fine in visual aspects, but actually i can hear a slight 5kHz tone and thats really annoying...

Every increase in speed is really appreciated even if the resolution will decrease...

Or maybe a define were you can select a speed mode...

Will be very cool!
cad435

Trying to add own leds that are connected

I currently use the pi-blaster library and that seems to work great so far manually. It's basically a file where you write to.

But now I'm trying to merge with my existing Philips Hue lights and my Google Home. So I've setup the bridge and it gets recognised by the app but I'm stuck with how I would need to add the led strip I've connected to my Raspberry Pi GPIO pins. Is there any way to do interface with a simple led strip? The Pi-Blaster library handles most of the conversion (I'm using a modified ikea dioder kit) and basically needs all a pin and a value between 0.0-1.0. How would I go about adding the leds to the project (add it to the bridge)? And could you give me a lead for a template I could build it on and what arguments are passed? Thanks a lot, it's working great so far! I would gladly make a pull request from a new fork where I've added compatibility for pi-blaster.

Can this be made to work with smartthings?

Is it possible to make this work with smart things , would like to port my phillips switches over to smart things and this seems like it could be a good option

basically what i want to do is force hue to push an update on button change events

I need some help - RasPi 2model b. 1x hue light strip

So i bought the 2meter light strip and an extension of 1 meter.
Installed the software on the PI and downloaded the app to my phone.
I was able to connect to the bridge but after that the app just crashes on my phone.
Am i missing something? Could you possible give a step by step for my setup?

WifiManager not working with WS2812B ino.

Hi.

Got everything working with the HueEmulator, but experiencing an issue while testing the WS2812B LED-strip. After writing the ino-file to NodeMCU, it does not present "New Hue Light" SSID. I get the typical ESP_xxxxxx SSID which I can connect to, but no http-reply from 192.168.4.1. I get IP in the same subnet and I can also ping 192.168.4.1.

Have tried multiple NodeMCU (different manufacturers), but always the same issue. Also tried different versions of WifiManager (v12, 11 and 10) as I suspected this might be the issue. Using latest version of Arduino IDE.

Any advice is welcome :-)
Or does someone know how to hack it so I can manually input wifi-credentials instead of using WifiManager?

Thanks.

Amazon Alexa - Rooms not being reported to Alexa during discovery

Hello, during my setup and attempting to move from an actual Hue Bridge to your emulated bridge, I noticed that the Hue Scenes and Hue Groups are not being reported to Alexa/Echo during Discover Devices.

Expected behavior: Alexa discovers Rooms as a device and Scenes as scenes in the Alexa app after Disabling/Re-enabling the Hue Skill. This is how the Hue Bridge behaves.

Current behavior: Only individual lights are reported to Alexa as devices.

Hue strips displayed as Bulbs

Can you change that neopixels are displayed as as an led strip in the lights overview in the app instead of being diplaxed as a generic rgb ligt or add the ability to change the type of light in the script?

Can't use RGB on RGB+CCT Milight bulbs.

I finally got everything set-up, with a neopixel ledstrip and a couple of RGB+CCT Milights. I added the milights as RGB+CCT lamps (which they are, and they function normally outside of the HueEmulator). But when I try to set them to a color, they don't respond. (they seem to be stuck in CCT mode, because that functionallity works well). It's the same in both manual control as when trying scenes.

Questions to the author

Hi,

I've been around your project for 3 days now. I've been looking at your youtube videos and this repo and i think i've read all the code produced here. It's a very interesting project, the strategy to proxy the hue bridge is clever and it works pretty straightforward. If I interpret everything about this project right, the idea is that you force the hue app on your phone to connect to your raspberry pi... so... you are reverse engineering the philips hue bridge, and at the same time you are maintaining a rewrite of it.

Based on that assumption :

  1. Aren't you afraid of the consequences whenever Philips brings changing ?

  2. For multi compatilibity, you basically flatten all the other bridges api to the hue api so you can control everything with the hue app. But then, you will also need to maintain all the apis to all the devices to which your code is compatible with. Again, I think there are some concerns about maintaining this codebase, don't you think ?

  3. As you add more and more lines of code, the readability of the code becomes very difficult. I believe it's easy for you because you iterate (very very impressively) fast... But even with my skillset, I'm not capable or even willing to contribute to that project (no offense). I've been spending a night reading at this 1200 lines of python and can't figure out half of it... Are you gonna rewrite/clean the code so others can help you maintain it ?

  4. Last, but not least. The amazon devices (and other voice assistants) relay on uPnP to discover all the bridges of your home, and that's how, when you create groups on your hue app, you can turn them on/off with Alexa. Do you plan on maintaining the uPnP side of the hue bridge as well ?

Thanks for the good work, it looks amazing in my living room.
I just wished i could help.

Sincerely,
Julian

Which GPIO corresponds to which color generic RGBW

Hello, finally some long awaited parts have arrived and i made a quick test build of a RGBW strip controller. However the colors dont seem correct at first glance. I found the GPIOs to use in the sketch, but as far as i could see there wasn't any guidance on which color corresponds to which GPIO?

On a related question, are the sketches pre tuned/calibrated? I have another build with a ws2812b strip and it behaves correctly, just that the colors are kinda "dull". I've used the same strip in other builds so i know it can be more intense. If so, any simple way to make the sketch neutral again for testing purposes?

Setup process

Would you be able to help a newbie to set this up? I have a rpi3, Tradfri Gateway and Google Home. If I understand correctly, with this my Google Home should be able to control my Tradfri lights. Correct?

I have python on the pi, but what steps do I need to make to get this code installed?

Sorry for asking the obvious.

Incompatible with new Hue App

Today there was a new release of the official phillips hue app. Sadly it requires to update the bridge otherwise it wont work. If you just updated the app you are just able to control your current setup but not to edit it. If you reinstall the app you are premittet to enter the app because you cannot update the bridge. Can you please make the changes necessary to support the official hue app again?

Thank you in advance
~Tim

P.S. Has someone not updated the app and is able to provide me with the old version off the app? (You could use something like the App ApkExtractor.The version of the old Phillips Hue app should should be 2.15.0)

This is how it looks when i updated the app: (everything exept the controlpage of the rooms is blocked)
screenshot_20171011-233127

And this us how it looks when i do a fresh install of the app: (App is unusable due to unskippable update notification)
screenshot_20171011-231903

Hope you can understand the screenshot even if they are in german.

opposite temperature rgbcct ledstrip controller

Hi, there again.

I have made the ESP Mi-light hub for my older milight rgbw bulbs (fut014) and rgbcct led strip controller (fut039).

with the rgbcct led controller the color temperature works in the opposite waywith the hue app as with the rf remote and with the ESP Mi-light web ui.

RGB Led Strip Control

I got everything working with the neopixels. But i am not able to get it to work with my RGB 5050 Led Strip.

My current setup looks like this:
untitled sketch_steckplatine
But my leds are only glow a little bit and dont let me control them.
Any help is desired.

~Tim

Unable to link with Google Home

to link with Google Home it needs to be able to be linked with account.meethue.com/link-bridge which asks me to Push the big button on the middle of your bridge. The one you've always wanted to push. Go on.

Is this possible in any way shape or form or not?

Thanks

(partial continuation of #20)

syncWithLights not wokring!

192.168.XX.XXX - - [12/Oct/2017 19:42:37] "GET /api/a7161538be80d40b3de98dece6e91f904dc96170/lights HTTP/1.1" 200 -

Exception happened during processing of request from ('192.168.XX.XXX', 44158)
Traceback (most recent call last):
File "/usr/lib/python2.7/SocketServer.py", line 290, in _handle_request_noblock
self.process_request(request, client_address)
File "/usr/lib/python2.7/SocketServer.py", line 318, in process_request
self.finish_request(request, client_address)
File "/usr/lib/python2.7/SocketServer.py", line 331, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/lib/python2.7/SocketServer.py", line 652, in init
self.handle()
File "/usr/lib/python2.7/BaseHTTPServer.py", line 340, in handle
self.handle_one_request()
File "/usr/lib/python2.7/BaseHTTPServer.py", line 328, in handle_one_request
method()
File "./HueEmulator.py", line 1078, in do_GET
syncWithLights()
File "./HueEmulator.py", line 580, in syncWithLights
bridge_config["lights"][light]["state"].update(light_data["state"])
TypeError: list indices must be integers, not str

Amazon Echo

Is there any way to be discoverable by Amazon Echo?

Issues with other networked automation services.

Maybe not so much an issue, but for what it's worth, the bridge emulator doesn't seem to play well with other networked automation services I have running on my network.
My network includes Home Assistant (home-assistant.io), Hyperion.ng (github.com/hyperion-project/hyperion.ng), and a Philips Hue Bridge 2G.
Home Assistant gets a little finicky and has to be restarted multiple times (at times) to find the real Philips Bridge and the Emulated Bridge. (Also, using automations in Home Assistant, the lights controlled through the Emulated Bridge have a few different reactions than the Hue lights controlled through the Hue Bridge.)
Hyperion.ng often has issues with the Proto server/client communication. (I run 2 Hyperion.ng servers for extra effects across the room. Shortly after starting Hyperion.ng, it usually freezes and throws errors about not being able to communicate via Proto. Once I stopped the Emulated Bridge, I had no issues.

I'm not really expecting you to troubleshoot these or correct them, just sharing my experience.

With all of that said, when it comes to just wanting to use your Emulated Bridge with a couple of strip lights on some D1 mini's and controlling them from the Hue app, it works great! So essentially, it works as is intended in that sense. Nice work!

EDIT: Redacted appears to be a different issue now, unrelated to the emulated bridge, just coincidental timing.

Create 3D model of Dimmer Switch and Motion Sensor for 3D printing

Will be nice if somebody can create 3D projects to have these devices that will look like original ones.
Hue Dimmer switch need to be like original dimmer switch (i guess ESP-12S + 1x coil battery will fit the case)
Hue Motions Sensor size need to accept one HC-SR501 sensor, two AAA batteries and one ESP-12S device. Soon i will push a new update to Hue Motion project that will fix rf interferences with PIR.

Adding light on Wemos D1 mini not working

Hi,

When in the HUE app I scan for lights, I get this problem:

192.168.1.114 is a hue bulb
is a new device
192.168.1.114 is unknow device 'modelid'
192.168.1.184 is unknow device HTTP Error 404: Not Found

Do I need to set a model id in the sketch ? If so, where an what ?

Thanks

Use diyHue with a custom device

Hello,

My project is to control devices normally controlled by a 433 MHz remote with my Logitech Harmony Hub.

I already have a Raspberry Pi with a 433 MHz module and I can successfully control devices via the a Python script. Now, it seems according to my researches that the easiest way to make the Harmony Hub control something via a network API (i.e. not via infrared) would be to emulate a Philips Hue bridge. This is how I arrived here, wanted to build something like this:

Harmony Hub ---(LAN)---> diyHue ---(exec script? API?)---> my 433 MHz Python script

Is this something that could be done with diyHue? Could my Python script be easily controlled by diyHue?

Thank you,

List of supported devices

This is not an issue, i create this topic so the users can write what devices they where able to use with this Hue emulator to specify them in README file. For devices that are not working will be better to have separate issue opened.

No connection with Eneco Toon (Quby)

Hi,

I have got your diyHue emulator working fine with the official phillips hue apps together with a wemos d1 mini and a neopixel ring. Thanks a lot!

I also have a Quby (dutch Toon Eneco) which serves as a thermostat, zwave and Hue controller but it simply could'nt find the Hue bridge emulator. It seems that the Toon listens to others broadcasts then your simulator does.

It would be great to have your simulator working with the Toon. I have found some info over here: https://github.com/ewjmulder/hue-bridge-simulator/issues and especially here: https://raw.githubusercontent.com/ewjmulder/program-your-home/master/eneco-toon/IDEAS.txt which explains the broadcast of this emulator.

I am not a dev but i certainly would love to help with testing if you would have a dive in this.

regards kurniawan77

Cannot reconnect after Pi reboots

If I reboot my Pi and rerun the python script I get following error:

Exception happened during processing of request from ('192.168.0.33', 44660) Traceback (most recent call last): File "/usr/lib/python2.7/SocketServer.py", line 295, in _handle_request_nobloc k self.process_request(request, client_address) File "/usr/lib/python2.7/SocketServer.py", line 321, in process_request self.finish_request(request, client_address) File "/usr/lib/python2.7/SocketServer.py", line 334, in finish_request self.RequestHandlerClass(request, client_address, self) File "/usr/lib/python2.7/SocketServer.py", line 655, in __init__ self.handle() File "/usr/lib/python2.7/BaseHTTPServer.py", line 340, in handle self.handle_one_request() File "/usr/lib/python2.7/BaseHTTPServer.py", line 328, in handle_one_request method() File "/root/diyHue/BridgeEmulator/HueEmulator.py", line 643, in do_POST bridge_config["config"]["whitelist"][username] = {"last use date": datetime. utcnow().strftime("%Y-%m-%dT%H:%M:%S"),"create date": datetime.utcnow().strftime ("%Y-%m-%dT%H:%M:%S"),"name": post_dictionary["devicetype"]} TypeError: 'str' object does not support item assignment

The Hue app then wants me to press the Push-link button on the Hue bridge to authenticate. Would it be possible to have the button press added to the python script or can the issue be resolved otherwise?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.