0.66 changes for Hue

That’s odd, because as mentioned above the sensors are the only bit of the Hue setup that is working. It’s only displaying the lights that’s an issue.

image

I will have a look at the dbug instrutions a bt later today…

I am certainly willing to test.

same here, (though i have other errors in the log and Hassio won’t connect anymore) : CC working fine, Hue light is causing horrible issues, switching between available and unavailable…
tried all options, discovery, manual, both. you name it. Problems arose when with the latest updates to .68.0 and .1, Hue is implemented natively.

Hopefully a 68.2 is due and solves these issues.
hue.hue_activate_scene is not behaving as it should either, which is a terrible shame, because it is such an elegant integration and was working just perfectly fine… #fingerscrossed

Just upgraded to 0.69.0, and still cant see the Hue lights.

To rule out the CC I have tried removing this from te sensors section, and thi makes no difference - other than not being able to see my sensors as well. :rofl:

Guessing that the relivant part of the error in the home-assistant.log is

2018-05-12 14:10:25 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Philips hue for hue
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/homeassistant/config_entries.py", line 185, in async_setup
    result = await component.async_setup_entry(hass, self)

HI @robmarkcole

after deleting all in the /config/deps folder, following @balloob instruction, and updating to Hassio .68 and now 0.69.1, a new set of files is installed there:

as I notice only now, this file has a creation date that predates my RaspberryPi… :wink: remarkable.

would/could this in any way have something to do with the CC’s sensors being created? Thought them to be glorified rest-sensors that wouldn’t need anything else installed.

I ask because lights.hue platform keeps throwing errors since the new implementation in Hassio

018-05-13 17:16:48 ERROR (MainThread) [homeassistant.components.hassio.handler] Timeout on /supervisor/ping request
2018-05-13 17:16:48 ERROR (MainThread) [homeassistant.components.hassio] Not connected with Hass.io
2018-05-13 17:16:48 INFO (MainThread) [homeassistant.setup] Setup of domain hassio took 12.6 seconds.
2018-05-13 17:16:48 ERROR (MainThread) [homeassistant.setup] Setup failed for hassio: Component failed to initialize.
2018-05-13 17:16:50 ERROR (MainThread) [homeassistant.components.light.hue] Unable to reach bridge 192.168.1.212

and this deps folder contents seems the only thing unexpected…

btw the bridge is fine, and all other instances find it without issue, so this error is completely incomprehensible …

cheers,
Marius

I’m not up to speed with all the changes to the Hue hub component, suggest opening an issue on the HA repo.

there are already many…:wink:

but you can confirm that your CC doesnt need the files and installed these in the folder as described?

I’m on holiday so can’t dig into this. Please see my previous comments on this exact topic

enjoy, sorry to bother!
Ive deleted the files and the CC works just fine without them, so must be caused by something else.
Cheers,
Marius

1 Like

beginning to see the light, just thought I’d share. Not sure im completely spot on, but the beginning is here:

for each sensor:

corridor_motion_sensor_lux:
  friendly_name_template: >
    Corridor: 
    {% set lux = states.sensor.corridor_motion_sensor.attributes.lux %}
    {%- if lux <=1 %}
      moonlight
    {%- elif lux <=2 %}
       night light
    {%- elif lux <= 10 %}
       dimmed light
    {%- elif lux <= 50 %}
       ‘Cosy’ living room
    {%- elif lux <= 150 %}
       ‘Normal’ non-task light
    {%- elif lux <= 350 %}
       working / reading
    {%- elif lux <= 700 %}
       inside daylight
    {%- elif lux <= 2000 %}
       maximum to avoid glare
    {%- elif lux <= 10000 %}
       clear daylight
    {%- elif lux <= 120000 %}
       direct sunlight
    {%- else %}
       Too bright
    {%- endif %}
  value_template: >
    {{states.sensor.corridor_motion_sensor.attributes.lux}}
  device_class: illuminance


