Philips Android TV Ambilights (Light) component


#31

In my opinion, ambilight+hue on/off would be a really great addition for this component. I don’t have a problem to easily access this feature from the TV menu, however, I hate the fact that it keeps the lights on even if I turn off the TV. Therefore, would really like to automate it.


#32

Sorry for asking again, but I’d really like to enable this for my 9002 too. I copied the error in my post above.
Maybe the developer of this component can tell why it is failing.


#33

Sorry for the inactivity, I’m currently mid exam season at university, but id be happy to try adding that to the component as soon as I’m done (end of January) it shouldn’t be too hard at all. I won’t be able to test it however as I don’t own any hue compatible bulbs, if people are still interested in a couple of weeks, I will post it here for testing before updating the component on GitHub.


#34

Sorry to hear it’s not working for you, (and that I havent seen this for so long!) perhaps the API calls are different for other models? It seems to be failing on the api request for the ambilights current configuration, which works no problem for me (43PUS7303/12), I can have a look for you after the end of the month when my schedule clears up abit :slight_smile:


#35

Is it the ambilight+hue on/off that you would like to automate? I have noticed the lights remaining on after I turn the tv off manually (if I have turned the ambilights on with this component), but a solution may be to use the tv (meda_player) component to detect the tv turning off, and automate the ambilights turning off whenever it does so


#36

Awesome! If you need help adding ambilight+hue switch and testing it, I’ll be glad to help, just PM me when you get to it! Good luck with the exams, man!


#37

Yes, that is my idea but to implement it we need to have implemented ambilight+hue on/off/status component or switch. So far, I can turn on and off it using a customer switch component, however, I cannot find a solution to see the status. Also, I think it would be reasonable to have this feature as part of ambilight component rather than a separate one.


#38

To check the status of ambilight + hue @jomwells has to send a post request to https://ip-address:1926/6/menuitems/settings/current with a body:
{"nodes":[{"nodeid":2131230774}]}

The response will be like this:
{"values":[{"value":{"Nodeid":2131230774,"Controllable":true,"Available":true,"string_id":"Switch on","data":{"value":false}}}],"version":0}

Where “value:false” means it’s off and “value:true” means its on.

I still need to implement clean responses in my python tool (so it can be used as a command line sensor in HA), but that will probably take some time since first I need to finish testing and documenting all endpoints in the API and I haven’t been able to use my TV for testing for the past couple of weeks…


#39

Thank you, I’ve tried to use command line sensor for controlling status and using the response you provided, however, I did’t succeed for some reason. I really hope you’ll be implemented it soon.


#40

That would be really nice, would be so cool to use the ambilights.


#41

@gyrga @Molodax, Right, I’m back, having looked at that python tool (fantastic by the way) it should be quite straight forward (in terms of the code) to add these ambilight+hue features into home assistant, but how do you think this should be done? Currently, for the extra features (the effects) i’m using the built in effects drop down for the individual light, but I don’t see an option for adding a secondary switch within the ambilight (light) panel itself, I wonder if it would be better to try and create a seporate remote component, combining many of the features in the python script (power on/off, navigation, launching apps etc) and having the +hue switch as a part of that, keeping the RBG light control as a separate entity? what are your thoughts
The only other option would be to add an Ambilight+Hue OFF and Ambilight+Hue ON ‘effect’ within the drop down, which would allow automation, but is essentially a work around


#42

I think just adding them as a service will be a big thing. One can create shortcuts if they want to expose the functionality in the UI.


#43

For anyone interested in automating the Ambilight+Hue setting, I have put together a Switch component using most of the code from the Ambilight Light component, this quickly adds support for Ambilight+Hue status (while the tv is available) and switching on/off from Home Assistant, note, there is a bit of a lag between HA sending the on/off request, and registering it change, therefore it is advised to decrease the scan_interval in your configuration.yaml, enjoy :slight_smile:


#44

Hi did you have time to look further into this. I’d still like to have this too.


#45

Are you guys able to turn on the Ambilight on even if the TV wasn’t on for a while. My ambilight goes unavailable about 5min after I turn the Tv to standby (WoWLAN enabled).

I saw this:

Known Issues

  • The light component can turn the Ambilights on when the TV is off, however, after the TV has been in standby for a long period of time, the component will loose connection, and will be unable to turn the lights on again until the TV is woken up and reconnects - this can be solved by manually turning on the TV and then changing the ambilights, or through the use of an IR blaster connected to Home Assistant to achieve the same result.

But it says for a long period of time, mine goes offline a few minutes after. Not quite a long period of time.

Or should this feature only be used when the TV is on. I thought I could use the light without the TV on with this component, but I can only use it like this for liek 5min (see above).


Philips Android TV component
#46

I still have the unavailabilty question from above but I ran into another issue.

With the example from above my automation looks like this

- alias: Ambilight - TV follows Light
  initial_state: 'on'
  trigger:
    - entity_id: light.sphere
      platform: state
  condition:
    - condition: template
      value_template: "{{ not is_state('light.ambilight', 'unavailable') }}"
  action:
    - service: light.turn_on
      entity_id: light.ambilight
      data_template:
        brightness: '{{ states.light.sphere.attributes.brightness|int }}'
        xy_color: ['{{states. light.sphere.attributes.xy_color[0]|float}}','{{states. light.sphere.attributes.xy_color[1]|float}}']

While xy_color works, the brightness value does not get set.

If I set it in the service tab in home assisant like this

{
  "entity_id": "light.ambilight",
"brightness": "75"
}

it works, but it does not follow this line

brightness: '{{ states.light.sphere.attributes.brightness|int }}'


#47

mine was working well but all of a sudden it is now unavailable all the time, tv on or off? any idea please?


#48

That is a known issue with this component, I think it was mentioned above somewhere in this thread, it is due to the way the jointspace API handles brightness commands - as of yet, the brightness will only be set if it is set to FOLLOW_COLOR, and you cannot set both brightness and colour in the same POST request - im sure this could be improved upon, but it would require rewriting the component (If anyone else has the time to do this, I would be happy to change it on the github repo :smiley: )


#49

To anyone having problems with availiability - this wont completely solve your problem (TV can still enter deep sleep at times) but try enabbling the wake on LAN setting in the TV’s settings app, that is the only difference I can think of, the ambilight component works for a long period of time after the TV switches off for me currently


#50

Great work! I’m just curious about something… Any chance this component lets us use Xiaomi Yeelight/led stripes?

Something like this:

I have a full Xiaomi lights setup and don’t want to buy a new Philips Hue setup.

Thanks!