I rewrote my configuration for the Shinybow 8804LCM, using this as a template https://community.openhab.org/t/monoprice-6-zone-audio-amp-items-sitemap-rules/1693 Thank you @bartus
This still needs some work with parsing the feedback.
Items:
/* ShinyBow */
String ShinyBow "ShinyBow Matrix [%s]" { tcp=">[192.168.50.142:2103:'REGEX((.*))']" }
String ShinyBow_Status "ShinyBow Status [%s]"
Switch ShinyBow_PWR "Master Power"
Number Shinybow_Z1_Input "Bonus Room Input"
Dimmer Shinybow_Z1_Volume "Bonus Room Volume [%03d %%]"
Switch Shinybow_Z1_Mute "Bonus Room Mute"
Number Shinybow_Z2_Input "Living Room Input"
Dimmer Shinybow_Z2_Volume "Living Room Volume [%03d %%]"
Switch Shinybow_Z2_Mute "Living Room Mute"
Number Shinybow_Z3_Input "Hall Input"
Dimmer Shinybow_Z3_Volume "Hall Volume [%03d %%]"
Switch Shinybow_Z3_Mute "Hall Room Mute"
Number Shinybow_Z4_Input "Office Input"
Dimmer Shinybow_Z4_Volume "Office Volume [%03d %%]"
Switch Shinybow_Z4_Mute "Office Mute"
Number Shinybow_Z5_Input "Kitchen Input"
Dimmer Shinybow_Z5_Volume "Kitchen Volume [%03d %%]"
Switch Shinybow_Z5_Mute "Kitchen Mute"
Number Shinybow_Z6_Input "Master Bed Input"
Dimmer Shinybow_Z6_Volume "Master Bed Volume [%03d %%]"
Switch Shinybow_Z6_Mute "Master Bed Mute"
Number Shinybow_Z7_Input "Master Bath Input"
Dimmer Shinybow_Z7_Volume "Master Bath Volume [%03d %%]"
Switch Shinybow_Z7_Mute "Master Bath Room Mute"
Number Shinybow_Z8_Input "Backyard Input"
Dimmer Shinybow_Z8_Volume "Backyard Volume [%03d %%]"
Switch Shinybow_Z8_Mute "Backyard Mute"
Sitemap
Text label="Matrix" icon="firstfloor" {
Text item=ShinyBow
Text item=ShinyBow_Status
Switch item=ShinyBow_PWR
Selection item=Shinybow_Z1_Input mappings=[0=Off, 1=Input1, 2=Input2, 3=Input3]
Switch item=Shinybow_Z1_Mute
Slider item=Shinybow_Z1_Volume
Selection item=Shinybow_Z2_Input mappings=[0=Off, 1=Input1, 2=Input2, 3=Input3]
Switch item=Shinybow_Z2_Mute
Slider item=Shinybow_Z2_Volume
Selection item=Shinybow_Z3_Input mappings=[0=Off, 1=Input1, 2=Input2, 3=Input3]
Switch item=Shinybow_Z3_Mute
Slider item=Shinybow_Z3_Volume
Selection item=Shinybow_Z4_Input mappings=[0=Off, 1=Input1, 2=Input2, 3=Input3]
Switch item=Shinybow_Z4_Mute
Slider item=Shinybow_Z4_Volume
Selection item=Shinybow_Z5_Input mappings=[0=Off, 1=Input1, 2=Input2, 3=Input3]
Switch item=Shinybow_Z5_Mute
Slider item=Shinybow_Z5_Volume
Selection item=Shinybow_Z6_Input mappings=[0=Off, 1=Input1, 2=Input2, 3=Input3]
Switch item=Shinybow_Z6_Mute
Slider item=Shinybow_Z6_Volume
Selection item=Shinybow_Z7_Input mappings=[0=Off, 1=Input1, 2=Input2, 3=Input3]
Switch item=Shinybow_Z7_Mute
Slider item=Shinybow_Z7_Volume
Selection item=Shinybow_Z8_Input mappings=[0=Off, 1=Input1, 2=Input2, 3=Input3]
Switch item=Shinybow_Z8_Mute
Slider item=Shinybow_Z8_Volume
}
Rules:
import org.openhab.core.library.types.*
import org.openhab.core.persistence.*
import org.openhab.model.script.actions.*
import java.util.regex.Matcher
import java.util.regex.Pattern
var Number volume_z1 = 0
var Number volume_z2 = 0
var Number volume_z3 = 0
var Number volume_z4 = 0
var Number volume_z5 = 0
var Number volume_z6 = 0
var Number volume_z7 = 0
var Number volume_z8 = 0
rule "ShinyBow Power"
when
Item ShinyBow_PWR received command
then
if(receivedCommand==ON){
sendCommand(ShinyBow, "Power 001;")
}
else if(receivedCommand==OFF){
sendCommand(ShinyBow, "Power 000;")
}
end
rule "Select Zone 1 Input"
when
Item Shinybow_Z1_Input received command
then
switch(receivedCommand) {
case 0 : sendCommand(ShinyBow, "OUTPUT001 000;")
case 1 : sendCommand(ShinyBow, "OUTPUT001 001;")
case 2 : sendCommand(ShinyBow, "OUTPUT001 002;")
case 3 : sendCommand(ShinyBow, "OUTPUT001 003;")
}
end
rule "Shinybow_Z1_Volume control"
when
Item Shinybow_Z1_Volume received command
then
if(receivedCommand instanceof PercentType) {
volume_z1=receivedCommand
} else {
if(receivedCommand==INCREASE)
{
volume_z1=volume_z1 + 1
}
if(receivedCommand==DECREASE)
{
volume_z1=volume_z1 - 1
}
}
if (volume_z1>9) {sendCommand(ShinyBow, "VOLUME001 0" + volume_z1.toString("%02d") + ";")}
else {sendCommand(ShinyBow, "VOLUME001 00" + volume_z1.toString("%02d") + ";")}
postUpdate(Shinybow_Z1_Volume)
end
rule "ShinyBow Shinybow_Z1_Mute"
when
Item Shinybow_Z1_Mute received command
then
if(receivedCommand==ON){
sendCommand(ShinyBow, "MUTE001 001;")
}
else if(receivedCommand==OFF){
sendCommand(ShinyBow, "MUTE001 000;")
}
end
rule "Select Zone 2 Input"
when
Item Shinybow_Z2_Input received command
then
switch(receivedCommand) {
case 0 : sendCommand(ShinyBow, "OUTPUT002 000;")
case 1 : sendCommand(ShinyBow, "OUTPUT002 001;")
case 2 : sendCommand(ShinyBow, "OUTPUT002 002;")
case 3 : sendCommand(ShinyBow, "OUTPUT002 003;")
}
end
rule "Shinybow_Z2_Volume control"
when
Item Shinybow_Z2_Volume received command
then
if(receivedCommand instanceof PercentType) {
volume_z2=receivedCommand
} else {
if(receivedCommand==INCREASE)
{
volume_z2=volume_z2 + 1
}
if(receivedCommand==DECREASE)
{
volume_z2=volume_z2 - 1
}
}
if (volume_z2>9) {sendCommand(ShinyBow, "VOLUME002 0" + volume_z2.toString("%02d") + ";")}
else {sendCommand(ShinyBow, "VOLUME002 00" + volume_z2.toString("%02d") + ";")}
postUpdate(Shinybow_Z2_Volume)
end
rule "ShinyBow Shinybow_Z2_Mute"
when
Item Shinybow_Z2_Mute received command
then
if(receivedCommand==ON){
sendCommand(ShinyBow, "MUTE002 001;")
}
else if(receivedCommand==OFF){
sendCommand(ShinyBow, "MUTE002 000;")
}
end
rule "Select Zone 3 Input"
when
Item Shinybow_Z3_Input received command
then
switch(receivedCommand) {
case 0 : sendCommand(ShinyBow, "OUTPUT003 000;")
case 1 : sendCommand(ShinyBow, "OUTPUT003 001;")
case 2 : sendCommand(ShinyBow, "OUTPUT003 002;")
case 3 : sendCommand(ShinyBow, "OUTPUT003 003;")
}
end
rule "Shinybow_Z3_Volume control"
when
Item Shinybow_Z3_Volume received command
then
if(receivedCommand instanceof PercentType) {
volume_z3=receivedCommand
} else {
if(receivedCommand==INCREASE)
{
volume_z3=volume_z3 + 1
}
if(receivedCommand==DECREASE)
{
volume_z3=volume_z3 - 1
}
}
if (volume_z3>9) {sendCommand(ShinyBow, "VOLUME003 0" + volume_z3.toString("%02d") + ";")}
else {sendCommand(ShinyBow, "VOLUME003 00" + volume_z3.toString("%02d") + ";")}
postUpdate(Shinybow_Z3_Volume)
end
rule "ShinyBow Shinybow_Z3_Mute"
when
Item Shinybow_Z3_Mute received command
then
if(receivedCommand==ON){
sendCommand(ShinyBow, "MUTE003 001;")
}
else if(receivedCommand==OFF){
sendCommand(ShinyBow, "MUTE003 000;")
}
end
rule "Select Shinybow_Zone 4 Input"
when
Item Shinybow_Z4_Input received command
then
switch(receivedCommand) {
case 0 : sendCommand(ShinyBow, "OUTPUT004 000;")
case 1 : sendCommand(ShinyBow, "OUTPUT004 001;")
case 2 : sendCommand(ShinyBow, "OUTPUT004 002;")
case 3 : sendCommand(ShinyBow, "OUTPUT004 003;")
}
end
rule "Shinybow_Z4_Volume control"
when
Item Shinybow_Z4_Volume received command
then
if(receivedCommand instanceof PercentType) {
volume_z4=receivedCommand
} else {
if(receivedCommand==INCREASE)
{
volume_z4=volume_z4 + 1
}
if(receivedCommand==DECREASE)
{
volume_z4=volume_z4 - 1
}
}
if (volume_z4>9) {sendCommand(ShinyBow, "VOLUME004 0" + volume_z4.toString("%02d") + ";")}
else {sendCommand(ShinyBow, "VOLUME004 00" + volume_z4.toString("%02d") + ";")}
postUpdate(Shinybow_Z4_Volume)
end
rule "ShinyBow Shinybow_Z4_Mute"
when
Item Shinybow_Z4_Mute received command
then
if(receivedCommand==ON){
sendCommand(ShinyBow, "MUTE004 001;")
}
else if(receivedCommand==OFF){
sendCommand(ShinyBow, "MUTE004 000;")
}
end
rule "Select Zone 5 Input"
when
Item Shinybow_Z5_Input received command
then
switch(receivedCommand) {
case 0 : sendCommand(ShinyBow, "OUTPUT005 000;")
case 1 : sendCommand(ShinyBow, "OUTPUT005 001;")
case 2 : sendCommand(ShinyBow, "OUTPUT005 002;")
case 3 : sendCommand(ShinyBow, "OUTPUT005 003;")
}
end
rule "Z5_Volume control"
when
Item Shinybow_Z5_Volume received command
then
if(receivedCommand instanceof PercentType) {
volume_z5=receivedCommand
} else {
if(receivedCommand==INCREASE)
{
volume_z5=volume_z5 + 1
}
if(receivedCommand==DECREASE)
{
volume_z5=volume_z5 - 1
}
}
if (volume_z5>9) {sendCommand(ShinyBow, "VOLUME005 0" + volume_z5.toString("%02d") + ";")}
else {sendCommand(ShinyBow, "VOLUME005 00" + volume_z5.toString("%02d") + ";")}
postUpdate(Shinybow_Z5_Volume)
end
rule "ShinyBow Z5_Mute"
when
Item Shinybow_Z5_Mute received command
then
if(receivedCommand==ON){
sendCommand(ShinyBow, "MUTE005 001;")
}
else if(receivedCommand==OFF){
sendCommand(ShinyBow, "MUTE005 000;")
}
end
rule "Select Zone 6 Input"
when
Item Shinybow_Z6_Input received command
then
switch(receivedCommand) {
case 0 : sendCommand(ShinyBow, "OUTPUT006 000;")
case 1 : sendCommand(ShinyBow, "OUTPUT006 001;")
case 2 : sendCommand(ShinyBow, "OUTPUT006 002;")
case 3 : sendCommand(ShinyBow, "OUTPUT006 003;")
}
end
rule "Shinybow_Z6_Volume control"
when
Item Shinybow_Z6_Volume received command
then
if(receivedCommand instanceof PercentType) {
volume_z6=receivedCommand
} else {
if(receivedCommand==INCREASE)
{
volume_z6=volume_z6 + 1
}
if(receivedCommand==DECREASE)
{
volume_z6=volume_z6 - 1
}
}
if (volume_z6>9) {sendCommand(ShinyBow, "VOLUME006 0" + volume_z6.toString("%02d") + ";")}
else {sendCommand(ShinyBow, "VOLUME006 00" + volume_z6.toString("%02d") + ";")}
postUpdate(Shinybow_Z6_Volume)
end
rule "ShinyBow Z6_Mute"
when
Item Shinybow_Z6_Mute received command
then
if(receivedCommand==ON){
sendCommand(ShinyBow, "MUTE006 001;")
}
else if(receivedCommand==OFF){
sendCommand(ShinyBow, "MUTE006 000;")
}
end
rule "Select Zone 7 Input"
when
Item Shinybow_Z7_Input received command
then
switch(receivedCommand) {
case 0 : sendCommand(ShinyBow, "OUTPUT007 000;")
case 1 : sendCommand(ShinyBow, "OUTPUT007 001;")
case 2 : sendCommand(ShinyBow, "OUTPUT007 002;")
case 3 : sendCommand(ShinyBow, "OUTPUT007 003;")
}
end
rule "Z7_Volume control"
when
Item Shinybow_Z7_Volume received command
then
if(receivedCommand instanceof PercentType) {
volume_z7=receivedCommand
} else {
if(receivedCommand==INCREASE)
{
volume_z7=volume_z7 + 1
}
if(receivedCommand==DECREASE)
{
volume_z7=volume_z7 - 1
}
}
if (volume_z7>9) {sendCommand(ShinyBow, "VOLUME007 0" + volume_z7.toString("%02d") + ";")}
else {sendCommand(ShinyBow, "VOLUME007 00" + volume_z7.toString("%02d") + ";")}
postUpdate(Shinybow_Z7_Volume)
end
rule "ShinyBow Z7_Mute"
when
Item Shinybow_Z7_Mute received command
then
if(receivedCommand==ON){
sendCommand(ShinyBow, "MUTE007 001;")
}
else if(receivedCommand==OFF){
sendCommand(ShinyBow, "MUTE007 000;")
}
end
rule "Select Zone 8 Input"
when
Item Shinybow_Z8_Input received command
then
switch(receivedCommand) {
case 0 : sendCommand(ShinyBow, "OUTPUT008 000;")
case 1 : sendCommand(ShinyBow, "OUTPUT008 001;")
case 2 : sendCommand(ShinyBow, "OUTPUT008 002;")
case 3 : sendCommand(ShinyBow, "OUTPUT008 003;")
}
end
rule "Z8_Volume control"
when
Item Shinybow_Z8_Volume received command
then
if(receivedCommand instanceof PercentType) {
volume_z8=receivedCommand
} else {
if(receivedCommand==INCREASE)
{
volume_z8=volume_z8 + 1
}
if(receivedCommand==DECREASE)
{
volume_z8=volume_z8 - 1
}
}
if (volume_z8>9) {sendCommand(ShinyBow, "VOLUME008 0" + volume_z8.toString("%02d") + ";")}
else {sendCommand(ShinyBow, "VOLUME008 00" + volume_z8.toString("%02d") + ";")}
postUpdate(Shinybow_Z8_Volume)
end
rule "ShinyBow Z8_Mute"
when
Item Shinybow_Z8_Mute received command
then
if(receivedCommand==ON){
sendCommand(ShinyBow, "MUTE008 001;")
}
else if(receivedCommand==OFF){
sendCommand(ShinyBow, "MUTE008 000;")
}
end