## Channels
| Thing | Channel | Note |
-| ---------------------------------------------------------------------------------- | ------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+|------------------------------------------------------------------------------------|---------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| bridge | N.A | bridge does not expose any channel |
| gateway | status | status of your gateway |
| gateway | scenarios | used to run the scenarios defined in the cloud portal |
| window | control | device controller which reacts to commands UP/DOWN/ON/OFF/OPEN/CLOSE/STOP + closure 0-100 |
| silent roller shutter | silent_control | similar to control channel but in silent mode |
| venetian blind, adjustable slats roller shutter, bioclimatic pergola | orientation | percentual orientation of the blind's slats, it can have value 0-100. For IO Homecontrol devices only (non RTS) |
-| venetian blind, adjustable slats roller shutter | closure_orientation | percentual closure and orientation of the blind's slats, it can have value 0-100. For IO Homecontrol devices only (non RTS) |
+| venetian blind, up/down venetian blind, adjustable slats roller shutter | closure_orientation | percentual closure and orientation of the blind's slats, it can have value 0-100. For IO Homecontrol devices only (non RTS) |
+| up/down venetian blind | tilt | tilt of the blind's slats, it can have value -5 to 5 (negative or positive tilt). Works even for RTS blinds |
| adjustable slats roller shutter | rocker | used for setting the rocker position of the roller shutter, the only position allowing the slats control |
| bioclimatic pergola | slats | slats state (open/closed) |
| bioclimatic pergola | pergola_command | used for controlling biclimatic pergola (closeSlats, openSlats, stop) |
// Venetian Blind
public static final ThingTypeUID THING_TYPE_VENETIANBLIND = new ThingTypeUID(BINDING_ID, "venetianblind");
+ // Up Down Venetian Blind
+ public static final ThingTypeUID THING_TYPE_UPDOWNVENETIANBLIND = new ThingTypeUID(BINDING_ID,
+ "updownvenetianblind");
+
// Exterior Screen
public static final ThingTypeUID THING_TYPE_EXTERIORSCREEN = new ThingTypeUID(BINDING_ID, "exteriorscreen");
public static final String CONTROL = "control";
public static final String MOVING = "moving";
+ // Up down venetian blind
+ public static final String TILT = "tilt";
+
// Adjustable slats roller shutter
public static final String ROCKER = "rocker";
public static final int TYPE_BOOLEAN = 6;
public static final String UNAVAILABLE = "unavailable";
public static final String TEMPORARILY_BANNED = "Too many attempts with an invalid token, temporarily banned.";
-
public static final String TOO_MANY_REQUESTS = "Too many requests, try again later";
public static final String EVENT_LISTENER_TIMEOUT = "No registered event listener";
public static final String AUTHENTICATION_OAUTH_GRANT_ERROR = "Provided Authorization Grant is invalid.";
public static final String COMMAND_SET_TARGET_TEMPERATURE = "setTargetTemperature";
public static final String COMMAND_REFRESH_DHWMODE = "refreshDHWMode";
public static final String COMMAND_REFRESH_BOOST_MODE_DURATION = "refreshBoostModeDuration";
+ public static final String COMMAND_TILT_POSITIVE = "tiltPositive";
+ public static final String COMMAND_TILT_NEGATIVE = "tiltNegative";
+ public static final String COMMAND_REST = "rest";
// States
public static final String OPERATING_MODE_STATE = "core:OperatingModeState";
THING_TYPE_DIMMER_LIGHT, THING_TYPE_EXTERIOR_HEATING_SYSTEM, THING_TYPE_VALVE_HEATING_SYSTEM,
THING_TYPE_BIOCLIMATIC_PERGOLA, THING_TYPE_WATERHEATINGSYSTEM, THING_TYPE_HITACHI_ATWHZ,
THING_TYPE_HITACHI_DHW, THING_TYPE_HITACHI_ATWMC, THING_TYPE_RAINSENSOR, THING_TYPE_SHUTTER,
- THING_TYPE_CARBON_DIOXIDE_SENSOR, THING_TYPE_NOISE_SENSOR));
+ THING_TYPE_CARBON_DIOXIDE_SENSOR, THING_TYPE_NOISE_SENSOR, THING_TYPE_UPDOWNVENETIANBLIND));
// somfy gateways
public static Map<Integer, String> gatewayTypes = new HashMap<>() {
import org.openhab.binding.somfytahoma.internal.handler.SomfyTahomaTemperatureSensorHandler;
import org.openhab.binding.somfytahoma.internal.handler.SomfyTahomaThermostatHandler;
import org.openhab.binding.somfytahoma.internal.handler.SomfyTahomaUnoRollerShutterHandler;
+import org.openhab.binding.somfytahoma.internal.handler.SomfyTahomaUpDownVenetianBlindHandler;
import org.openhab.binding.somfytahoma.internal.handler.SomfyTahomaValveHeatingSystemHandler;
import org.openhab.binding.somfytahoma.internal.handler.SomfyTahomaVenetianBlindHandler;
import org.openhab.binding.somfytahoma.internal.handler.SomfyTahomaWaterHeatingSystemHandler;
} else if (thingTypeUID.equals(THING_TYPE_VENETIANBLIND)
|| thingTypeUID.equals(THING_TYPE_EXTERIORVENETIANBLIND)) {
return new SomfyTahomaVenetianBlindHandler(thing);
+ } else if (thingTypeUID.equals(THING_TYPE_UPDOWNVENETIANBLIND)) {
+ return new SomfyTahomaUpDownVenetianBlindHandler(thing);
} else if (thingTypeUID.equals(THING_TYPE_GARAGEDOOR)) {
return new SomfyTahomaRollerShutterHandler(thing);
} else if (thingTypeUID.equals(THING_TYPE_AWNING)) {
// widget: DynamicVenetianBlind
if (hasCommmand(device, "setOrientation")) {
deviceDiscovered(device, THING_TYPE_VENETIANBLIND, place);
+ } else if ("UpDownVenetianBlind".equals(widget)) {
+ // widget: UpDownVenetianBlind
+ deviceDiscovered(device, THING_TYPE_UPDOWNVENETIANBLIND, place);
} else {
// simple venetian blind without orientation
deviceDiscovered(device, THING_TYPE_SHUTTER, place);
--- /dev/null
+/**
+ * Copyright (c) 2010-2024 Contributors to the openHAB project
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.openhab.binding.somfytahoma.internal.handler;
+
+import static org.openhab.binding.somfytahoma.internal.SomfyTahomaBindingConstants.*;
+
+import org.eclipse.jdt.annotation.NonNullByDefault;
+import org.openhab.core.thing.ChannelUID;
+import org.openhab.core.thing.Thing;
+import org.openhab.core.types.Command;
+import org.openhab.core.types.RefreshType;
+
+/**
+ * The {@link SomfyTahomaUpDownVenetianBlindHandler} is responsible for handling commands,
+ * which are sent to one of the channels of the up/down venetian blind thing.
+ *
+ * @author Ondrej Pecta - Initial contribution
+ */
+@NonNullByDefault
+public class SomfyTahomaUpDownVenetianBlindHandler extends SomfyTahomaBaseThingHandler {
+
+ public SomfyTahomaUpDownVenetianBlindHandler(Thing thing) {
+ super(thing);
+ }
+
+ @Override
+ public void handleCommand(ChannelUID channelUID, Command command) {
+ super.handleCommand(channelUID, command);
+
+ if (command instanceof RefreshType) {
+ return;
+ }
+
+ switch (channelUID.getId()) {
+ case CONTROL:
+ case TILT:
+ String cmd = getTahomaCommand(command.toString(), channelUID.getId());
+ if (COMMAND_MY.equals(cmd)) {
+ sendCommand(COMMAND_MY);
+ } else if (COMMAND_STOP.equals(cmd)) {
+ String executionId = getCurrentExecutions();
+ if (executionId != null) {
+ // Check if the venetian blind is moving and STOP is sent => STOP it
+ cancelExecution(executionId);
+ } else {
+ sendCommand(COMMAND_MY);
+ }
+ } else {
+ String param = (COMMAND_TILT_POSITIVE.equals(cmd) || COMMAND_TILT_NEGATIVE.equals(cmd))
+ ? "[" + normalizeTilt(toInteger(command)) + ",0]"
+ : "[]";
+ sendCommand(cmd, param);
+ }
+ break;
+ default:
+ return;
+ }
+ }
+
+ private int normalizeTilt(int i) {
+ i = Math.abs(i);
+ return (i == 0 || i > 5) ? 1 : i;
+ }
+
+ private String getTahomaCommand(String command, String channelId) {
+ switch (command) {
+ case "OFF":
+ case "DOWN":
+ case "CLOSE":
+ return COMMAND_CLOSE;
+ case "ON":
+ case "UP":
+ case "OPEN":
+ return COMMAND_OPEN;
+ case "MOVE":
+ case "MY":
+ return COMMAND_MY;
+ case "STOP":
+ return COMMAND_STOP;
+ default:
+ if (TILT.equals(channelId) && !"0".equals(command)) {
+ return (command.startsWith("-")) ? COMMAND_TILT_NEGATIVE : COMMAND_TILT_POSITIVE;
+ } else {
+ return COMMAND_REST;
+ }
+ }
+ }
+}
thing-type.somfytahoma.smokesensor.label = Somfy Smoke Sensor
thing-type.somfytahoma.temperaturesensor.label = Somfy Temperature Sensor
thing-type.somfytahoma.thermostat.label = Somfy Thermostat
+thing-type.somfytahoma.updownvenetianblind.label = Somfy Up/Down Venetian Blind
thing-type.somfytahoma.valveheatingsystem.label = Somfy Thermostatic Valve
thing-type.somfytahoma.venetianblind.label = Somfy Venetian Blind
thing-type.somfytahoma.waterheatingsystem.label = Somfy Water Heating System
channel-type.somfytahoma.temperature.description = The temperature value of the sensor
channel-type.somfytahoma.thermostat_setting_zone1.label = Zone 1 Thermostat Setting
channel-type.somfytahoma.thermostat_setting_zone1.description = Thermostat setting control for the zone 1
+channel-type.somfytahoma.tilt.label = Tilt
+channel-type.somfytahoma.tilt.description = Venetian blind tilt (-5..5)
channel-type.somfytahoma.unit_control.label = Unit Control
channel-type.somfytahoma.unit_control.description = Unit control
channel-type.somfytahoma.unit_control.state.option.run = Run
</state>
</channel-type>
+ <channel-type id="tilt">
+ <item-type>Number</item-type>
+ <label>Tilt</label>
+ <description>Venetian blind tilt (-5..5)</description>
+ <state min="-5" max="5" step="1" pattern="%d" readOnly="false"/>
+ </channel-type>
+
</thing:thing-descriptions>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<thing:thing-descriptions bindingId="somfytahoma"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0"
+ xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd">
+
+ <thing-type id="updownvenetianblind">
+ <supported-bridge-type-refs>
+ <bridge-type-ref id="bridge"/>
+ </supported-bridge-type-refs>
+ <label>Somfy Up/Down Venetian Blind</label>
+ <channels>
+ <channel id="control" typeId="control"></channel>
+ <channel id="tilt" typeId="tilt"></channel>
+ </channels>
+ <representation-property>url</representation-property>
+ <config-description-ref uri="thing-type:somfytahoma:device"/>
+ </thing-type>
+
+</thing:thing-descriptions>