Currently there is no simple way to flash lights in their current state without having to write a script in order for the flash to behave as desired.
The Philips Hue API allows you flash lights with the alert:select and alert:lselect API call but the only way to make that API call currently with HA is by turning a light on. After its finished flashing it stays on. There is no way to flash a light that is off and have it return to the off state without another API call.
I propose a new light/flash service that simply makes use of the alert:select Hue API calls to complement the existing light/on, light/off and light/toggle service.
I realise there ways to control this behaviour by writing a script, but Iām all about keeping it simple. =)
If I knew how to write Python code Iād do it myself and send a pull request but I donāt (yet).
You need to change your focus not only to one device. HA lookup on all device class and make a standard call for all class. You can send turn_on with effect option. HA handle all in a same way and support a lot of components. I donāt think he make a bad api change for only one device class for one componentā¦
Would it be possible then to have different components handle the same call in a way that works best for them?
e.g. the lights/flash service on the Hue component simply calls the native āalertā:āselectā function but for a different light component, it checks state, stores it and toggles light a few times and restores previous state?
I disagree with @pvizeli and think that your point is valid. And I think your approach in the last post is certainly reasonable. And I donāt think requesting support for a native function on a platform is a bad API change either.
I found that if enough people ask for something, somebody here figures out a way to accomplish it. Whether that code makes it into HAās codebase is entirely up to the development team.
Thats true, you can call a device spezific function with a own service like sonos. Its not very dificult to create a service like light.hue_alert. only pyhue need suport that native function befor you can use it on HA for split device, vendor logik from core.
Or make a service like light.hue_effect they want support more things than only flash
from looking at the code I think it does support āalertā
@property
def alert(self):
'''Get or set the alert state of the light [select|lselect|none]'''
self._alert = self._get('alert')
return self._alert
@alert.setter
def alert(self, value):
if value is None:
value = 'none'
self._alert = value
self._set('alert', self._alert)
yeah Iāve had a poke around the code too and whatās missing is a specific service in HASS that properly utilises this function. Iām still not at the stage where I can write the service myself and submit a PR. But Iām working on it. (Just donāt hold your breath!)