Working on multiple emulated_hue instances

mine is this (192.168.1.239 is the pi3 with HASS)

pi@raspberrypi:~ $ sudo netstat -anp | grep 80
tcp        0      0 192.168.1.239:45540     192.168.1.225:8009      ESTABLISHED 528/python3
tcp        0      0 192.168.1.239:47744     192.168.1.116:8008      ESTABLISHED 528/python3
tcp        0      0 192.168.1.239:39798     192.168.1.91:8008       ESTABLISHED 528/python3
tcp        0      0 192.168.1.239:58638     192.168.1.91:8009       ESTABLISHED 528/python3
tcp        0      0 192.168.1.239:58640     192.168.1.91:8009       ESTABLISHED 528/python3
tcp        0      0 192.168.1.239:50482     192.168.1.242:8008      ESTABLISHED 528/python3
tcp        0      0 192.168.1.239:58642     192.168.1.91:8009       ESTABLISHED 528/python3
tcp        0      0 192.168.1.239:39980     192.168.1.91:8008       ESTABLISHED 528/python3
tcp        0      0 192.168.1.239:34056     192.168.1.116:8009      ESTABLISHED 528/python3
tcp        0      0 192.168.1.239:45342     192.168.1.225:8009      ESTABLISHED 528/python3
tcp        0      0 192.168.1.239:39978     192.168.1.91:8008       ESTABLISHED 528/python3
tcp        0      0 192.168.1.239:47954     192.168.1.116:8008      ESTABLISHED 528/python3
tcp        0      0 192.168.1.239:39982     192.168.1.91:8008       ESTABLISHED 528/python3
tcp        0      0 192.168.1.239:58298     192.168.1.225:8008      ESTABLISHED 528/python3
tcp        0      0 192.168.1.239:50706     192.168.1.242:8008      ESTABLISHED 528/python3
tcp        0      0 192.168.1.239:45544     192.168.1.225:8009      ESTABLISHED 528/python3
tcp        0      0 192.168.1.239:35774     192.168.1.91:8009       ESTABLISHED 528/python3
tcp        0      0 192.168.1.239:39384     192.168.1.242:8009      ESTABLISHED 528/python3
tcp        0      0 192.168.1.239:58644     192.168.1.91:8009       ESTABLISHED 528/python3
tcp        0      0 192.168.1.239:45542     192.168.1.225:8009      ESTABLISHED 528/python3
tcp        0      0 192.168.1.239:39984     192.168.1.91:8008       ESTABLISHED 528/python3
tcp        0      0 192.168.1.239:39390     192.168.1.242:8009      ESTABLISHED 528/python3
tcp        0      0 192.168.1.239:34054     192.168.1.116:8009      ESTABLISHED 528/python3
tcp        0      0 192.168.1.239:34380     192.168.1.203:55443     ESTABLISHED 528/python3
tcp        0      0 192.168.1.239:33842     192.168.1.116:8009      ESTABLISHED 528/python3
tcp        0      0 192.168.1.239:39164     192.168.1.242:8009      ESTABLISHED 528/python3
tcp        0      0 192.168.1.239:58646     192.168.1.91:8009       ESTABLISHED 528/python3
tcp        0      0 192.168.1.239:39388     192.168.1.242:8009      ESTABLISHED 528/python3
tcp        0      0 192.168.1.239:45538     192.168.1.225:8009      ESTABLISHED 528/python3
tcp        0      0 192.168.1.239:34052     192.168.1.116:8009      ESTABLISHED 528/python3
tcp        0      0 192.168.1.239:8123      192.168.1.253:50680     ESTABLISHED 528/python3
tcp        0      0 192.168.1.239:34046     192.168.1.116:8009      ESTABLISHED 528/python3
tcp        1      0 192.168.1.239:56916     192.168.1.32:80         CLOSE_WAIT  528/python3
tcp        0      0 192.168.1.239:58436     192.168.1.91:8009       ESTABLISHED 528/python3
tcp        0      0 192.168.1.239:34048     192.168.1.116:8009      ESTABLISHED 528/python3
tcp        0      0 192.168.1.239:50912     192.168.1.225:8009      ESTABLISHED 528/python3
tcp        0      0 192.168.1.239:44736     192.168.1.242:8009      ESTABLISHED 528/python3
tcp        0      0 192.168.1.239:58494     192.168.1.225:8008      ESTABLISHED 528/python3
tcp        0      0 192.168.1.239:39392     192.168.1.242:8009      ESTABLISHED 528/python3
tcp        0      0 192.168.1.239:39394     192.168.1.242:8009      ESTABLISHED 528/python3
tcp        0      0 192.168.1.239:39408     192.168.1.116:8009      ESTABLISHED 528/python3
tcp        0      0 192.168.1.239:45534     192.168.1.225:8009      ESTABLISHED 528/python3
udp        0      0 192.168.1.255:137       0.0.0.0:*                           1806/nmbd
udp        0      0 192.168.1.239:137       0.0.0.0:*                           1806/nmbd
udp        0      0 0.0.0.0:137             0.0.0.0:*                           1806/nmbd
udp        0      0 192.168.1.255:138       0.0.0.0:*                           1806/nmbd
udp        0      0 192.168.1.239:138       0.0.0.0:*                           1806/nmbd
udp        0      0 0.0.0.0:138             0.0.0.0:*                           1806/nmbd
udp6       0      0 fe80::352c:7e44:33a:123 :::*                                755/ntpd
unix  2      [ ACC ]     STREAM     LISTENING     11380    783/tor             /var/run/tor/control
unix  2      [ ACC ]     STREAM     LISTENING     11907    1806/nmbd           /var/run/samba/nmbd/unexpected
unix  2      [ ]         DGRAM                    11895    1806/nmbd           /var/cache/samba/msg/1806
unix  2      [ ]         DGRAM                    12080    1944/smbd           /var/cache/samba/msg/1944
unix  2      [ ACC ]     STREAM     LISTENING     13804    2009/gvfsd-trash    @/dbus-vfs-daemon/socket-0T86Gid6
unix  3      [ ]         STREAM     CONNECTED     13808    1876/pcmanfm
unix  3      [ ]         STREAM     CONNECTED     12809    412/dbus-daemon     /var/run/dbus/system_bus_socket
unix  3      [ ]         STREAM     CONNECTED     13800    2009/gvfsd-trash
unix  3      [ ]         STREAM     CONNECTED     13801    1777/dbus-daemon    @/tmp/dbus-XWSK7tzTy9
unix  3      [ ]         STREAM     CONNECTED     12806    412/dbus-daemon     /var/run/dbus/system_bus_socket
unix  3      [ ]         STREAM     CONNECTED     12802    1777/dbus-daemon    @/tmp/dbus-XWSK7tzTy9
unix  3      [ ]         STREAM     CONNECTED     11980    754/Xorg            @/tmp/.X11-unix/X0
unix  3      [ ]         STREAM     CONNECTED     12800    1870/openbox
unix  2      [ ]         DGRAM                    12805    1881/polkitd

