Index: diseqc.cpp
===================================================================
--- diseqc.cpp  (revision 14508)
+++ diseqc.cpp  (working copy)
@@ -949,7 +949,8 @@
 
 DiSEqCDevSwitch::DiSEqCDevSwitch(DiSEqCDevTree &tree, uint devid)
     : DiSEqCDevDevice(tree, devid),
-      m_type(kTypeTone), m_num_ports(2)
+      m_type(kTypeTone), m_address(DISEQC_ADR_SW_ALL),
+      m_num_ports(2)
 {
     m_children.resize(m_num_ports);
 
@@ -1113,7 +1114,7 @@
     // populate switch parameters from db
     MSqlQuery query(MSqlQuery::InitCon());
     query.prepare(
-        "SELECT subtype, switch_ports, cmd_repeat "
+        "SELECT subtype, address, switch_ports, cmd_repeat "
         "FROM diseqc_tree "
         "WHERE diseqcid = :DEVID");
     query.bindValue(":DEVID", GetDeviceID());
@@ -1126,8 +1127,9 @@
     else if (query.next())
     {
         m_type = SwitchTypeFromString(query.value(0).toString());
-        m_num_ports = query.value(1).toUInt();
-        m_repeat = query.value(2).toUInt();
+        m_address = query.value(1).toUInt();
+        m_num_ports = query.value(2).toUInt();
+        m_repeat = query.value(3).toUInt();
         m_children.resize(m_num_ports);
         for (uint i = 0; i < m_num_ports; i++)
             m_children[i] = NULL;
@@ -1177,6 +1179,7 @@
             "    type         = 'switch', "
             "    description  = :DESC, "
             "    subtype      = :TYPE, "
+            "    address      = :ADDRESS, "
             "    switch_ports = :PORTS, "
             "    cmd_repeat   = :REPEAT "
             "WHERE diseqcid = :DEVID");
@@ -1185,13 +1188,13 @@
     {
         query.prepare(
             "INSERT INTO diseqc_tree"
-            " ( parentid,      ordinal,         type, "
-            "   description,   subtype,         switch_ports, "
-            "   cmd_repeat )"
+            " ( parentid,      ordinal,       type,    "
+            "   description,   subtype,       address, "
+            "   switch_ports,  cmd_repeat )"
             "VALUES "
-            " (:PARENT,       :ORDINAL,         'switch', "
-            "  :DESC,         :TYPE,            :PORTS, "
-            "  :REPEAT )");
+            " (:PARENT,       :ORDINAL,      'switch', "
+            "  :DESC,         :TYPE,         :ADDRESS, "
+            "  :PORTS,        :REPEAT )");
     }
 
     if (m_parent)
@@ -1199,6 +1202,7 @@
 
     query.bindValue(":ORDINAL", m_ordinal);
     query.bindValue(":DESC",    GetDescription());
+    query.bindValue(":ADDRESS", m_address);
     query.bindValue(":TYPE",    type);
     query.bindValue(":PORTS",   m_num_ports);
     query.bindValue(":REPEAT",  m_repeat);
@@ -1437,7 +1441,7 @@
     VERBOSE(VB_CHANNEL, LOC + "Changing to DiSEqC switch port " +
             QString("%1/%2").arg(pos + 1).arg(m_num_ports));
 
-    bool ret = m_tree.SendCommand(DISEQC_ADR_SW_ALL, cmd, m_repeat, 1, &data);
+    bool ret = m_tree.SendCommand(m_address, cmd, m_repeat, 1, &data);
     if(ret)
     {
         m_last_high_band = high_band;
Index: diseqc.h
===================================================================
--- diseqc.h    (revision 14508)
+++ diseqc.h    (working copy)
@@ -225,13 +225,15 @@
         kTypeLegacySW42        = 4,
         kTypeLegacySW64        = 5,
     };
-    void SetType(dvbdev_switch_t type)        { m_type = type;      }
+    void SetType(dvbdev_switch_t type)        { m_type = type;       }
+    void SetAddress(uint address)             { m_address = address; }
     void SetNumPorts(uint num_ports);
     virtual bool SetChild(uint, DiSEqCDevDevice*);
 
     // Gets
-    dvbdev_switch_t GetType(void)       const { return m_type;      }
-    uint            GetNumPorts(void)   const { return m_num_ports; }
+    dvbdev_switch_t GetType(void)       const { return m_type;       }
+    uint            GetAddress(void)    const { return m_address;    }
+    uint            GetNumPorts(void)   const { return m_num_ports;  }
     bool            ShouldSwitch(const DiSEqCDevSettings &settings,
                                  const DTVMultiplex &tuning) const;
     virtual uint    GetChildCount(void) const;
@@ -260,6 +262,7 @@
 
   private:
     dvbdev_switch_t m_type;
+    uint            m_address;
     uint            m_num_ports;
     uint            m_last_pos;
     uint            m_last_high_band;
