OSRAM Lightify bulbs with Philips Hue Hub

I am using two OSRAM Lightify bulbs with Philips Hue hub. If you have no OSRAM Lightify hub like me, you first had to reset the bulbs (On/Off 5 times). Then the inclusion works fine with the philips hue app - even with the older firmware on the bulbs.

There is only one problem. With home-assistant you cannot switch them off. They stay on. I guess this is related to the old firmware on the bulbs.

But I found a solution: You can send the bulbs a command over the Philips Hue hub. Therefor I created an command_line switch and use it in my automations:

- platform: command_line
  switches:
    buero_licht_tuer:
      command_on: "curl --silent -XGET -H 'Content-Type: application/json'  http://[*** address of your philips hue hub ***]/api/[*** your generated user - see below ***]/lights"
      command_off: "curl --silent -XPUT -H 'Content-Type: application/json' -d '{\"on\":false,\"transitiontime\":0}' http://[*** address of your philips hue hub ***]/api/[*** your generated user - see below ***]/lights/[*** number of the bulb in philips hue hub ***]/state"

You have to replace [*** … ***] with your own values.

The command_on isn’t really necessary. With homeassistant you can already switch them on. Please look at command_off. There is a json which you must send to turn the bulbs off - -d ‘{“on”:false,“transitiontime”:0}’

To learn the api of Philips Hue see https://www.developers.meethue.com/documentation/getting-started. There you can also find information on how to generate a userid which you need to call the api.

Hope this help. I spent some time doing this.

1 Like

I’m using only Osram bulbs and they work OK. Just update your bulbs :slight_smile:

How can you do this without a lightly gateway?

Well… Not…

I do this a slightly different way because I find that even the Hue app struggles to turn off these lights (leaves them at their dimmest instead).

The issue is because they don’t particular like the way the hue app transitions them to ‘off’ over 40ms.

What I’ve done is setup an automation when they are ‘switched off’ which then runs a scene which sets them to proper off by running without a transition time. The only problem is that they go dim for a few seconds before switching off, but this isn’t a issue as they are motion controlled so I rarely see them in this ‘dim’ state.

automation:
- alias: Turn off Landing Lights
  trigger:
    - platform: state
      entity_id: light.landing_1,light.landing_2
      from: 'on'
      to: 'off'
  action:
    - service: homeassistant.turn_on
      entity_id: scene.landing_off

scene:
- name: landing_off
entities:
    light.landing_1:
        state: off
        transition: 0
    light.landing_2:
        state: off
        transition: 0

Can you please post an example of automation using this?

Cheers