| signal | strength | Number | Read-only | Signal strength (0 for no signal, 1 for weak...) |
| signal | value | Number:Power | Read-only | Signal strength in dBm |
| presence | floodlight | String | Read-write | Sets the floodlight to ON/OFF/AUTO |
-| presence | siren | Switch | Read-write | Status of the siren, if silent or emitting an alarm |
+| presence | siren | Switch | Read-only | Status of the siren, if silent or emitting an alarm |
| last-event | type | String | Read-only | Type of event |
| last-event | subtype | String | Read-only | Sub-type of event |
| last-event | time | DateTime | Read-only | Time of occurrence of event |
import org.eclipse.jdt.annotation.Nullable;
import org.openhab.binding.netatmo.internal.api.data.NetatmoConstants.FeatureArea;
import org.openhab.binding.netatmo.internal.api.data.NetatmoConstants.FloodLightMode;
-import org.openhab.binding.netatmo.internal.api.data.NetatmoConstants.SirenStatus;
import org.openhab.binding.netatmo.internal.api.dto.Home;
import org.openhab.binding.netatmo.internal.api.dto.HomeEvent;
import org.openhab.binding.netatmo.internal.api.dto.HomeEvent.NAEventsDataResponse;
post(uriBuilder, ApiResponse.Ok.class, payload);
}
- public void changeSirenStatus(String homeId, String moduleId, SirenStatus status) throws NetatmoException {
- UriBuilder uriBuilder = getApiUriBuilder(PATH_STATE);
- String payload = PAYLOAD_SIREN_PRESENCE.formatted(homeId, moduleId, status.name().toLowerCase());
- post(uriBuilder, ApiResponse.Ok.class, payload);
- }
-
public void setPersonAwayStatus(String homeId, String personId, boolean away) throws NetatmoException {
UriBuilder uriBuilder = getApiUriBuilder(away ? SUB_PATH_PERSON_AWAY : SUB_PATH_PERSON_HOME);
String payload = String.format(away ? PAYLOAD_PERSON_AWAY : PAYLOAD_PERSON_HOME, homeId, personId);
Set.of(ChannelHelperCapability.class, ParentUpdateCapability.class), ChannelGroup.SIGNAL,
ChannelGroup.BATTERY, ChannelGroup.TIMESTAMP, new ChannelGroup(SirenChannelHelper.class, GROUP_SIREN)),
- PRESENCE(FeatureArea.SECURITY, "NOC", 1, "camera", HOME,
+ PRESENCE(FeatureArea.SECURITY, "NOC", 2, "camera", HOME,
Set.of(PresenceCapability.class, ChannelHelperCapability.class, ParentUpdateCapability.class),
ChannelGroup.SIGNAL, ChannelGroup.EVENT,
new ChannelGroup(PresenceChannelHelper.class, GROUP_SECURITY_EVENT, GROUP_CAM_STATUS, GROUP_CAM_LIVE,
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.binding.netatmo.internal.api.data.NetatmoConstants.FloodLightMode;
-import org.openhab.binding.netatmo.internal.api.data.NetatmoConstants.SirenStatus;
import org.openhab.binding.netatmo.internal.handler.CommonInterface;
import org.openhab.binding.netatmo.internal.handler.channelhelper.ChannelHelper;
import org.openhab.binding.netatmo.internal.providers.NetatmoDescriptionProvider;
try {
changeFloodlightMode(FloodLightMode.valueOf(command.toString()));
} catch (IllegalArgumentException e) {
- logger.info("Incorrect command '{}' received for channel '{}'", command, channelName);
+ logger.warn("Incorrect command '{}' received for channel '{}'", command, channelName);
}
return;
}
- } else if (CHANNEL_SIREN.equals(channelName) && command instanceof OnOffType) {
- getSecurityCapability().ifPresent(cap -> cap.changeSirenStatus(handler.getId(),
- command == OnOffType.ON ? SirenStatus.SOUND : SirenStatus.NO_SOUND));
+ } else if (CHANNEL_SIREN.equals(channelName)) {
+ logger.info("Channel '{}' is read-only", channelName);
return;
}
super.handleCommand(channelName, command);
import org.openhab.binding.netatmo.internal.api.SecurityApi;
import org.openhab.binding.netatmo.internal.api.data.NetatmoConstants.FeatureArea;
import org.openhab.binding.netatmo.internal.api.data.NetatmoConstants.FloodLightMode;
-import org.openhab.binding.netatmo.internal.api.data.NetatmoConstants.SirenStatus;
import org.openhab.binding.netatmo.internal.api.dto.HomeData;
import org.openhab.binding.netatmo.internal.api.dto.HomeDataModule;
import org.openhab.binding.netatmo.internal.api.dto.HomeDataPerson;
}
});
}
-
- public void changeSirenStatus(String moduleId, SirenStatus status) {
- getApi().ifPresent(api -> {
- try {
- api.changeSirenStatus(handler.getId(), moduleId, status);
- handler.expireData();
- } catch (NetatmoException e) {
- logger.warn("Error changing siren status '{}' : {}", status, e.getMessage());
- }
- });
- }
}
<channel-group-type id="presence">
<label>Presence Camera</label>
<channels>
- <channel id="siren" typeId="siren-status-rw"/>
+ <channel id="siren" typeId="siren-status"/>
<channel id="floodlight" typeId="floodlight-mode"/>
</channels>
</channel-group-type>
</update-channel>
</instruction-set>
+ <instruction-set targetVersion="2">
+ <update-channel id="siren" groupIds="presence">
+ <type>netatmo:siren-status</type>
+ </update-channel>
+ </instruction-set>
+
</thing-type>
</update:update-descriptions>