-
Hi! I'm new to Home Assistant and pyscript and am LOVING it so far. One thing I don't understand is the interaction between pyscript and other installed integrations. @event_trigger("hue_event", "id == 'office_button' and type == 'short_release'")
def turn_off_lights(**kwargs):
light.toggle(area_id="office") This works as expected. My lights are toggled on or off in the office. However, I'm running the Adaptive Lighting integration and when that pyscript event is triggered an error is logged. Adaptive Lighting seems to do it's job correctly even when the error is logged, but the error is not logged if I simply use the hue app to control the switch and toggle the lights. Here's the function and line in question from Adaptive Lighting. Is there some other service event I need to trigger to work with Adaptive Lighting, or maybe some other precaution to take when other integrations are also reacting to events? Thanks for any insight! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
The adaptive light integration is expecting an "entity_id" in the data you send to the service call, but you've sent only "area_id". The light still turns on because the light platform supports this. It has nothing to do with pyscript. If you use the "developer pane" in home assistant and issue the same service call, you should get the same error. Or, if you write a Native Home Assistant automation that makes the same service call you should see the error then too. I don't use areas in my setup, so I don't follow Home Assistant changes in there too closely. However, I know that sending only an area_id wasn't supported in the past. So, this might be a newer feature that Adaptive Lighting has not been updated to support. This works without the error when using the Hue app because the Hue App controls the light outside of Home Assistant and the light reports its state after the change. |
Beta Was this translation helpful? Give feedback.
The adaptive light integration is expecting an "entity_id" in the data you send to the service call, but you've sent only "area_id". The light still turns on because the light platform supports this. It has nothing to do with pyscript. If you use the "developer pane" in home assistant and issue the same service call, you should get the same error. Or, if you write a Native Home Assistant automation that makes the same service call you should see the error then too.
I don't use areas in my setup, so I don't follow Home Assistant changes in there too closely. However, I know that sending only an area_id wasn't supported in the past. So, this might be a newer feature that Adaptive Lighting h…