diff --git a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/HueBindingConstants.java b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/HueBindingConstants.java index 67af11d4c..1f93315fe 100644 --- a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/HueBindingConstants.java +++ b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/HueBindingConstants.java @@ -87,6 +87,7 @@ public class HueBindingConstants { public static final String CHANNEL_STATUS = "status"; public static final String CHANNEL_FLAG = "flag"; public static final String CHANNEL_SCENE = "scene"; + public static final String CHANNEL_TYPE_2_SCENE = "scene-v2"; // List all triggers public static final String EVENT_DIMMER_SWITCH = "dimmer_switch_event"; diff --git a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/handler/Clip2ThingHandler.java b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/handler/Clip2ThingHandler.java index f3e1291bc..e305d1175 100644 --- a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/handler/Clip2ThingHandler.java +++ b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/handler/Clip2ThingHandler.java @@ -82,9 +82,11 @@ import org.openhab.core.thing.ThingUID; import org.openhab.core.thing.binding.BaseThingHandler; import org.openhab.core.thing.binding.BridgeHandler; import org.openhab.core.thing.binding.ThingHandlerService; +import org.openhab.core.thing.binding.builder.ChannelBuilder; import org.openhab.core.thing.binding.builder.ThingBuilder; import org.openhab.core.thing.link.ItemChannelLink; import org.openhab.core.thing.link.ItemChannelLinkRegistry; +import org.openhab.core.thing.type.ChannelTypeUID; import org.openhab.core.types.Command; import org.openhab.core.types.RefreshType; import org.openhab.core.types.State; @@ -1238,6 +1240,14 @@ public class Clip2ThingHandler extends BaseThingHandler { State state = scenes.stream().filter(s -> s.getSceneActive().orElse(false)).map(s -> s.getSceneState()) .findAny().orElse(UnDefType.UNDEF); + // create scene channel if it is missing + if (getThing().getChannel(CHANNEL_2_SCENE) == null) { + updateThing(editThing() + .withChannel(ChannelBuilder.create(new ChannelUID(getThing().getUID(), CHANNEL_2_SCENE)) + .withType(new ChannelTypeUID(BINDING_ID, CHANNEL_TYPE_2_SCENE)).build()) + .build()); + } + updateState(CHANNEL_2_SCENE, state, true); stateDescriptionProvider.setStateOptions(new ChannelUID(thing.getUID(), CHANNEL_2_SCENE), scenes