corridor_motion_sensor_light_level:
  friendly_name_template: >
    Corridor: 
    {% set light_level = states.sensor.corridor_motion_sensor.attributes.light_level %}
    {%- if light_level <=1 %}
      bright moonlight
    {%- elif light_level <=3000 %}
      night light
    {%- elif light_level <= 10000 %}
      dimmed light
    {%- elif light_level <= 17000 %}
      ‘cosy’ living room
    {%- elif light_level <= 22000 %}
      ‘normal’ non-task light
    {%- elif light_level <= 25500 %}
      working / reading
    {%- elif light_level <= 28500 %}
      inside daylight
    {%- elif light_level <= 33000 %}
      maximum to avoid glare
    {%- elif lux <= 40000 %}
      clear daylight
    {%- elif light_level <= 51000 %}
      direct sunlight
    {% else %}
      too bright!
    {% endif %}
  value_template: >
    {{states.sensor.corridor_motion_sensor.attributes.light_level}}
  device_class: illuminance

and some customizing to adjust further:

sensor.corridor_motion_sensor_light_level:
  icon: mdi:theme-light-dark 
  templates:
icon_color: >
  if (state < 1) return 'rgb(0,0,0)';
  if (state < 3000) return 'rgb(51,0,0)'; 
  if (state < 10000) return 'rgb(51,25,0)';
  if (state < 17000) return 'rgb(102,51,0)';
  if (state < 22000) return 'rgb(153,153,0)';
  if (state < 25500) return 'rgb(102,204,0)';
  if (state < 28500) return 'rgb(51,255,53)';
  if (state < 33000) return 'rgb(102,255,178)';
  if (state < 40000) return 'rgb(153,255,255)';
  return 'rgb(204, 255, 229)';

sensor.corridor_motion_sensor_lux:
  templates:
icon_color: >
  if (state < 1) return 'rgb(0,0,0)';
  if (state < 2) return 'rgb(51,0,0)'; 
  if (state < 10) return 'rgb(51,25,0)';
  if (state < 50) return 'rgb(102,51,0)';
  if (state < 150) return 'rgb(153,153,0)';
  if (state < 350) return 'rgb(102,204,0)';
  if (state < 700) return 'rgb(51,255,53)';
  if (state < 2000) return 'rgb(102,255,178)';
  if (state < 7000) return 'rgb(153,255,255)';
  return 'rgb(204, 255, 229)';
  icon: mdi:theme-light-dark

not really sure what the device_class luminance does just yet, probably set an icon which I override right now, but happy experimenting!
Cheers,
Marius

@Mariusthvdb this may help with your issues.

Finally had a bit of a chance to play with this. Curranty running version 70.1. Situation was that the Custom Component for the sensors was working, but all of the lights for the Philips Hue lights were not visible.

It is also worth noting the under the Hamburger > Configuration >Integrations the Philips Hue component wasn’t showing correctly. Previously under the available section “deCONZ” was first on th list, the secnd item was blank, and the third item was “Zone”. Under Configured the Hue was showing “setup_error”. This is now fixed.

For me the steps to show both the CC and the lights were,

  • Removed the philipshue entry from known_devices.yaml
  • Renamed the /config/custom_comonents directory
  • Commented out the following in the following in configuration.yaml
    Hue: bridge section
    include sensor.yaml
  • Restarted HASSIO

The Autodiscover then rediscovered the hue Bridge correctly

Note though that there is no hue: entry in configuration.yaml, but it works!

The lights now loaded in the web interface, but (obviously) the Hue sensor did not.

So, I then,

Note: The Hue firmware looks like it has upgraded itself in the last few days, and it looks like the light level sensor has ben renamed from states.sensor.lounge_motion_sensor.attributes.lux to states.sensor.lounge_motion_sensor.attributes.lx.

Now the lights and custom component (sensors) are showing. I suspect that the issue had something to do with previous verion of the CC setup being there. If I look at the renamed custom_components directory there was a sensor sub directory containing hue.py, but there was also a custom_components/hue.py and associated files.

thanks.
my Hue is added by import, not discovery, nor user.

56 Ive manually added it via the hue: option.

Working fine as far as I can see for the moment, albeit disconnecting/conecting in the logs…

even the hue.hue_activate_scene is working fine in my setup.
btw, there should be not hue.py any longer in the cc folder, so if you had it there that was a main reason for hickup, as documented.

Indeed, lux is lx now, and the CC is changed accordingly. Working fine also.