Google Home and Hue Emulator Problems

Thanks will try when I get home.
I will let you know

Home now and i tried without the host_ip: and got thsi response.

2017-07-02 13:20:55 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.22', 80): permission denied
2017-07-02 13:21:26 INFO (MainThread) [homeassistant.components.discovery] Found new service: google_cast {'properties': {'nf': '1', 'rm': '3CCF5CA6F2A65B91', 'rs': False, 've': '05', 'cd': '769BB7510FD2DD76C64095D0E5EFDCF7', 'id': 'f3d25e7e3e4db280e79bd0f31e22e3e6', 'ca': '2052', 'ic': '/setup/icon.png', 'st': '0', 'bs': 'FA8FCA3B26B2', 'md': 'Google Home', 'fn': 'Google Home'}, 'hostname': 'f3d25e7e-3e4d-b280-e79b-d0f31e22e3e6.local.', 'host': '192.168.1.28', 'port': 8009}
2017-07-02 13:21:26 INFO (MainThread) [homeassistant.components.discovery] Found new service: philips_hue {'model_number': 'BSB002', 'ssdp_description': 'http://192.168.1.22:80/description.xml', 'serial': 'b827eb3f2f1f', 'model_name': 'Philips hue bridge 2015', 'port': 80, 'name': 'Philips hue (192.168.1.22)', 'host': '192.168.1.22'}
2017-07-02 13:21:34 INFO (MainThread) [homeassistant.components.light] Setting up light.hue
2017-07-02 13:21:35 ERROR (MainThread) [homeassistant.components.light] Error while setting up platform hue
Traceback (most recent call last):
  File "/srv/hass/lib/python3.4/site-packages/homeassistant/helpers/entity_component.py", line 164, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT, loop=self.hass.loop)
  File "/usr/lib/python3.4/asyncio/tasks.py", line 372, in wait_for
    return fut.result()
  File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
    raise self._exception
  File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/hass/lib/python3.4/site-packages/homeassistant/components/light/hue.py", line 138, in setup_platform
    allow_in_emulated_hue, allow_hue_groups)
  File "/srv/hass/lib/python3.4/site-packages/homeassistant/components/light/hue.py", line 149, in setup_bridge
    config_file_path=hass.config.path(filename))
  File "/home/hass/.homeassistant/deps/phue.py", line 629, in __init__
    self.connect()
  File "/home/hass/.homeassistant/deps/phue.py", line 753, in connect
    self.register_app()
  File "/home/hass/.homeassistant/deps/phue.py", line 707, in register_app
    response = self.request('POST', '/api', data)
  File "/home/hass/.homeassistant/deps/phue.py", line 666, in request
    return json.loads(str(result.read(), encoding='utf-8'))
  File "/usr/lib/python3.4/json/__init__.py", line 318, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.4/json/decoder.py", line 343, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.4/json/decoder.py", line 361, in raw_decode
    raise ValueError(errmsg("Expecting value", s, err.value)) from None
ValueError: Expecting value: line 1 column 1 (char 0)

I think its a permissions issue.
Not sure what to?

Found out that i have to add in

sudo setcap 'cap_net_bind_service=+ep' /srv/hass/bin/python3

As root…

then i get after restart.

2017-07-02 15:40:21 INFO (MainThread) [homeassistant.components.light] Setting up light.hue
2017-07-02 15:40:21 INFO (Thread-6) [homeassistant.components.light.hue] Emulated hue found, will not add

what shows up when you visit: http://192.168.1.22:80/description.xml

Hi all
Just got a home assistant an will love to connect my lights to it.
So i added the emulated hue to my config.yaml

emulated_hue:
type: google_home
host_ip: 192.168.1.xx
listen_port: 80

After restarting HA i get this errors:

2017-08-01 10:58:25 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.XX’, 80): permission denied
2017-08-01 10:58:46 WARNING (Thread-5) [netdisco.ssdp] Error fetching description at http://192.168.1.xx:80/description.xml

I am running in virtual and i have let’s encrypt on raspberry pi 3.
I tried the commands mention here:

sudo setcap ‘cap_net_bind_service=+ep’ /srv/homeassistant/homeassistant_venv/bin/python3
Igot the fallowing error:
Failed to set capabilities on file `/srv/homeassistant/homeassistant_venv/bin/py thon3’ (Invalid argument)
The value of the capability argument is not permitted for a file. Or the file is not a regular (non-symlink) file

and for:

sudo setcap ‘cap_net_bind_service=+ep’ /srv/hass/bin/python3
Failed to set capabilities on file `/srv/hass/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

Any suggestions are much appreciated.
Thanks
edit:
managed to move in root by using sudo su -
now i get this errors:

root@hassbian:~# sudo setcap ‘cap_net_bind_service=+ep’ /srv/homeassistant/homeas sistant_venv/bin/python3
fatal error: Invalid argument
usage: setcap [-q] [-v] (-r|-|) [ … (-r|-|) ]
Note must be a regular (non-symlink) file.
root@hassbian:~# sudo setcap ‘cap_net_bind_service=+ep’ /srv/hass/bin/python3
fatal error: Invalid argument
usage: setcap [-q] [-v] (-r|-|) [ … (-r|-|) ]
Note must be a regular (non-symlink) file.

