UPDATE Resources SET IsFavorite = 0 WHERE ID = 55227;
INSERT INTO Spaces (ID, Title, Description, SiteID, CreatedOn) VALUES (413, 'Balcony', 'abc', 167, '2022-08-22 10:50:45');
UPDATE Spaces SET Title = 'Balcony1', Description = 'abc' WHERE ID = 413;
UPDATE Devices SET Title = 'My Device', SpaceID = 407 WHERE ID = 4626;
DELETE FROM ThemeSettings WHERE ResourceID IN (SELECT ID FROM Resources WHERE DeviceID = 4587);
DELETE FROM Timers WHERE ResourceID IN (SELECT ID FROM Resources WHERE DeviceID = 4587);
DELETE FROM Resources WHERE DeviceID  = 4587;
DELETE FROM Devices WHERE ID = 4587;
DELETE FROM ThemeSettings WHERE ResourceID IN (SELECT ID FROM Resources WHERE DeviceID = 4588);
DELETE FROM Timers WHERE ResourceID IN (SELECT ID FROM Resources WHERE DeviceID = 4588);
DELETE FROM Resources WHERE DeviceID  = 4588;
DELETE FROM Devices WHERE ID = 4588;
DELETE FROM ThemeSettings WHERE ResourceID IN (SELECT ID FROM Resources WHERE DeviceID = 4626);
DELETE FROM Timers WHERE ResourceID IN (SELECT ID FROM Resources WHERE DeviceID = 4626);
DELETE FROM Resources WHERE DeviceID  = 4626;
DELETE FROM Devices WHERE ID = 4626;
DELETE FROM ThemeSettings WHERE ResourceID IN (SELECT ID FROM Resources WHERE DeviceID = 4640);
DELETE FROM Themes WHERE ID = 308;
DELETE FROM Timers WHERE ResourceID IN (SELECT ID FROM Resources WHERE DeviceID = 4640);
DELETE FROM Resources WHERE DeviceID  = 4640;
DELETE FROM Devices WHERE ID = 4640;
DELETE FROM Rules WHERE SensorID = 4759;
DELETE FROM Resources WHERE DeviceID  = 4759;
DELETE FROM Devices WHERE ID = 4759;
DELETE FROM ThemeSettings WHERE ResourceID IN (SELECT ID FROM Resources WHERE DeviceID = 4609);
DELETE FROM Timers WHERE ResourceID IN (SELECT ID FROM Resources WHERE DeviceID = 4609);
DELETE FROM Resources WHERE DeviceID  = 4609;
DELETE FROM Devices WHERE ID = 4609;
DELETE FROM ThemeSettings WHERE ResourceID IN (SELECT ID FROM Resources WHERE DeviceID = 4631);
DELETE FROM Timers WHERE ResourceID IN (SELECT ID FROM Resources WHERE DeviceID = 4631);
DELETE FROM Resources WHERE DeviceID  = 4631;
DELETE FROM Devices WHERE ID = 4631;
DELETE FROM Spaces WHERE ID = 413;
DELETE FROM Spaces WHERE ID = 408;
INSERT INTO Devices (ID, Title, Description, SpaceID, CategoryID, RegisteredOn, ModelID) VALUES (4587, 'Multi Device', ' ', 407, 2, '2022-09-01 12:30:26', '47');
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55220, 'Switch 1', 4587, 1, 0, 0, 0, 0);
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55221, 'Switch 2', 4587, 2, 0, 0, 0, 0);
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55222, 'Switch 3', 4587, 3, 0, 0, 0, 0);
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55223, 'Switch 4', 4587, 4, 0, 0, 0, 0);
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55224, 'Switch 5', 4587, 5, 0, 0, 0, 0);
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55225, 'Dimmer 1', 4587, 6, 0, 0, 0, 0);
UPDATE Resources SET Title = 'Switch 1', ApplianceType = 1, ApplianceWatt = 100 WHERE ID = 55220;
UPDATE Resources SET Title = 'Switch 2', ApplianceType = 1, ApplianceWatt = 100 WHERE ID = 55221;
UPDATE Resources SET Title = 'Switch 3', ApplianceType = 1, ApplianceWatt = 100 WHERE ID = 55222;
UPDATE Resources SET Title = 'Switch 4', ApplianceType = 1, ApplianceWatt = 100 WHERE ID = 55223;
UPDATE Resources SET Title = 'Switch 5', ApplianceType = 1, ApplianceWatt = 100 WHERE ID = 55224;
UPDATE Resources SET Title = 'Dimmer 1', ApplianceType = 4, ApplianceWatt = 100 WHERE ID = 55225;
DELETE FROM ThemeSettings WHERE ResourceID IN (SELECT ID FROM Resources WHERE DeviceID = 4587);
DELETE FROM Timers WHERE ResourceID IN (SELECT ID FROM Resources WHERE DeviceID = 4587);
DELETE FROM Resources WHERE DeviceID  = 4587;
DELETE FROM Devices WHERE ID = 4587;
DELETE FROM Spaces WHERE ID = 407;
DELETE FROM Spaces WHERE ID = 412;
INSERT INTO Spaces (ID, Title, Description, SiteID, CreatedOn) VALUES (414, 'Master Bedroom', ' ', 167, '2022-09-01 15:49:06');
INSERT INTO Spaces (ID, Title, Description, SiteID, CreatedOn) VALUES (415, 'Living Room', ' ', 167, '2022-09-01 15:49:12');
INSERT INTO Spaces (ID, Title, Description, SiteID, CreatedOn) VALUES (416, 'Kitchen', ' ', 167, '2022-09-01 15:49:20');
DELETE FROM Spaces WHERE ID = 416;
INSERT INTO Spaces (ID, Title, Description, SiteID, CreatedOn) VALUES (417, 'Kitchen', ' ', 167, '2022-09-01 15:49:44');
INSERT INTO Devices (ID, Title, Description, SpaceID, CategoryID, RegisteredOn, ModelID) VALUES (4587, 'Multi Switch', ' ', 414, 2, '2022-09-01 15:51:21', '47');
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55220, 'Switch 1', 4587, 1, 0, 0, 0, 0);
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55221, 'Switch 2', 4587, 2, 0, 0, 0, 0);
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55222, 'Switch 3', 4587, 3, 0, 0, 0, 0);
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55223, 'Switch 4', 4587, 4, 0, 0, 0, 0);
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55224, 'Switch 5', 4587, 5, 0, 0, 0, 0);
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55225, 'Dimmer 1', 4587, 6, 0, 0, 0, 0);
UPDATE Resources SET Title = 'Switch 1', ApplianceType = 1, ApplianceWatt = 100 WHERE ID = 55220;
UPDATE Resources SET Title = 'Switch 2', ApplianceType = 1, ApplianceWatt = 100 WHERE ID = 55221;
UPDATE Resources SET Title = 'Switch 3', ApplianceType = 1, ApplianceWatt = 100 WHERE ID = 55222;
UPDATE Resources SET Title = 'Switch 4', ApplianceType = 1, ApplianceWatt = 100 WHERE ID = 55223;
UPDATE Resources SET Title = 'Switch 5', ApplianceType = 1, ApplianceWatt = 100 WHERE ID = 55224;
UPDATE Resources SET Title = 'Dimmer 1', ApplianceType = 4, ApplianceWatt = 100 WHERE ID = 55225;
INSERT INTO Devices (ID, Title, Description, SpaceID, CategoryID, RegisteredOn, ModelID) VALUES (4626, 'Muni Device', ' ', 414, 2, '2022-09-01 15:57:18', '36');
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55395, 'Switch 1', 4626, 1, 0, 0, 0, 0);
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55396, 'Switch 2', 4626, 2, 0, 0, 0, 0);
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55397, 'Switch 3', 4626, 3, 0, 0, 0, 0);
UPDATE Resources SET Title = 'Switch 1', ApplianceType = 1, ApplianceWatt = 100 WHERE ID = 55395;
UPDATE Resources SET Title = 'Switch 2', ApplianceType = 1, ApplianceWatt = 100 WHERE ID = 55396;
DELETE FROM ThemeSettings WHERE ResourceID IN (SELECT ID FROM Resources WHERE DeviceID = 4626);
DELETE FROM Timers WHERE ResourceID IN (SELECT ID FROM Resources WHERE DeviceID = 4626);
DELETE FROM Resources WHERE DeviceID  = 4626;
DELETE FROM Devices WHERE ID = 4626;
DELETE FROM ThemeSettings WHERE ResourceID IN (SELECT ID FROM Resources WHERE DeviceID = 4587);
DELETE FROM Timers WHERE ResourceID IN (SELECT ID FROM Resources WHERE DeviceID = 4587);
DELETE FROM Resources WHERE DeviceID  = 4587;
DELETE FROM Devices WHERE ID = 4587;
DELETE FROM Spaces WHERE ID = 417;
DELETE FROM Spaces WHERE ID = 415;
DELETE FROM Spaces WHERE ID = 414;
INSERT INTO Spaces (ID, Title, Description, SiteID, CreatedOn) VALUES (418, 'Master Bedroom', ' ', 167, '2022-09-01 16:00:23');
INSERT INTO Spaces (ID, Title, Description, SiteID, CreatedOn) VALUES (419, 'Living Room', ' ', 167, '2022-09-01 16:00:25');
INSERT INTO Spaces (ID, Title, Description, SiteID, CreatedOn) VALUES (420, 'Kitchen', ' ', 167, '2022-09-01 16:00:29');
INSERT INTO Devices (ID, Title, Description, SpaceID, CategoryID, RegisteredOn, ModelID) VALUES (4587, 'Multi Switch', ' ', 418, 2, '2022-09-01 16:00:51', '47');
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55220, 'Switch 1', 4587, 1, 0, 0, 0, 0);
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55221, 'Switch 2', 4587, 2, 0, 0, 0, 0);
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55222, 'Switch 3', 4587, 3, 0, 0, 0, 0);
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55223, 'Switch 4', 4587, 4, 0, 0, 0, 0);
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55224, 'Switch 5', 4587, 5, 0, 0, 0, 0);
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55225, 'Dimmer 1', 4587, 6, 0, 0, 0, 0);
UPDATE Resources SET Title = 'Switch 1', ApplianceType = 1, ApplianceWatt = 100 WHERE ID = 55220;
UPDATE Resources SET Title = 'Switch 2', ApplianceType = 1, ApplianceWatt = 100 WHERE ID = 55221;
UPDATE Resources SET Title = 'Switch 3', ApplianceType = 1, ApplianceWatt = 100 WHERE ID = 55222;
UPDATE Resources SET Title = 'Switch 4', ApplianceType = 1, ApplianceWatt = 100 WHERE ID = 55223;
UPDATE Resources SET Title = 'Switch 5', ApplianceType = 1, ApplianceWatt = 100 WHERE ID = 55224;
UPDATE Resources SET Title = 'Dimmer 1', ApplianceType = 4, ApplianceWatt = 100 WHERE ID = 55225;
INSERT INTO Devices (ID, Title, Description, SpaceID, CategoryID, RegisteredOn, ModelID) VALUES (4626, 'Mini Swi', ' ', 418, 2, '2022-09-01 16:05:03', '36');
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55395, 'Switch 1', 4626, 1, 0, 0, 0, 0);
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55396, 'Switch 2', 4626, 2, 0, 0, 0, 0);
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55397, 'Switch 3', 4626, 3, 0, 0, 0, 0);
UPDATE Resources SET Title = 'Switch 1', ApplianceType = 1, ApplianceWatt = 100 WHERE ID = 55395;
UPDATE Resources SET Title = 'Switch 2', ApplianceType = 1, ApplianceWatt = 100 WHERE ID = 55396;
UPDATE Resources SET Title = 'Switch 3', ApplianceType = 1, ApplianceWatt = 100 WHERE ID = 55397;
INSERT INTO Devices (ID, Title, Description, SpaceID, CategoryID, RegisteredOn, ModelID) VALUES (4640, 'Power Plug', ' ', 418, 2, '2022-09-01 16:07:17', '50');
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55434, 'Switch 1', 4640, 1, 0, 0, 0, 0);
UPDATE Resources SET Title = 'Switch 1', ApplianceType = 6, ApplianceWatt = 500 WHERE ID = 55434;
INSERT INTO Devices (ID, Title, Description, SpaceID, CategoryID, RegisteredOn, ModelID) VALUES (4759, 'My Sensors', ' ', 418, 3, '2022-09-01 16:08:24', '37');
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (56134, 'Temperature', 4759, 9, 0, 0, 0, 0);
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (56135, 'Light', 4759, 11, 0, 0, 0, 0);
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (56136, 'Occupancy', 4759, 12, 0, 0, 0, 0);
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (56137, 'Humidity', 4759, 13, 0, 0, 0, 0);
UPDATE Devices SET Title = 'Sensors', SpaceID = 418 WHERE ID = 4759;
INSERT INTO Devices (ID, Title, Description, SpaceID, CategoryID, RegisteredOn, ModelID) VALUES (4588, 'Multi Switchs', ' ', 419, 2, '2022-09-01 16:09:43', '47');
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55226, 'Switch 1', 4588, 1, 0, 0, 0, 0);
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55227, 'Switch 2', 4588, 2, 0, 0, 0, 0);
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55228, 'Switch 3', 4588, 3, 0, 0, 0, 0);
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55229, 'Switch 4', 4588, 4, 0, 0, 0, 0);
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55230, 'Switch 5', 4588, 5, 0, 0, 0, 0);
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55231, 'Dimmer 1', 4588, 6, 0, 0, 0, 0);
UPDATE Resources SET Title = 'Switch 1', ApplianceType = 1, ApplianceWatt = 100 WHERE ID = 55226;
UPDATE Resources SET Title = 'Switch 2', ApplianceType = 1, ApplianceWatt = 100 WHERE ID = 55227;
UPDATE Resources SET Title = 'Switch 3', ApplianceType = 1, ApplianceWatt = 100 WHERE ID = 55228;
UPDATE Resources SET Title = 'Switch 4', ApplianceType = 1, ApplianceWatt = 100 WHERE ID = 55229;
UPDATE Resources SET Title = 'Switch 5', ApplianceType = 1, ApplianceWatt = 100 WHERE ID = 55230;
UPDATE Resources SET Title = 'Dimmer 1', ApplianceType = 4, ApplianceWatt = 100 WHERE ID = 55231;
INSERT INTO Devices (ID, Title, Description, SpaceID, CategoryID, RegisteredOn, ModelID) VALUES (4609, 'My Multi Switch', ' ', 420, 2, '2022-09-01 16:10:59', '47');
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55326, 'Switch 1', 4609, 1, 0, 0, 0, 0);
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55327, 'Switch 2', 4609, 2, 0, 0, 0, 0);
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55328, 'Switch 3', 4609, 3, 0, 0, 0, 0);
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55329, 'Switch 4', 4609, 4, 0, 0, 0, 0);
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55330, 'Switch 5', 4609, 5, 0, 0, 0, 0);
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55331, 'Dimmer 1', 4609, 6, 0, 0, 0, 0);
UPDATE Resources SET Title = 'Switch 1', ApplianceType = 1, ApplianceWatt = 100 WHERE ID = 55326;
UPDATE Resources SET Title = 'Switch 2', ApplianceType = 1, ApplianceWatt = 100 WHERE ID = 55327;
UPDATE Resources SET Title = 'Switch 3', ApplianceType = 1, ApplianceWatt = 100 WHERE ID = 55328;
UPDATE Resources SET Title = 'Switch 4', ApplianceType = 1, ApplianceWatt = 100 WHERE ID = 55329;
UPDATE Resources SET Title = 'Switch 5', ApplianceType = 1, ApplianceWatt = 100 WHERE ID = 55330;
UPDATE Resources SET Title = 'Dimmer 1', ApplianceType = 4, ApplianceWatt = 100 WHERE ID = 55331;
INSERT INTO Devices (ID, Title, Description, SpaceID, CategoryID, RegisteredOn, ModelID) VALUES (4631, 'Mini Switchs', ' ', 419, 2, '2022-09-01 16:12:06', '36');
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55410, 'Switch 1', 4631, 1, 0, 0, 0, 0);
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55411, 'Switch 2', 4631, 2, 0, 0, 0, 0);
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55412, 'Switch 3', 4631, 3, 0, 0, 0, 0);
UPDATE Resources SET Title = 'Switch 1', ApplianceType = 1, ApplianceWatt = 100 WHERE ID = 55410;
UPDATE Resources SET Title = 'Switch 2', ApplianceType = 1, ApplianceWatt = 100 WHERE ID = 55411;
UPDATE Resources SET Title = 'Switch 3', ApplianceType = 1, ApplianceWatt = 100 WHERE ID = 55412;
UPDATE Resources SET IsFavorite = 1 WHERE ID = 55222;
UPDATE Resources SET IsFavorite = 1 WHERE ID = 55397;
UPDATE Resources SET IsFavorite = 1 WHERE ID = 55228;
UPDATE Resources SET IsFavorite = 1 WHERE ID = 55412;
UPDATE Resources SET IsFavorite = 1 WHERE ID = 55328;
UPDATE Resources SET IsFavorite = 0 WHERE ID = 55328;
UPDATE Resources SET IsFavorite = 0 WHERE ID = 55412;
UPDATE Resources SET IsFavorite = 0 WHERE ID = 55228;
UPDATE Resources SET IsFavorite = 0 WHERE ID = 55222;
UPDATE Resources SET IsFavorite = 0 WHERE ID = 55397;
INSERT INTO Themes (ID, Title, Description, ThemeType, SiteID, CreatedOn) VALUES (312, 'Master Room Theme', ' ', 1, 167, '2022-09-01 16:14:15');
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4053, 312, 55220, 0);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4054, 312, 55221, 0);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4055, 312, 55222, 0);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4056, 312, 55223, 0);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4057, 312, 55224, 0);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4058, 312, 55225, 8);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4059, 312, 55395, 0);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4060, 312, 55396, 0);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4061, 312, 55397, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4062, 312, 55434, 0);
DELETE FROM ThemeSettings WHERE ThemeID = 312;
DELETE FROM Themes WHERE ID = 312;
INSERT INTO Themes (ID, Title, Description, ThemeType, StartTime, EndTime, SiteID, CreatedOn) VALUES (313, 'My Manual Theme', ' ', 2, '0:35', '16:21', 167, '2022-09-01 16:16:04');
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4063, 313, 55220, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4064, 313, 55221, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4065, 313, 55222, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4066, 313, 55223, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4067, 313, 55224, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4068, 313, 55225, 0);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4069, 313, 55395, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4070, 313, 55396, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4071, 313, 55397, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4072, 313, 55434, 1);
DELETE FROM ThemeSettings WHERE ThemeID = 313;
DELETE FROM Themes WHERE ID = 313;
INSERT INTO Rules (ID, Title, SiteID, SensorID, TargetResourceID, OnValue, OffValue, CreatedOn,IfGreater,SensorAccID) VALUES (140, 'Switch 3', '167', '4759', '55222', 0, 100, '2022-09-01 16:32:19','0',9);
DELETE FROM Rules WHERE ID = 140;
INSERT INTO Rules (ID, Title, SiteID, SensorID, TargetResourceID, OnValue, OffValue, CreatedOn,IfGreater,SensorAccID) VALUES (141, 'Switch 5', '167', '4759', '55224', 1, 0, '2022-09-01 16:32:35','0',12);
INSERT INTO Rules (ID, Title, SiteID, SensorID, TargetResourceID, OnValue, OffValue, CreatedOn,IfGreater,SensorAccID) VALUES (142, 'Switch 5', '167', '4759', '55224', 1, 1, '2022-09-01 16:32:38','0',12);
INSERT INTO Rules (ID, Title, SiteID, SensorID, TargetResourceID, OnValue, OffValue, CreatedOn,IfGreater,SensorAccID) VALUES (143, 'Switch 5', '167', '4759', '55224', 0, 2, '2022-09-01 16:32:41','0',13);
DELETE FROM Rules WHERE ID = 143;
DELETE FROM Rules WHERE ID = 142;
DELETE FROM Rules WHERE ID = 141;
UPDATE Resources SET Title = 'Switch 1', ApplianceType = 7, ApplianceWatt = 500 WHERE ID = 55434;
UPDATE Resources SET Title = 'Switch 1', ApplianceType = 6, ApplianceWatt = 500 WHERE ID = 55434;
UPDATE Resources SET IsFavorite = 1 WHERE ID = 55222;
UPDATE Resources SET IsFavorite = 0 WHERE ID = 55222;
UPDATE Resources SET IsFavorite = 1 WHERE ID = 55222;
UPDATE Resources SET IsFavorite = 0 WHERE ID = 55222;
UPDATE Resources SET IsFavorite = 1 WHERE ID = 55222;
INSERT INTO Themes (ID, Title, Description, ThemeType, SiteID, CreatedOn) VALUES (314, 'Living theme', ' ', 1, 167, '2022-09-06 00:40:13');
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4073, 314, 55220, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4074, 314, 55221, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4075, 314, 55222, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4076, 314, 55223, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4077, 314, 55224, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4078, 314, 55225, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4079, 314, 55395, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4080, 314, 55396, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4081, 314, 55397, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4082, 314, 55434, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4083, 314, 55326, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4084, 314, 55327, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4085, 314, 55328, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4086, 314, 55329, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4087, 314, 55330, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4088, 314, 55331, 1);
INSERT INTO Themes (ID, Title, Description, ThemeType, SiteID, CreatedOn) VALUES (315, 'Theme', ' ', 1, 167, '2022-09-15 10:14:01');
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4089, 315, 55220, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4090, 315, 55221, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4091, 315, 55222, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4092, 315, 55223, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4093, 315, 55224, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4094, 315, 55225, 0);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4095, 315, 55395, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4096, 315, 55396, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4097, 315, 55397, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4098, 315, 55434, 1);
INSERT INTO Devices (ID, Title, Description, SpaceID, CategoryID, RegisteredOn, ModelID) VALUES (4596, 'Qqq', ' ', 420, 2, '2022-09-15 11:56:08', '47');
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55256, '', 4596, 1, 0, 0, 0, 0);
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55257, '', 4596, 2, 0, 0, 0, 0);
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55258, '', 4596, 3, 0, 0, 0, 0);
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55259, '', 4596, 4, 0, 0, 0, 0);
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55260, '', 4596, 5, 0, 0, 0, 0);
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55261, '', 4596, 6, 0, 0, 0, 0);
UPDATE Resources SET Title = '1 Switch', ApplianceType = 1, ApplianceWatt = 22 WHERE ID = 55256;
UPDATE Resources SET Title = '2 Switch', ApplianceType = 1, ApplianceWatt = 11 WHERE ID = 55257;
UPDATE Resources SET Title = '3 Switch', ApplianceType = 1, ApplianceWatt = 33 WHERE ID = 55258;
UPDATE Resources SET Title = 'Switch 4', ApplianceType = 3, ApplianceWatt = 33 WHERE ID = 55259;
UPDATE Resources SET Title = '4 Switch', ApplianceType = 5, ApplianceWatt = 33 WHERE ID = 55260;
UPDATE Resources SET Title = '5 Switch', ApplianceType = 4, ApplianceWatt = 55 WHERE ID = 55261;
DELETE FROM ThemeSettings WHERE ResourceID IN (SELECT ID FROM Resources WHERE DeviceID = 4596);
DELETE FROM Timers WHERE ResourceID IN (SELECT ID FROM Resources WHERE DeviceID = 4596);
DELETE FROM Resources WHERE DeviceID  = 4596;
DELETE FROM Devices WHERE ID = 4596;
INSERT INTO Themes (ID, Title, Description, ThemeType, StartTime, EndTime, SiteID, CreatedOn) VALUES (316, 'Ee', ' ', 2, '15:40', '15:41', 167, '2022-09-15 15:35:31');
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4099, 316, 55226, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4100, 316, 55227, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4101, 316, 55228, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4102, 316, 55229, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4103, 316, 55230, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4104, 316, 55231, 0);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4105, 316, 55410, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4106, 316, 55411, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4107, 316, 55412, 1);
INSERT INTO Themes (ID, Title, Description, ThemeType, SiteID, CreatedOn) VALUES (317, 'Manual Theme', ' ', 1, 167, '2022-09-21 12:34:46');
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4108, 317, 55220, 0);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4109, 317, 55221, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4110, 317, 55222, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4111, 317, 55223, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4112, 317, 55224, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4113, 317, 55225, 0);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4114, 317, 55395, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4115, 317, 55396, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4116, 317, 55397, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4117, 317, 55434, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4118, 317, 55226, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4119, 317, 55227, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4120, 317, 55228, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4121, 317, 55229, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4122, 317, 55230, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4123, 317, 55231, 0);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4124, 317, 55410, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4125, 317, 55411, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4126, 317, 55412, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4127, 317, 55326, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4128, 317, 55327, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4129, 317, 55328, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4130, 317, 55329, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4131, 317, 55330, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4132, 317, 55331, 0);
INSERT INTO Themes (ID, Title, Description, ThemeType, SiteID, CreatedOn) VALUES (318, 'Www', ' ', 1, 167, '2022-09-21 12:36:25');
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4133, 318, 55220, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4134, 318, 55221, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4135, 318, 55222, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4136, 318, 55223, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4137, 318, 55224, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4138, 318, 55225, 0);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4139, 318, 55395, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4140, 318, 55396, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4141, 318, 55397, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4142, 318, 55434, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4143, 318, 55226, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4144, 318, 55227, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4145, 318, 55228, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4146, 318, 55229, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4147, 318, 55230, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4148, 318, 55231, 0);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4149, 318, 55410, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4150, 318, 55411, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4151, 318, 55412, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4152, 318, 55326, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4153, 318, 55327, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4154, 318, 55328, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4155, 318, 55329, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4156, 318, 55330, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4157, 318, 55331, 0);
INSERT INTO Themes (ID, Title, Description, ThemeType, SiteID, CreatedOn) VALUES (319, 'Ghh', ' ', 1, 167, '2022-09-22 06:58:05');
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4158, 319, 55220, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4159, 319, 55221, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4160, 319, 55222, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4161, 319, 55223, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4162, 319, 55224, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4163, 319, 55225, 0);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4164, 319, 55395, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4165, 319, 55396, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4166, 319, 55397, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4167, 319, 55434, 1);
INSERT INTO Themes (ID, Title, Description, ThemeType, StartTime, EndTime, SiteID, CreatedOn) VALUES (320, 'Fhh', ' ', 2, '7:10', '10:3', 167, '2022-09-22 06:58:19');
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4168, 320, 55220, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4169, 320, 55221, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4170, 320, 55222, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4171, 320, 55223, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4172, 320, 55224, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4173, 320, 55225, 0);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4174, 320, 55395, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4175, 320, 55396, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4176, 320, 55397, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4177, 320, 55434, 1);
UPDATE Devices SET Title = 'Sensors', SpaceID = 419 WHERE ID = 4759;
INSERT INTO Themes (ID, Title, Description, ThemeType, SiteID, CreatedOn) VALUES (321, 'T Theme', ' ', 1, 167, '2022-09-27 12:26:09');
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4178, 321, 55220, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4179, 321, 55221, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4180, 321, 55222, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4181, 321, 55223, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4182, 321, 55224, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4183, 321, 55225, 0);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4184, 321, 55395, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4185, 321, 55396, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4186, 321, 55397, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4187, 321, 55434, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4188, 321, 55226, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4189, 321, 55227, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4190, 321, 55228, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4191, 321, 55229, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4192, 321, 55230, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4193, 321, 55231, 0);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4194, 321, 55410, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4195, 321, 55411, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4196, 321, 55412, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4197, 321, 55326, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4198, 321, 55327, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4199, 321, 55328, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4200, 321, 55329, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4201, 321, 55330, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4202, 321, 55331, 0);
INSERT INTO Themes (ID, Title, Description, ThemeType, SiteID, CreatedOn) VALUES (322, 'Qqqq', ' ', 1, 167, '2022-09-27 12:27:40');
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4203, 322, 55220, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4204, 322, 55221, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4205, 322, 55222, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4206, 322, 55223, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4207, 322, 55224, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4208, 322, 55225, 0);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4209, 322, 55395, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4210, 322, 55396, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4211, 322, 55397, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4212, 322, 55434, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4213, 322, 55226, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4214, 322, 55227, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4215, 322, 55228, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4216, 322, 55229, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4217, 322, 55230, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4218, 322, 55231, 0);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4219, 322, 55410, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4220, 322, 55411, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4221, 322, 55412, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4222, 322, 55326, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4223, 322, 55327, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4224, 322, 55328, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4225, 322, 55329, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4226, 322, 55330, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4227, 322, 55331, 0);
INSERT INTO Themes (ID, Title, Description, ThemeType, SiteID, CreatedOn) VALUES (323, 'Qwerty', ' ', 1, 167, '2022-09-27 12:30:40');
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4228, 323, 55220, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4229, 323, 55221, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4230, 323, 55222, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4231, 323, 55223, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4232, 323, 55224, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4233, 323, 55225, 0);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4234, 323, 55395, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4235, 323, 55396, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4236, 323, 55397, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4237, 323, 55434, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4238, 323, 55226, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4239, 323, 55227, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4240, 323, 55228, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4241, 323, 55229, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4242, 323, 55230, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4243, 323, 55231, 0);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4244, 323, 55410, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4245, 323, 55411, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4246, 323, 55412, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4247, 323, 55326, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4248, 323, 55327, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4249, 323, 55328, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4250, 323, 55329, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4251, 323, 55330, 1);
INSERT INTO ThemeSettings (ID, ThemeID, ResourceID, TargetValue) VALUES (4252, 323, 55331, 0);
DELETE FROM ThemeSettings WHERE ResourceID IN (SELECT ID FROM Resources WHERE DeviceID = 4609);
DELETE FROM Timers WHERE ResourceID IN (SELECT ID FROM Resources WHERE DeviceID = 4609);
DELETE FROM Resources WHERE DeviceID  = 4609;
DELETE FROM Devices WHERE ID = 4609;
DELETE FROM Rules WHERE SensorID = 4759;
DELETE FROM Resources WHERE DeviceID  = 4759;
DELETE FROM Devices WHERE ID = 4759;
DELETE FROM ThemeSettings WHERE ResourceID IN (SELECT ID FROM Resources WHERE DeviceID = 4631);
DELETE FROM Timers WHERE ResourceID IN (SELECT ID FROM Resources WHERE DeviceID = 4631);
DELETE FROM Resources WHERE DeviceID  = 4631;
DELETE FROM Devices WHERE ID = 4631;
DELETE FROM ThemeSettings WHERE ResourceID IN (SELECT ID FROM Resources WHERE DeviceID = 4588);
DELETE FROM Themes WHERE ID = 316;
DELETE FROM Timers WHERE ResourceID IN (SELECT ID FROM Resources WHERE DeviceID = 4588);
DELETE FROM Resources WHERE DeviceID  = 4588;
DELETE FROM Devices WHERE ID = 4588;
DELETE FROM ThemeSettings WHERE ResourceID IN (SELECT ID FROM Resources WHERE DeviceID = 4640);
DELETE FROM Timers WHERE ResourceID IN (SELECT ID FROM Resources WHERE DeviceID = 4640);
DELETE FROM Resources WHERE DeviceID  = 4640;
DELETE FROM Devices WHERE ID = 4640;
DELETE FROM ThemeSettings WHERE ResourceID IN (SELECT ID FROM Resources WHERE DeviceID = 4626);
DELETE FROM Timers WHERE ResourceID IN (SELECT ID FROM Resources WHERE DeviceID = 4626);
DELETE FROM Resources WHERE DeviceID  = 4626;
DELETE FROM Devices WHERE ID = 4626;
DELETE FROM ThemeSettings WHERE ResourceID IN (SELECT ID FROM Resources WHERE DeviceID = 4587);
DELETE FROM Themes WHERE ID = 314;
DELETE FROM Themes WHERE ID = 315;
DELETE FROM Themes WHERE ID = 317;
DELETE FROM Themes WHERE ID = 318;
DELETE FROM Themes WHERE ID = 319;
DELETE FROM Themes WHERE ID = 320;
DELETE FROM Themes WHERE ID = 321;
DELETE FROM Themes WHERE ID = 322;
DELETE FROM Themes WHERE ID = 323;
DELETE FROM Timers WHERE ResourceID IN (SELECT ID FROM Resources WHERE DeviceID = 4587);
DELETE FROM Resources WHERE DeviceID  = 4587;
DELETE FROM Devices WHERE ID = 4587;
DELETE FROM Spaces WHERE ID = 420;
DELETE FROM Spaces WHERE ID = 419;
DELETE FROM Spaces WHERE ID = 418;
UPDATE Sites SET Title = 'My Home', Description = ' ' WHERE ID = 167;
INSERT INTO Spaces (ID, Title, Description, SiteID, CreatedOn) VALUES (422, 'Study Room', ' ', 167, '2022-09-30 11:06:09');
INSERT INTO Devices (ID, Title, Description, SpaceID, CategoryID, RegisteredOn, ModelID) VALUES (4587, 'Multi', ' ', 422, 2, '2022-09-30 11:06:37', '47');
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55220, 'Switch 1', 4587, 1, 0, 0, 0, 0);
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55221, 'Switch 2', 4587, 2, 0, 0, 0, 0);
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55222, 'Switch 3', 4587, 3, 0, 0, 0, 0);
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55223, 'Switch 4', 4587, 4, 0, 0, 0, 0);
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55224, 'Switch 5', 4587, 5, 0, 0, 0, 0);
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55225, 'Dimmer 1', 4587, 6, 0, 0, 0, 0);
UPDATE Resources SET Title = 'Switch 1', ApplianceType = 1, ApplianceWatt = 10 WHERE ID = 55220;
UPDATE Resources SET Title = 'Switch 2', ApplianceType = 1, ApplianceWatt = 10 WHERE ID = 55221;
UPDATE Resources SET Title = 'Switch 3', ApplianceType = 1, ApplianceWatt = 10 WHERE ID = 55222;
UPDATE Resources SET Title = 'Switch 4', ApplianceType = 1, ApplianceWatt = 4 WHERE ID = 55223;
UPDATE Resources SET Title = 'Switch 5', ApplianceType = 1, ApplianceWatt = 5 WHERE ID = 55224;
UPDATE Resources SET Title = 'Dimmer 1', ApplianceType = 4, ApplianceWatt = 6 WHERE ID = 55225;
INSERT INTO Devices (ID, Title, Description, SpaceID, CategoryID, RegisteredOn, ModelID) VALUES (4631, 'Mini', ' ', 422, 2, '2022-09-30 11:08:13', '36');
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55410, 'Switch 1', 4631, 1, 0, 0, 0, 0);
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55411, 'Switch 2', 4631, 2, 0, 0, 0, 0);
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55412, 'Switch 3', 4631, 3, 0, 0, 0, 0);
UPDATE Resources SET Title = 'Switch 1', ApplianceType = 1, ApplianceWatt = 10 WHERE ID = 55410;
UPDATE Resources SET Title = 'Switch 2', ApplianceType = 1, ApplianceWatt = 10 WHERE ID = 55411;
UPDATE Resources SET Title = 'Switch 3', ApplianceType = 1, ApplianceWatt = 10 WHERE ID = 55412;
INSERT INTO Devices (ID, Title, Description, SpaceID, CategoryID, RegisteredOn, ModelID) VALUES (4640, 'Plug', ' ', 422, 2, '2022-09-30 11:10:10', '50');
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55434, 'Switch 1', 4640, 1, 0, 0, 0, 0);
UPDATE Resources SET Title = 'Switch 1', ApplianceType = 6, ApplianceWatt = 100 WHERE ID = 55434;
INSERT INTO Devices (ID, Title, Description, SpaceID, CategoryID, RegisteredOn, ModelID) VALUES (4759, 'Sensor', ' ', 422, 3, '2022-09-30 11:11:43', '37');
INSERT INTO Devices (ID, Title, Description, SpaceID, CategoryID, RegisteredOn, ModelID) VALUES (4762, 'Ir', ' ', 422, 4, '2022-09-30 11:12:22', '51');
1
DELETE FROM Resources WHERE DeviceID  = 4762;
DELETE FROM Devices WHERE ID = 4762;
DELETE FROM Rules WHERE SensorID = 4759;
DELETE FROM Resources WHERE DeviceID  = 4759;
DELETE FROM Devices WHERE ID = 4759;
DELETE FROM ThemeSettings WHERE ResourceID IN (SELECT ID FROM Resources WHERE DeviceID = 4640);
DELETE FROM Timers WHERE ResourceID IN (SELECT ID FROM Resources WHERE DeviceID = 4640);
DELETE FROM Resources WHERE DeviceID  = 4640;
DELETE FROM Devices WHERE ID = 4640;
DELETE FROM ThemeSettings WHERE ResourceID IN (SELECT ID FROM Resources WHERE DeviceID = 4631);
DELETE FROM Timers WHERE ResourceID IN (SELECT ID FROM Resources WHERE DeviceID = 4631);
DELETE FROM Resources WHERE DeviceID  = 4631;
DELETE FROM Devices WHERE ID = 4631;
DELETE FROM ThemeSettings WHERE ResourceID IN (SELECT ID FROM Resources WHERE DeviceID = 4587);
DELETE FROM Timers WHERE ResourceID IN (SELECT ID FROM Resources WHERE DeviceID = 4587);
DELETE FROM Resources WHERE DeviceID  = 4587;
DELETE FROM Devices WHERE ID = 4587;
DELETE FROM Spaces WHERE ID = 422;
INSERT INTO Spaces (ID, Title, Description, SiteID, CreatedOn) VALUES (423, 'Study Room', ' ', 167, '2022-09-30 11:13:14');
DELETE FROM Spaces WHERE ID = 423;
INSERT INTO Spaces (ID, Title, Description, SiteID, CreatedOn) VALUES (424, 'Study Room', ' ', 167, '2022-09-30 11:13:45');
INSERT INTO Devices (ID, Title, Description, SpaceID, CategoryID, RegisteredOn, ModelID) VALUES (4762, 'Ir', ' ', 424, 4, '2022-09-30 11:14:07', '51');
INSERT INTO Devices (ID, Title, Description, SpaceID, CategoryID, RegisteredOn, ModelID) VALUES (4759, 'Sensor', ' ', 424, 3, '2022-09-30 11:14:54', '37');
INSERT INTO Devices (ID, Title, Description, SpaceID, CategoryID, RegisteredOn, ModelID) VALUES (4640, 'Plug', ' ', 424, 2, '2022-09-30 11:15:33', '50');
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55434, 'Switch 1', 4640, 1, 0, 0, 0, 0);
UPDATE Resources SET Title = 'Switch 1', ApplianceType = 6, ApplianceWatt = 100 WHERE ID = 55434;
INSERT INTO Devices (ID, Title, Description, SpaceID, CategoryID, RegisteredOn, ModelID) VALUES (4626, 'Mini', ' ', 424, 2, '2022-09-30 11:16:14', '36');
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55395, 'Switch 1', 4626, 1, 0, 0, 0, 0);
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55396, 'Switch 2', 4626, 2, 0, 0, 0, 0);
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55397, 'Switch 3', 4626, 3, 0, 0, 0, 0);
UPDATE Resources SET Title = 'Switch 1', ApplianceType = 1, ApplianceWatt = 10 WHERE ID = 55395;
UPDATE Resources SET Title = 'Switch 2', ApplianceType = 1, ApplianceWatt = 10 WHERE ID = 55396;
UPDATE Resources SET Title = 'Switch 3', ApplianceType = 1, ApplianceWatt = 10 WHERE ID = 55397;
INSERT INTO Devices (ID, Title, Description, SpaceID, CategoryID, RegisteredOn, ModelID) VALUES (4587, 'Multi', ' ', 424, 2, '2022-09-30 11:17:31', '47');
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55220, 'Switch 1', 4587, 1, 0, 0, 0, 0);
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55221, 'Switch 2', 4587, 2, 0, 0, 0, 0);
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55222, 'Switch 3', 4587, 3, 0, 0, 0, 0);
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55223, 'Switch 4', 4587, 4, 0, 0, 0, 0);
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55224, 'Switch 5', 4587, 5, 0, 0, 0, 0);
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55225, 'Dimmer 1', 4587, 6, 0, 0, 0, 0);
UPDATE Resources SET Title = 'Switch 1', ApplianceType = 1, ApplianceWatt = 10 WHERE ID = 55220;
UPDATE Resources SET Title = 'Switch 2', ApplianceType = 1, ApplianceWatt = 10 WHERE ID = 55221;
UPDATE Resources SET Title = 'Switch 3', ApplianceType = 3, ApplianceWatt = 10 WHERE ID = 55222;
UPDATE Resources SET Title = 'Switch 4', ApplianceType = 2, ApplianceWatt = 10 WHERE ID = 55223;
UPDATE Resources SET Title = 'Switch 5', ApplianceType = 7, ApplianceWatt = 10 WHERE ID = 55224;
UPDATE Resources SET Title = 'Dimmer 1', ApplianceType = 4, ApplianceWatt = 10 WHERE ID = 55225;
INSERT INTO Spaces (ID, Title, Description, SiteID, CreatedOn) VALUES (425, 'Living Room', ' ', 167, '2022-09-30 11:18:26');
UPDATE Devices SET Title = 'Multi', SpaceID = 425 WHERE ID = 4587;
UPDATE Devices SET Title = 'Sensor', SpaceID = 425 WHERE ID = 4759;
UPDATE Devices SET Title = 'Ir', SpaceID = 425 WHERE ID = 4762;
1
DELETE FROM Resources WHERE DeviceID  = 4762;
DELETE FROM Devices WHERE ID = 4762;
UPDATE Resources SET Title = 'Switch 5', ApplianceType = 2, ApplianceWatt = 10 WHERE ID = 55224;
DELETE FROM ThemeSettings WHERE ResourceID IN (SELECT ID FROM Resources WHERE DeviceID = 4640);
DELETE FROM Timers WHERE ResourceID IN (SELECT ID FROM Resources WHERE DeviceID = 4640);
DELETE FROM Resources WHERE DeviceID  = 4640;
DELETE FROM Devices WHERE ID = 4640;
UPDATE Devices SET Title = 'Mini', SpaceID = 425 WHERE ID = 4626;
UPDATE Devices SET Title = 'Mini', SpaceID = 424 WHERE ID = 4626;
UPDATE Resources SET Title = 'Switch I 3', ApplianceType = 3, ApplianceWatt = 10 WHERE ID = 55222;
UPDATE Devices SET Title = 'Multi', SpaceID = 424 WHERE ID = 4587;
UPDATE Devices SET Title = 'Sensor', SpaceID = 424 WHERE ID = 4759;
UPDATE Devices SET Title = 'Multi', SpaceID = 425 WHERE ID = 4587;
UPDATE Devices SET Title = 'Sensor', SpaceID = 425 WHERE ID = 4759;
UPDATE Devices SET Title = 'Mini', SpaceID = 425 WHERE ID = 4626;
UPDATE Devices SET Title = 'Multi', SpaceID = 424 WHERE ID = 4587;
UPDATE Devices SET Title = 'Sensor', SpaceID = 424 WHERE ID = 4759;
UPDATE Devices SET Title = 'Mini', SpaceID = 424 WHERE ID = 4626;
UPDATE Devices SET Title = 'Multi 1', SpaceID = 424 WHERE ID = 4587;
UPDATE Devices SET Title = 'Mini 1', SpaceID = 424 WHERE ID = 4626;
UPDATE Devices SET Title = 'Sensor 1', SpaceID = 424 WHERE ID = 4759;
UPDATE Resources SET Title = 'Switch C2', ApplianceType = 1, ApplianceWatt = 10 WHERE ID = 55221;
UPDATE Devices SET Title = 'Multi 1', SpaceID = 425 WHERE ID = 4587;
UPDATE Devices SET Title = 'Sensor 1', SpaceID = 425 WHERE ID = 4759;
UPDATE Devices SET Title = 'Mini 1', SpaceID = 425 WHERE ID = 4626;
UPDATE Devices SET Title = 'Multi 1', SpaceID = 424 WHERE ID = 4587;
UPDATE Devices SET Title = 'Sensor 1', SpaceID = 424 WHERE ID = 4759;
UPDATE Devices SET Title = 'Mini 1', SpaceID = 424 WHERE ID = 4626;
UPDATE Devices SET Title = 'Mini 1', SpaceID = 425 WHERE ID = 4626;
UPDATE Devices SET Title = 'Multi 1', SpaceID = 425 WHERE ID = 4587;
UPDATE Devices SET Title = 'Multi 1', SpaceID = 424 WHERE ID = 4587;
UPDATE Devices SET Title = 'Sensor 1', SpaceID = 425 WHERE ID = 4759;
UPDATE Devices SET Title = 'Multi 1', SpaceID = 425 WHERE ID = 4587;
UPDATE Devices SET Title = 'Multi 1', SpaceID = 424 WHERE ID = 4587;
UPDATE Devices SET Title = 'Multi 1', SpaceID = 425 WHERE ID = 4587;
UPDATE Devices SET Title = 'Sensor 1', SpaceID = 424 WHERE ID = 4759;
UPDATE Devices SET Title = 'Mini 1', SpaceID = 424 WHERE ID = 4626;
UPDATE Devices SET Title = 'Mini 1', SpaceID = 425 WHERE ID = 4626;
UPDATE Devices SET Title = 'Mini 1', SpaceID = 424 WHERE ID = 4626;
UPDATE Devices SET Title = 'Mini 1', SpaceID = 425 WHERE ID = 4626;
UPDATE Devices SET Title = 'Sensor 1', SpaceID = 425 WHERE ID = 4759;
UPDATE Devices SET Title = 'Mini 1', SpaceID = 424 WHERE ID = 4626;
UPDATE Devices SET Title = 'Multi 1', SpaceID = 424 WHERE ID = 4587;
UPDATE Devices SET Title = 'Mini 1', SpaceID = 425 WHERE ID = 4626;
UPDATE Devices SET Title = 'Mini 1', SpaceID = 424 WHERE ID = 4626;
UPDATE Devices SET Title = 'Mini 1', SpaceID = 425 WHERE ID = 4626;
UPDATE Devices SET Title = 'Multi 1', SpaceID = 425 WHERE ID = 4587;
INSERT INTO Devices (ID, Title, Description, SpaceID, CategoryID, RegisteredOn, ModelID) VALUES (4627, 'Hsgs Mini', ' ', 425, 2, '2022-10-21 17:09:11', '36');
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55398, 'Switch 1', 4627, 1, 0, 0, 0, 0);
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55399, 'Switch 2', 4627, 2, 0, 0, 0, 0);
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55400, 'Switch 3', 4627, 3, 0, 0, 0, 0);
DELETE FROM ThemeSettings WHERE ResourceID IN (SELECT ID FROM Resources WHERE DeviceID = 4627);
DELETE FROM Timers WHERE ResourceID IN (SELECT ID FROM Resources WHERE DeviceID = 4627);
DELETE FROM Resources WHERE DeviceID  = 4627;
DELETE FROM Devices WHERE ID = 4627;
DELETE FROM ThemeSettings WHERE ResourceID IN (SELECT ID FROM Resources WHERE DeviceID = 4626);
DELETE FROM Timers WHERE ResourceID IN (SELECT ID FROM Resources WHERE DeviceID = 4626);
DELETE FROM Resources WHERE DeviceID  = 4626;
DELETE FROM Devices WHERE ID = 4626;
DELETE FROM Rules WHERE SensorID = 4759;
DELETE FROM Resources WHERE DeviceID  = 4759;
DELETE FROM Devices WHERE ID = 4759;
INSERT INTO Devices (ID, Title, Description, SpaceID, CategoryID, RegisteredOn, ModelID) VALUES (4627, '4627', ' ', 425, 2, '2022-10-21 17:10:26', '36');
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55398, 'Switch 1', 4627, 1, 0, 0, 0, 0);
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55399, 'Switch 2', 4627, 2, 0, 0, 0, 0);
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55400, 'Switch 3', 4627, 3, 0, 0, 0, 0);
INSERT INTO Devices (ID, Title, Description, SpaceID, CategoryID, RegisteredOn, ModelID) VALUES (4626, '4626', ' ', 425, 2, '2022-10-21 17:11:05', '36');
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55395, 'Switch 1', 4626, 1, 0, 0, 0, 0);
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55396, 'Switch 2', 4626, 2, 0, 0, 0, 0);
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55397, 'Switch 3', 4626, 3, 0, 0, 0, 0);
UPDATE Resources SET Title = 'Switch 1', ApplianceType = 1, ApplianceWatt = 10 WHERE ID = 55395;
UPDATE Resources SET Title = 'Switch 2', ApplianceType = 1, ApplianceWatt = 10 WHERE ID = 55396;
UPDATE Resources SET Title = 'Switch 3', ApplianceType = 1, ApplianceWatt = 10 WHERE ID = 55397;
DELETE FROM ThemeSettings WHERE ResourceID IN (SELECT ID FROM Resources WHERE DeviceID = 4627);
DELETE FROM Timers WHERE ResourceID IN (SELECT ID FROM Resources WHERE DeviceID = 4627);
DELETE FROM Resources WHERE DeviceID  = 4627;
DELETE FROM Devices WHERE ID = 4627;
INSERT INTO Devices (ID, Title, Description, SpaceID, CategoryID, RegisteredOn, ModelID) VALUES (4627, '4627', ' ', 425, 2, '2022-10-21 17:12:07', '36');
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55398, 'Switch 1', 4627, 1, 0, 0, 0, 0);
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55399, 'Switch 2', 4627, 2, 0, 0, 0, 0);
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55400, 'Switch 3', 4627, 3, 0, 0, 0, 0);
DELETE FROM ThemeSettings WHERE ResourceID IN (SELECT ID FROM Resources WHERE DeviceID = 4627);
DELETE FROM Timers WHERE ResourceID IN (SELECT ID FROM Resources WHERE DeviceID = 4627);
DELETE FROM Resources WHERE DeviceID  = 4627;
DELETE FROM Devices WHERE ID = 4627;
DELETE FROM ThemeSettings WHERE ResourceID IN (SELECT ID FROM Resources WHERE DeviceID = 4587);
DELETE FROM Timers WHERE ResourceID IN (SELECT ID FROM Resources WHERE DeviceID = 4587);
DELETE FROM Resources WHERE DeviceID  = 4587;
DELETE FROM Devices WHERE ID = 4587;
INSERT INTO Devices (ID, Title, Description, SpaceID, CategoryID, RegisteredOn, ModelID) VALUES (4627, '4627', ' ', 424, 2, '2022-10-21 17:13:15', '36');
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55398, 'Switch 1', 4627, 1, 0, 0, 0, 0);
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55399, 'Switch 2', 4627, 2, 0, 0, 0, 0);
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55400, 'Switch 3', 4627, 3, 0, 0, 0, 0);
UPDATE Devices SET Title = '4626', SpaceID = 424 WHERE ID = 4626;
UPDATE Devices SET Title = '4626', SpaceID = 425 WHERE ID = 4626;
UPDATE Devices SET Title = '4626', SpaceID = 424 WHERE ID = 4626;
UPDATE Devices SET Title = '4627', SpaceID = 425 WHERE ID = 4627;
UPDATE Devices SET Title = '4626', SpaceID = 425 WHERE ID = 4626;
UPDATE Devices SET Title = '4626', SpaceID = 424 WHERE ID = 4626;
UPDATE Devices SET Title = '4627', SpaceID = 424 WHERE ID = 4627;
UPDATE Devices SET Title = '4626', SpaceID = 425 WHERE ID = 4626;
UPDATE Devices SET Title = '4627', SpaceID = 425 WHERE ID = 4627;
UPDATE Devices SET Title = '4626', SpaceID = 424 WHERE ID = 4626;
UPDATE Devices SET Title = '4627', SpaceID = 424 WHERE ID = 4627;
UPDATE Devices SET Title = '4626', SpaceID = 425 WHERE ID = 4626;
UPDATE Devices SET Title = '4626', SpaceID = 424 WHERE ID = 4626;
UPDATE Devices SET Title = '4626', SpaceID = 425 WHERE ID = 4626;
UPDATE Devices SET Title = '4626', SpaceID = 424 WHERE ID = 4626;
UPDATE Devices SET Title = '4626', SpaceID = 425 WHERE ID = 4626;
UPDATE Devices SET Title = '4627', SpaceID = 425 WHERE ID = 4627;
UPDATE Devices SET Title = '4626', SpaceID = 424 WHERE ID = 4626;
UPDATE Devices SET Title = '4626', SpaceID = 425 WHERE ID = 4626;
UPDATE Devices SET Title = '4626', SpaceID = 424 WHERE ID = 4626;
UPDATE Devices SET Title = '4627', SpaceID = 424 WHERE ID = 4627;
UPDATE Devices SET Title = '4626', SpaceID = 425 WHERE ID = 4626;
UPDATE Devices SET Title = '4627', SpaceID = 425 WHERE ID = 4627;
UPDATE Devices SET Title = '4626', SpaceID = 424 WHERE ID = 4626;
UPDATE Devices SET Title = '4627', SpaceID = 424 WHERE ID = 4627;
UPDATE Devices SET Title = '4626', SpaceID = 425 WHERE ID = 4626;
UPDATE Devices SET Title = '4627', SpaceID = 425 WHERE ID = 4627;
UPDATE Devices SET Title = '4626', SpaceID = 424 WHERE ID = 4626;
UPDATE Devices SET Title = '4626', SpaceID = 425 WHERE ID = 4626;
UPDATE Devices SET Title = '4626', SpaceID = 424 WHERE ID = 4626;
UPDATE Devices SET Title = '4626', SpaceID = 425 WHERE ID = 4626;
UPDATE Devices SET Title = '4626', SpaceID = 424 WHERE ID = 4626;
UPDATE Devices SET Title = '4626', SpaceID = 425 WHERE ID = 4626;
UPDATE Devices SET Title = '4626', SpaceID = 424 WHERE ID = 4626;
UPDATE Devices SET Title = '4627', SpaceID = 424 WHERE ID = 4627;
UPDATE Devices SET Title = '4627', SpaceID = 425 WHERE ID = 4627;
UPDATE Devices SET Title = '4626', SpaceID = 425 WHERE ID = 4626;
UPDATE Devices SET Title = '4626', SpaceID = 424 WHERE ID = 4626;
UPDATE Devices SET Title = '4627', SpaceID = 424 WHERE ID = 4627;
UPDATE Devices SET Title = '4627', SpaceID = 425 WHERE ID = 4627;
UPDATE Devices SET Title = '4626', SpaceID = 425 WHERE ID = 4626;
UPDATE Devices SET Title = '4626', SpaceID = 424 WHERE ID = 4626;
UPDATE Devices SET Title = '4627', SpaceID = 424 WHERE ID = 4627;
UPDATE Devices SET Title = '4627', SpaceID = 425 WHERE ID = 4627;
UPDATE Devices SET Title = '4627', SpaceID = 424 WHERE ID = 4627;
UPDATE Devices SET Title = '4627', SpaceID = 425 WHERE ID = 4627;
UPDATE Devices SET Title = '4626', SpaceID = 425 WHERE ID = 4626;
UPDATE Devices SET Title = '4626', SpaceID = 424 WHERE ID = 4626;
UPDATE Devices SET Title = '4627', SpaceID = 424 WHERE ID = 4627;
UPDATE Devices SET Title = '4627', SpaceID = 425 WHERE ID = 4627;
UPDATE Devices SET Title = '4627', SpaceID = 424 WHERE ID = 4627;
UPDATE Devices SET Title = '4627', SpaceID = 425 WHERE ID = 4627;
UPDATE Devices SET Title = '4626', SpaceID = 425 WHERE ID = 4626;
UPDATE Devices SET Title = '4627', SpaceID = 424 WHERE ID = 4627;
UPDATE Devices SET Title = '4626', SpaceID = 424 WHERE ID = 4626;
UPDATE Devices SET Title = '4627', SpaceID = 425 WHERE ID = 4627;
UPDATE Devices SET Title = '4626', SpaceID = 425 WHERE ID = 4626;
UPDATE Devices SET Title = '4627', SpaceID = 424 WHERE ID = 4627;
UPDATE Devices SET Title = '4626', SpaceID = 424 WHERE ID = 4626;
UPDATE Devices SET Title = '4626', SpaceID = 425 WHERE ID = 4626;
UPDATE Devices SET Title = '4626', SpaceID = 424 WHERE ID = 4626;
UPDATE Devices SET Title = '4626', SpaceID = 425 WHERE ID = 4626;
UPDATE Devices SET Title = '4627', SpaceID = 425 WHERE ID = 4627;
UPDATE Devices SET Title = '4627', SpaceID = 424 WHERE ID = 4627;
UPDATE Devices SET Title = '4626', SpaceID = 424 WHERE ID = 4626;
UPDATE Devices SET Title = '4627', SpaceID = 425 WHERE ID = 4627;
UPDATE Devices SET Title = '4626', SpaceID = 425 WHERE ID = 4626;
UPDATE Devices SET Title = '4627', SpaceID = 424 WHERE ID = 4627;
UPDATE Devices SET Title = '4626', SpaceID = 424 WHERE ID = 4626;
UPDATE Devices SET Title = '4627', SpaceID = 425 WHERE ID = 4627;
UPDATE Devices SET Title = '4626', SpaceID = 425 WHERE ID = 4626;
UPDATE Devices SET Title = '4627', SpaceID = 424 WHERE ID = 4627;
UPDATE Devices SET Title = '4626', SpaceID = 424 WHERE ID = 4626;
UPDATE Devices SET Title = '4626', SpaceID = 425 WHERE ID = 4626;
UPDATE Devices SET Title = '4626', SpaceID = 424 WHERE ID = 4626;
UPDATE Devices SET Title = '4626', SpaceID = 425 WHERE ID = 4626;
UPDATE Devices SET Title = '4627', SpaceID = 425 WHERE ID = 4627;
INSERT INTO Devices (ID, Title, Description, SpaceID, CategoryID, RegisteredOn, ModelID) VALUES (4587, 'Mul 4587', ' ', 425, 2, '2022-10-22 12:31:28', '47');
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55220, 'Switch 1', 4587, 1, 0, 0, 0, 0);
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55221, 'Switch 2', 4587, 2, 0, 0, 0, 0);
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55222, 'Switch 3', 4587, 3, 0, 0, 0, 0);
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55223, 'Switch 4', 4587, 4, 0, 0, 0, 0);
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55224, 'Switch 5', 4587, 5, 0, 0, 0, 0);
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55225, 'Dimmer 1', 4587, 6, 0, 0, 0, 0);
UPDATE Resources SET Title = 'Switch H3', ApplianceType = 1, ApplianceWatt = 10 WHERE ID = 55222;
UPDATE Devices SET Title = 'Mul 4587', SpaceID = 424 WHERE ID = 4587;
INSERT INTO Devices (ID, Title, Description, SpaceID, CategoryID, RegisteredOn, ModelID) VALUES (4588, 'M88', ' ', 425, 2, '2022-10-22 12:33:49', '47');
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55226, 'Switch 1', 4588, 1, 0, 0, 0, 0);
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55227, 'Switch 2', 4588, 2, 0, 0, 0, 0);
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55228, 'Switch 3', 4588, 3, 0, 0, 0, 0);
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55229, 'Switch 4', 4588, 4, 0, 0, 0, 0);
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55230, 'Switch 5', 4588, 5, 0, 0, 0, 0);
INSERT INTO Resources (ID, Title, DeviceID, AccessoryID, ApplianceType, CurrentStatus, IsFavorite, ApplianceWatt) VALUES (55231, 'Dimmer 1', 4588, 6, 0, 0, 0, 0);
UPDATE Devices SET Title = 'Mul 4587', SpaceID = 425 WHERE ID = 4587;
UPDATE Devices SET Title = 'Mul 4587', SpaceID = 424 WHERE ID = 4587;
UPDATE Devices SET Title = 'M88', SpaceID = 424 WHERE ID = 4588;
UPDATE Devices SET Title = '4626', SpaceID = 424 WHERE ID = 4626;
UPDATE Resources SET IsFavorite = 1 WHERE ID = 55398;
UPDATE Devices SET Title = '4627', SpaceID = 424 WHERE ID = 4627;
UPDATE Devices SET Title = 'Mul 4587', SpaceID = 425 WHERE ID = 4587;
UPDATE Devices SET Title = '4626', SpaceID = 425 WHERE ID = 4626;
UPDATE Devices SET Title = 'M88', SpaceID = 425 WHERE ID = 4588;
UPDATE Devices SET Title = '4627', SpaceID = 425 WHERE ID = 4627;
DELETE FROM ThemeSettings WHERE ResourceID IN (SELECT ID FROM Resources WHERE DeviceID = 4588);
DELETE FROM Timers WHERE ResourceID IN (SELECT ID FROM Resources WHERE DeviceID = 4588);
DELETE FROM Resources WHERE DeviceID  = 4588;
DELETE FROM Devices WHERE ID = 4588;
DELETE FROM ThemeSettings WHERE ResourceID IN (SELECT ID FROM Resources WHERE DeviceID = 4587);
DELETE FROM Timers WHERE ResourceID IN (SELECT ID FROM Resources WHERE DeviceID = 4587);
DELETE FROM Resources WHERE DeviceID  = 4587;
DELETE FROM Devices WHERE ID = 4587;