Index: diseqcsettings.cpp
===================================================================
--- diseqcsettings.cpp  (revision 14508)
+++ diseqcsettings.cpp  (working copy)
@@ -178,6 +178,34 @@
     DiSEqCDevSwitch &m_switch;
 };
 
+//////////////////////////////////////// SwitchAddressSetting
+
+class SwitchAddressSetting : public LineEditSetting, public Storage
+{
+  public:
+    SwitchAddressSetting(DiSEqCDevSwitch &switch_dev) :
+        LineEditSetting(this), m_switch(switch_dev)
+    {
+        setLabel(DeviceTree::tr("Address of switch"));
+        setHelpText(DeviceTree::tr("The diseqc address of the switch."));
+    }
+
+    virtual void load(void)
+    {
+        setValue(QString::number(m_switch.GetAddress(), 16).upper().prepend(QString("0x")));
+    }
+
+    virtual void save(void)
+    {
+        m_switch.SetAddress(getValue().toUInt(0, 16));
+    }
+
+    virtual void save(QString /*destination*/) { }
+
+  private:
+    DiSEqCDevSwitch &m_switch;
+};
+
 //////////////////////////////////////// SwitchPortsSetting
 
 class SwitchPortsSetting : public LineEditSetting, public Storage
@@ -218,6 +246,8 @@
     group->addChild(new DeviceRepeatSetting(switch_dev));
     m_type = new SwitchTypeSetting(switch_dev);
     group->addChild(m_type);
+    m_address = new SwitchAddressSetting(switch_dev);
+    group->addChild(m_address);
     m_ports = new SwitchPortsSetting(switch_dev);
     group->addChild(m_ports);
 
@@ -234,15 +264,20 @@
         case DiSEqCDevSwitch::kTypeTone:
         case DiSEqCDevSwitch::kTypeLegacySW21:
         case DiSEqCDevSwitch::kTypeLegacySW42:
+            m_address->setValue(QString("0x10"));
+            m_address->setEnabled(false);
             m_ports->setValue("2");
             m_ports->setEnabled(false);
             break;
         case DiSEqCDevSwitch::kTypeLegacySW64:
+            m_address->setValue(QString("0x10"));
+            m_address->setEnabled(false);
             m_ports->setValue("3");
             m_ports->setEnabled(false);
             break;
         case DiSEqCDevSwitch::kTypeDiSEqCCommitted:
         case DiSEqCDevSwitch::kTypeDiSEqCUncommitted:
+            m_address->setEnabled(true);
             m_ports->setEnabled(true);
             break;
     }
@@ -1404,6 +1439,7 @@
                     tree, DiSEqCDevDevice::kTypeSwitch);
                 DiSEqCDevSwitch *sw = dynamic_cast<DiSEqCDevSwitch*>(root);
                 sw->SetType(DiSEqCDevSwitch::kTypeDiSEqCCommitted);
+                sw->SetAddress(16);
                 sw->SetNumPorts(2);
                 add_lnbs = 2;
                 break;
@@ -1417,6 +1453,7 @@
                     tree, DiSEqCDevDevice::kTypeSwitch);
                 DiSEqCDevSwitch *sw = dynamic_cast<DiSEqCDevSwitch*>(root);
                 sw->SetType(DiSEqCDevSwitch::kTypeDiSEqCCommitted);
+                sw->SetAddress(16);
                 sw->SetNumPorts(4);
                 add_lnbs = 4;
                 break;
Index: diseqcsettings.h
===================================================================
--- diseqcsettings.h    (revision 14508)
+++ diseqcsettings.h    (working copy)
@@ -14,6 +14,7 @@
 
 class SwitchTypeSetting;
 class SwitchPortsSetting;
+class SwitchAddressSetting;
 
 class SwitchConfig : public QObject, public ConfigurationWizard
 {
@@ -28,6 +29,7 @@
   private:
     SwitchTypeSetting  *m_type;
     SwitchPortsSetting *m_ports;
+    SwitchAddressSetting *m_address;
 };
 
 class RotorPosMap : public ListBoxSetting, public StorageIndex: dbcheck.cpp
===================================================================
--- dbcheck.cpp (revision 14508)
+++ dbcheck.cpp (working copy)
@@ -3247,6 +3247,17 @@
             return false;
     }
 
+    if (dbver == "1199")
+    {
+        const QString updates[] = {
+"ALTER TABLE diseqc_tree "
+"ADD COLUMN address TINYINT UNSIGNED NOT NULL default 16 AFTER description;",
+""
+};
+        if (!performActualUpdate(updates, "2000", dbver))
+            return false;
+    }
+
 //"ALTER TABLE cardinput DROP COLUMN preference;" in 0.22
 //"ALTER TABLE channel DROP COLUMN atscsrcid;" in 0.22
 //"ALTER TABLE recordedmarkup DROP COLUMN offset;" in 0.22