and for the:

root@hassbian:~# setcap ‘cap_net_bind_service=+ep’ /srv/hass/bin/python3
Failed to set capabilities on file `/srv/hass/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

See this post:

https://community.home-assistant.io/t/couldnt-find-hue-bridge-emulated-hue-help-w-google-home-device/17516/57?u=firstof9

Hi Thanks so much for your help.
That advance now i have a error in my log:

2017-08-03 20:29:32 WARNING (Thread-5) [netdisco.ssdp] Error fetching description at http://192.168.1.12:80/description.xml 2017-08-03 20:36:53 ERROR (MainThread) [aiohttp.server] Error handling request

If i access 192.168.1.XX/api/pi/lights i get the error:

500 Internal Server Error
Server got itself in trouble

If i insert http://192.168.1.xx:80/description.xml
I get an xml list with:

deviceType>urn:schemas-upnp-org:device:Basic:1HASS Bridge (192.168.1.xx)Royal Philips Electronicshttp://www.philips.com

Any idea what may be the problem? Any suggestion are much appreciated.
Thanks

What shows up when you do: http://192.168.1.12:80/api/pi/lights ?

Can you paste your emulated_hue for your config?

Here’s mine:

emulated_hue:
  type: google_home
  listen_port: 8300
  advertise_port: 80

i get an error

500 Internal Server Error
Server got itself in trouble

and i get few errors in the HA log

2017-08-03 20:29:32 WARNING (Thread-5) [netdisco.ssdp] Error fetching description at http://192.168.1.12:80/description.xml
2017-08-03 20:36:53 ERROR (MainThread) [aiohttp.server] Error handling request

i assume that may have to do something with netdisco or with aiohttp or bout.

Thanks again for your help, much appreciated.

This is what i have in configuration.

emulated_hue:
  type: google_home
  listen_port: 8300
  advertise_port: 80

And you are running this directly on a Raspberry Pi not in a Docker image or anything right?

Yes it is on raspberry pi using hassbian image.
Thanks.

I’m not sure about the hassbian image, I use the AIO installer on a regular raspbian image. :frowning:

Hi
Thanks again fort your response.
I just added the

host_ip: 192.168.1.12

and now i have a component warning:

2017-08-06 14:57:26 WARNING (Thread-7) [homeassistant.components.emulated_hue] When targetting Google Home, listening port has to be port 80

And tells me that listening port have to be 80.

there is my complete config:

[quote=“cameron, post:1, topic:20742, full:true”]
After getting a Google Home for Father’s Day, Am having problems setting up my Google Home with Hue emulator.

emulated_hue:
  type: google_home
  host_ip: 192.168.1.12
# advertise_ip: 192.168.1.12
# Must be 80 for Google Home to see it.
  listen_port: 8300
  advertise_port: 80

Just add like below

emulated_hue:
host_ip: 192.168.1.12
listen_port: 80

And then issue the below 2 commands and restart HA

sudo hassbian-config install hue
sudo setcap ‘cap_net_bind_service=+ep’ /usr/bin/python3.4

Hi
Thanks for your help.
I atempted to fallow your instruction but i get the fallowing error:

pi@hassbian:~ $ sudo setcap ‘cap_net_bind_service=+ep’ /usr/bin/python3.4
fatal error: Invalid argument
usage: setcap [-q] [-v] (-r|-|<caps>) <filename> [ ... (-r|-|<capsN>) <filenameN> ]

 Note <filename> must be a regular (non-symlink) file.

Any suggestions?

What kind of HA do you install? Hassbian, All-in-one, Hass.io?
I am using the Hassbian and the 2 command was issued properly.
Of course, the emulaged hue is working well.

Hi
Thanks for your response.
I am using raspberry pi 3 with hassbian 0.50.1.
It looks that hue was installed i can access: http://192.168.1.12:80/api/pi/lights
but i think cannot see any of my lights or switches.
Google Home added Philips Hue but again cannot find any devices.
I am tempted to do a fresh reinstall and falow your advise and see if will work.
Thanks again.

Hi,
What did you do to be able to view the :80/api/pi/lights ? I am suffering the same problems as yourself and getting the 500 internal server error. I have followed everything in this thread with no luck.

Do you have hassbian or hassio?
hassio has a issue raised already: https://github.com/home-assistant/home-assistant/issues/8740
For me that error stooped when i fallowed the description that af950833 gave above although his second line in his description did not work for me.
But it recognize the hue in HA although it have nothing in it.
i am doing a fresh install and see what will happen.
Update
same error in the fresh install oh hassbian

I am running hassbian at the moment, i tried af950833 process but no change. I think his line 2 is wrong the inverted comma before cap and after ep should be an accent ’