diff --git a/bundles/org.openhab.binding.amplipi/README.md b/bundles/org.openhab.binding.amplipi/README.md
index ad4d28adf61..30a63aad873 100644
--- a/bundles/org.openhab.binding.amplipi/README.md
+++ b/bundles/org.openhab.binding.amplipi/README.md
@@ -40,6 +40,7 @@ The `zone` and `group` Things have the following channels:
| Channel | Type | Description |
|----------|--------|----------------------------------------------------|
+| power | Switch | Whether the zone/group is active or off |
| volume | Dimmer | The volume of the zone/group |
| mute | Switch | Mutes the zone/group |
| source | Number | The source (1-4) that this zone/group is playing |
@@ -70,6 +71,7 @@ String Input2 "Input 2" { channel="amplipi:controller:1:
String Input3 "Input 3" { channel="amplipi:controller:1:input3" }
String Input4 "Input 4" { channel="amplipi:controller:1:input4" }
+Switch PowerZ2 "Power Zone2" { channel="amplipi:zone:1:zone2:power" }
Dimmer VolumeZ2 "Volume Zone2" { channel="amplipi:zone:1:zone2:volume" }
Switch MuteZ2 "Mute Zone2" { channel="amplipi:zone:1:zone2::mute" }
Number SourceZ2 "Source Zone2" { channel="amplipi:zone:1:zone2::source" }
@@ -88,6 +90,7 @@ sitemap amplipi label="Main Menu"
Selection item=Input4
}
Frame label="Living Room Zone" {
+ Switch item=PowerZ2
Slider item=VolumeZ2 label="Volume Zone 1 [%.1f %%]"
Switch item=MuteZ2
Selection item=SourceZ2
diff --git a/bundles/org.openhab.binding.amplipi/src/main/java/org/openhab/binding/amplipi/internal/AmpliPiBindingConstants.java b/bundles/org.openhab.binding.amplipi/src/main/java/org/openhab/binding/amplipi/internal/AmpliPiBindingConstants.java
index fafbfd0d1b9..89ee5439834 100644
--- a/bundles/org.openhab.binding.amplipi/src/main/java/org/openhab/binding/amplipi/internal/AmpliPiBindingConstants.java
+++ b/bundles/org.openhab.binding.amplipi/src/main/java/org/openhab/binding/amplipi/internal/AmpliPiBindingConstants.java
@@ -34,6 +34,7 @@ public class AmpliPiBindingConstants {
// List of all Channel ids
public static final String CHANNEL_PRESET = "preset";
public static final String CHANNEL_INPUT = "input";
+ public static final String CHANNEL_POWER = "power";
public static final String CHANNEL_VOLUME = "volume";
public static final String CHANNEL_MUTE = "mute";
public static final String CHANNEL_SOURCE = "source";
diff --git a/bundles/org.openhab.binding.amplipi/src/main/java/org/openhab/binding/amplipi/internal/AmpliPiGroupHandler.java b/bundles/org.openhab.binding.amplipi/src/main/java/org/openhab/binding/amplipi/internal/AmpliPiGroupHandler.java
index 0f32129d8d4..14fd3f188d2 100644
--- a/bundles/org.openhab.binding.amplipi/src/main/java/org/openhab/binding/amplipi/internal/AmpliPiGroupHandler.java
+++ b/bundles/org.openhab.binding.amplipi/src/main/java/org/openhab/binding/amplipi/internal/AmpliPiGroupHandler.java
@@ -103,6 +103,11 @@ public class AmpliPiGroupHandler extends BaseThingHandler implements AmpliPiStat
}
GroupUpdate update = new GroupUpdate();
switch (channelUID.getId()) {
+ case AmpliPiBindingConstants.CHANNEL_POWER:
+ if (command instanceof OnOffType) {
+ update.setMute(command == OnOffType.OFF);
+ }
+ break;
case AmpliPiBindingConstants.CHANNEL_MUTE:
if (command instanceof OnOffType) {
update.setMute(command == OnOffType.ON);
@@ -159,10 +164,12 @@ public class AmpliPiGroupHandler extends BaseThingHandler implements AmpliPiStat
private void updateGroupState(Group state) {
this.groupState = state;
+ Boolean power = !groupState.getMute();
Boolean mute = groupState.getMute();
Integer volDelta = groupState.getVolDelta();
Integer sourceId = groupState.getSourceId();
+ updateState(AmpliPiBindingConstants.CHANNEL_POWER, OnOffType.from(power));
updateState(AmpliPiBindingConstants.CHANNEL_MUTE, OnOffType.from(mute));
updateState(AmpliPiBindingConstants.CHANNEL_VOLUME, AmpliPiUtils.volumeToPercentType(volDelta));
updateState(AmpliPiBindingConstants.CHANNEL_SOURCE, new DecimalType(sourceId));
diff --git a/bundles/org.openhab.binding.amplipi/src/main/java/org/openhab/binding/amplipi/internal/AmpliPiZoneHandler.java b/bundles/org.openhab.binding.amplipi/src/main/java/org/openhab/binding/amplipi/internal/AmpliPiZoneHandler.java
index 870a9af3f75..e7c85c8f324 100644
--- a/bundles/org.openhab.binding.amplipi/src/main/java/org/openhab/binding/amplipi/internal/AmpliPiZoneHandler.java
+++ b/bundles/org.openhab.binding.amplipi/src/main/java/org/openhab/binding/amplipi/internal/AmpliPiZoneHandler.java
@@ -103,6 +103,11 @@ public class AmpliPiZoneHandler extends BaseThingHandler implements AmpliPiStatu
}
ZoneUpdate update = new ZoneUpdate();
switch (channelUID.getId()) {
+ case AmpliPiBindingConstants.CHANNEL_POWER:
+ if (command instanceof OnOffType) {
+ update.setMute(command == OnOffType.OFF);
+ }
+ break;
case AmpliPiBindingConstants.CHANNEL_MUTE:
if (command instanceof OnOffType) {
update.setMute(command == OnOffType.ON);
@@ -159,10 +164,12 @@ public class AmpliPiZoneHandler extends BaseThingHandler implements AmpliPiStatu
private void updateZoneState(Zone state) {
this.zoneState = state;
+ Boolean power = !zoneState.getMute();
Boolean mute = zoneState.getMute();
Integer vol = zoneState.getVol();
Integer sourceId = zoneState.getSourceId();
+ updateState(AmpliPiBindingConstants.CHANNEL_POWER, OnOffType.from(power));
updateState(AmpliPiBindingConstants.CHANNEL_MUTE, OnOffType.from(mute));
updateState(AmpliPiBindingConstants.CHANNEL_VOLUME, AmpliPiUtils.volumeToPercentType(vol));
updateState(AmpliPiBindingConstants.CHANNEL_SOURCE, new DecimalType(sourceId));
diff --git a/bundles/org.openhab.binding.amplipi/src/main/resources/OH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.amplipi/src/main/resources/OH-INF/thing/thing-types.xml
index df5f8400c95..c6fc68fd657 100644
--- a/bundles/org.openhab.binding.amplipi/src/main/resources/OH-INF/thing/thing-types.xml
+++ b/bundles/org.openhab.binding.amplipi/src/main/resources/OH-INF/thing/thing-types.xml
@@ -51,11 +51,16 @@
A zone of the AmpliPi system
+
+
+ 1
+
+
@@ -79,11 +84,16 @@
A group of the AmpliPi system
+
+
+ 1
+
+
diff --git a/bundles/org.openhab.binding.amplipi/src/main/resources/OH-INF/update/binding.xml b/bundles/org.openhab.binding.amplipi/src/main/resources/OH-INF/update/binding.xml
new file mode 100644
index 00000000000..8b8d48b1cf6
--- /dev/null
+++ b/bundles/org.openhab.binding.amplipi/src/main/resources/OH-INF/update/binding.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+ system:power
+
+
+
+
+
+
+ system:power
+
+
+
+