home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.14k stars 29.81k forks source link

Integration HUE: Services broken when using transition attribute #62608

Closed chrismanivong closed 2 years ago

chrismanivong commented 2 years ago

The problem

I'm getting errors like this:

400, message='Bad Request', url=URL('https://x.x.x.x/clip/v2/resource/light/3d74cf1c-7b9d-4353-ab63-64f7ca175310')

when executing service commands below.

All those commands are working without the attribute transition.

What version of Home Assistant Core has the issue?

2012.12.04

What was the last working version of Home Assistant Core?

2012.11.5

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Philips Hue

Link to integration documentation on our website

No response

Example YAML snippet

service: light.turn_on
entity_id: !input light
data:
  transition: "{{ light_transition / 1000 }}"

service: light.turn_toggle
entity_id: !input light
data:
  transition: "{{ light_transition / 1000 }}"

service: light.turn_off
entity_id: !input light
data:
  transition: "{{ light_transition / 1000 }}"

Anything in the logs that might be useful for us?

400, message='Bad Request', url=URL('https://x.x.x.x/clip/v2/resource/light/3d74cf1c-7b9d-4353-ab63-64f7ca175310')

Additional information

I experienced this behaviour with most lights (Philips and Ikea) on Philips Hue Hub v2. It seems, that only light stripes are working with transition anymore. Maybe this is related to a change in current Hue bridge firmware.

marcelveldt commented 2 years ago

You need to send transition in seconds...

chrismanivong commented 2 years ago

You need to send transition in seconds...

Before this was doing with 250msec. So the calculation will print "0.25" sec.

chrismanivong commented 2 years ago

It's working with one digit after a point or a comma.

EDIT:

I think we should limit the input on transitions by rounding to 0.1. Would that be an idea for an improvement on next version?

marcelveldt commented 2 years ago

Hue accepts transitions in steps of 100ms. Looks like the new API is actually enforcing that ;-) I'll put a rounding in the code, thanks!

probot-home-assistant[bot] commented 2 years ago

hue documentation hue source (message by IssueLinks)

probot-home-assistant[bot] commented 2 years ago

Hey there @balloob, mind taking a look at this issue as it has been labeled with an integration (hue) you are listed as a code owner for? Thanks! (message by CodeOwnersMention)