I stopped it from booting

Not sure if you were able to resolve this.

If not, you should try running HA as root or sudo.

Port 80 requires privilege. This should show up as an error when the port is being bound during HA startup.

Never tried that. I have installed Hass in virtual environment as per instruction on AIO install

Is this error from emulated_hue at port 80?

17-02-26 09:33:16 ERROR (MainThread) [homeassistant.components.http] Failed to create HTTP server at port 80: [Errno 13] error while attempting to bind on address (‘192.168.1.239’, 80): permission denied

Here’s an issue thread talking about this problem.

They mention updating the documentation. So, then I went and looked and yes indeed there is a section of the HA emulated_hue documentation that refers to this solution:

1 Like

still nothing in GH app … The app had a major change in view, is yours still working?

EDIT It works, had to unlink the Hue hub, and relink. Is working.

Will try now more then 49 devices

Relinking is getting annoying! had to relink twice last week :frowning:.

It wouldn’t be so bad but adding all the devices to their corresponding rooms again is slightly annoying :stuck_out_tongue:

So far is stable.

@shenning00

Just to let you know that I am seeing this error in my log…

17-03-10 18:06:37 ERROR (Thread-4) [custom_components.emulated_hue] hue livingroom
17-03-10 18:06:37 ERROR (Thread-4) [custom_components.emulated_hue] hue masterbedroom
17-03-10 18:06:37 ERROR (Thread-4) [custom_components.emulated_hue] hue office

No big deal though. Everything still works fine. Wondering is it something can be fixed or I can safely ignore it.

Sorry - I used a debug log marked as “ERROR” so I could easily see it go by on my terminal. It shoes up as red text. This is just notifications. I’ll update the code on git later today.

1 Like

Hi,

I made a new installation of hassbian, and I am having problem with your component (my fault).

Can you help me out?

I have this error in log

17-04-21 21:55:48 ERROR (MainThread) [homeassistant.config] Invalid config for [emulated_hue]: [hue1] is an invalid option for [emulated_hue]. Check: emulated_hue->emulated_hue->hue1. (See /home/homeassistant/.homeassistant/configuration.yaml, line 78). Please check the docs at https://home-assistant.io/components/emulated_hue/
17-04-21 21:55:48 ERROR (MainThread) [homeassistant.setup] Setup failed for emulated_hue: Invalid config.

# Emulated Hue per Alexa`e Google Home
emulated_hue:
  hue1:
    type: alexa
    listen_port: 8301
    target_ip: 192.168.1.92
    exposed_domains:
      - switch
      - script
      - light
  hue2:
    type: alexa
    listen_port: 8302
    target_ip: 192.168.1.92
    exposed_domains:
      - scene
  hue3:
    type: alexa
    listen_port: 8303
    target_ip: 192.168.1.92
    exposed_domains:
      - group
  hue4:
    type: google_home
    listen_port: 80
    target_ip: 192.168.1.91
    exposed_domains:
      - switch
      - script
      - light
#
#

@shenning00

my fault I did not copy all the files in the custom_components.
Now Alexa works fine. I do have a problem with Google Home, it does not learn anything from emulated_hue.

Maybe I did something wrong, how to troubleshoot?

Too bad it stopped working

for google I should put 80?

Now in HASSBIAN the solution is not working??

pi@hassbian:~ $ sudo setcap 'cap_net_bind_service=+ep'  /srv/homeassistant/bin/python3
Failed to set capabilities on file `/srv/homeassistant/bin/python3' (Invalid argument)
The value of the capability argument is not permitted for a file. Or the file is not a regular (non-symlink) file
pi@hassbian:~ $

In hassbian installation I did this, and it works!!!

sudo setcap ‘cap_net_bind_service=+ep’ /usr/bin/python3.4

1 Like

Cool - I’m glad it worked out.

This needs to be added to the component page - finally got everything working when I found this! Using the Hasspian 1.1 image.

I just need to copy these 4 files into my custom_components directory and then hue1, hue2 should work?

emulated_hue:
  hue1:
    type: alexa
    host_ip: 192.168.2.100
    listen_port: 8300
    expose_by_default: false
#  exposed_domains:
#    - light
  hue2:
    type: google_home
    host_ip: 192.168.2.100
    listen_port: 80