All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- The entire old
io.github.zeroone3010.yahueapi.Hueclass. Useio.github.zeroone3010.yahueapi.v2.Hueinstead. Not every method might yet be available with it yet, but most, anyway. With this, also the related classes, returned by the various method there, were removed; use the ones used by the newHueclass instead. - Support for HTTP. Only HTTPS is supported anymore. Should work both with the updated Bridges that have a Signify-signed certificate and the older Bridges that have a self-signed certificate. With this change certain constructors have been removed. The same ones should still be present without the protocol, so the migration guide is to just remove the offending parameter.
- Updated dependencies, most importantly okhttp-eventsource from 2.x.x to 4.x.x.
Hue#getBridgeIp()method that returns the technical ID of the Bridge.- Made the
Color(float,float,float)constructor public, no need to use the staticColor.of(float,float,float)method anymore if you prefer not to.
addLight(Light)andremoveLight(Light)methods for theGroupclass.- Proper support for motion sensors in the new API version: they are now represented with a new
MotionSensorinterface that has anisMotion()method for checking for motion, and agetLastChanged()method for getting the last time the status was updated. - Support for temperature sensors in the new API version: the v2
Hueobject now has agetTemperatureSensors()method. TheTemperatureSensorcan return the temperature both in degrees Celsius and Fahrenheit. - Support for Bridge certificates signed by the Signify CA. This may still cause issues with older Bridges that are still using self-signed certificates, so please check everything! The default setting in this library should be to use the "unverified HTTPS" option everywhere, as that works with the older self-signed certificates too.
- Support for scenes. Use the
getScenes()andgetSceneByName(String)methods in theGroupobjects. Call theactivate()method of aSceneto activate it. - Support for the
prismeffect. - Documentation for version 3.0.0 into the README.md file. Docs for version 2 of the library can still be found from README_v2.md.
- Added default enum values to be used in case new effects or some such variables are introduced into the API. (Fixes #59)
- Support for events! Use the new
io.github.zeroone3010.yahueapi.v2.Hueclass and itssubscribeToEvents(HueEventListener)method to get real time updates from the Bridge when something happens in the system.
- Removed UPNP from Bridge discovery methods, as Philips is deprecating it.
- Removed plain HTTP as a possible Bridge connection protocol, as Philips is deprecating it. With this removal
also removed the constructor from the
Hueclass that hadHueBridgeProtocolas a parameter, as the enum now only has one value. Also changed said enum from public to package private.
getRooms(),getZones(),getRoomByName(), andgetZoneByName()methods from theio.github.zeroone3010.yahueapi.Hueclass in favor of the methods with the same names (if not the same signatures) in theio.github.zeroone3010.yahueapi.v2.Hueclass. Note that the deprecated methods returnCollections of objects, whereas the new methods returnMaps, where the key is the unique id of the entity, and the value is the entity itself. Just call the.values()method of such aMapif you still want to iterate through all the values like before.
- A new method,
HueBridgeConnectionBuilder.isHueBridgeEndpoint(), to test whether you are indeed trying to connect to a Hue bridge and not some other server by accident (contributed by @Kakifrucht) getId()method forSceneobjects, to get the technical ids of scenes.
- The
java.util.loggingbased loggers have been scrapped in favor of SLF4J (contributed by @Kakifrucht)
- Added a way to search for new lights in the system: the
searchForNewLights()method in theHueclass. It is accompanied by thegetNewLightsSearchStatus()method, which, however, you do not need to use when searching for new lights, as the first method will resolve aFuturewith a collection of the new lights found, if any. - Added mDNS (multicast DNS) as a new Bridge discovery method. This will be used instead of UPNP which Philips will disable in the future.
- Added
Room.addLight(Light)andRoom.removeLight(Light)methods for adding and removing lights to and from rooms.
- Changed System.out.println commands into proper logger calls.
- Changed logger names into
io.github.zeroone3010.yahueapi.
- Fixed a possible
NullPointerExceptionwhen querying temperature from a temperature sensor if the sensor is disabled in the app (now it just returnsnullinstead).
- Bridge connections are now using HTTPS by default, for the plain HTTP connections have been scheduled for deprecation by Philips. Note, however, that as many bridges still have self-signed certificates which cannot really be validated anyway, this means that by default all certificate validations will be turned off. If the Hue bridge is not the only system that your application talks to, you should consider whether this is an issue for you. Eventually Philips will update the bridges to use a Signify root certificate, after which sensible validation can be performed.
- Deprecated the UPnP bridge discovery method, for Philips has announced it has been scheduled to be disabled in Q2 2022.
- Deprecated plain HTTP as a communication protocol with the bridge, again due to Philips deprecating it too
getAllLights()method for theHueobject, returning aRoomobject with all the lights that the Bridge knows about. This is a convenience method provided by the Hue API itself, and it allows you to easily toggle all the lights in the system at once.getMaxLumens()method forLightobjects. With the recent addition of 1600 lumen bulbs into the Hue family, it seemed like a good idea to be able to differentiate the brighter lamps from the dimmer ones.getId()method forLightandRoomobjects. Requested by users, these methods may be needed for advanced use cases.
- Support for effects. Just like alerts, effects can be activated with the light
State. The Hue API currently supports only one type of effect: the color loop. It cycles indefinitely through all the hues using the current brightness and saturation settings. The color loop effect can be activated with the.setState(State.COLOR_LOOP_EFFECT)method of a light, and subsequently stopped with.setState(State.NO_EFFECTS). turnOn()andturnOff()methods for theRoominterface, for toggling all the lights in a room or zone.
- More Javadoc documentation
- Fixed possible null pointer exceptions, should the Bridge ever return any collections (lights, sensors, etc) as
null. This is probably not possible with the actual Hue Bridge, but there are emulator systems that may behave like this. - Handle unauthorized user error more gracefully, explaining the situation in the exception.
- Support for alerts. Alerts can be activated with the light
State. There are two types of alerts currently supported by the Hue API: short alerts, i.e. one "breath cycle", and long alerts, where the light blinks for 15 seconds, or until the alert typeNONEis issued. - More Javadoc documentation
- Fixed a
NullPointerExceptionwhen trying to read the daylight status from a daylight sensor that had not been configured. Now it will just returnfalseand log a warning message when queried. The need to configure such a sensor has also been explained in the Javadoc of theDaylightSensorImplclass.
This release contains several breaking changes. This means that if you have been using a previous version of this library, you may need to change your code to account for the changes in this version. See below for the details. Also, many thanks to everyone who contributed issues and pull requests!
- Support for other kinds of switches than just the Philips Hue dimmer switches.
getUnassignedLightByName(String)method, to accompany thegetUnassignedLights()method added in the previous release.- Added geofence support as presence sensors. They can be retrieved like all motion sensors with
getPresenceSensors()orgetPresenceSensorByName(String)with the name of a registered device. - Added ambient light sensor support.
- Support for Android, thanks to the removal of the dependency to the
java.awt.Colorclass (see below).
- Changed how switches are handled: Philips Hue dimmer switches are no longer considered special in any way.
Instead, all switches are equal and can be accessed with the new
Switchinterface. TheHueclass now hasgetSwitches()andgetSwitchByName(String)methods instead of the oldgetDimmerSwitches()andgetDimmerSwitchByName(String)methods. LightType.ON_OFFenum value was renamed toLightType.ON_OFF_LIGHTto better distinguish it from theON_OFF_PLUGIN_UNITvalue.- Light color is to be set with the new
io.github.zeroone3010.yahueapi.Colorclass. The class contains a multitude of factory methods, so that the transition from the oldjava.awt.Colorwould be as easy as possible. This change was made to remove the dependency on thejava.awtpackage, which is not available in the Android environment. - Motion sensors renamed to presence sensors to account for the addition of geofence sensors. This means that in the
HueclassgetMotionSensors()andgetMotionSensorByName(String)methods have been renamed togetPresenceSensors()andgetPresenceSensorByName(String)respectively.
DimmerSwitch,DimmerSwitchAction,DimmerSwitchButton, andDimmerSwitchButtonEventclasses. These have basically been replaced with theSwitch,SwitchEvent,Button, andButtonEventclasses.- Setter methods accessible with the
getRaw()method. Some of these were deprecated in v1.1.0 already.
- Support for Smart Plugs: they will appear in the API with the type
LightType.ON_OFF_PLUGIN_UNIT - Support for lights that do not belong to any group or zone: accessible using the
getUnassignedLights()of theHueobject
- Deprecate the
LightType.ON_OFFenumeration value: this one will be renamed toON_OFF_LIGHTin the future
- Fixed issue #15:
the
HueBridgeDiscoveryServicereturnedHueBridgeobjects with their name and IP address reversed
- Bridge discovery: possibility to find any Bridges in the current LAN. UPnP and N-UPnP methods supported.
- Resourcelinks, accessible with the
getRaw()method - Scenes, accessible with the
getRaw()method - Possibility to activate a scene for a room
- Other types of light groups besides just lights and zones are now supported too
setCaching(boolean)method. This caches the Bridge state (i.e. light, sensor and room states) and stops querying the Bridge unless explicitly told to do that by using therefresh()method, or until caching is disabled again.setBrightness(int)method forRoomobjects.
- Support for zones
- Getter methods for certain properties accessible with the
getRaw()method
- Certain setter methods accessible with the
getRaw()method
- Initial release