commit 5be2ecd2a134aaf3099f19680f37b635da5a9bf0 Author: Ladebeze66 Date: Sun Apr 27 19:45:45 2025 +0200 first commit diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..8ed43a8 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "commentTranslate.targetLanguage": "fr" +} \ No newline at end of file diff --git a/devices.json b/devices.json new file mode 100644 index 0000000..c939aea --- /dev/null +++ b/devices.json @@ -0,0 +1,4208 @@ +[ + { + "name": "Solar Intelligent PTZ Camera", + "id": "bfbdfe098b6b97536c3vpn", + "key": "6L^C6sA}sOJi;y$C", + "mac": "d6:ec:97:e3:5e:06", + "uuid": "aoni16c0d6ec97e35e06", + "category": "sp", + "product_name": "Solar Intelligent PTZ Camera", + "product_id": "pg7xibyidyvt5pia", + "biz_type": 0, + "model": "", + "sub": false, + "icon": "https://images.tuyaeu.com/smart/icon/ay1552976333775cUOyq/2ceb02325d96e4a34dfe4c5236e57116.png", + "mapping": { + "103": { + "code": "basic_flip", + "type": "Boolean", + "values": {} + }, + "104": { + "code": "basic_osd", + "type": "Boolean", + "values": {} + }, + "106": { + "code": "motion_sensitivity", + "type": "Enum", + "values": { + "range": [ + "0", + "1", + "2" + ] + } + }, + "107": { + "code": "basic_wdr", + "type": "Boolean", + "values": {} + }, + "108": { + "code": "basic_nightvision", + "type": "Enum", + "values": { + "range": [ + "0", + "1", + "2" + ] + } + }, + "109": { + "code": "sd_storge", + "type": "String", + "values": "{\"maxlen\":255}" + }, + "110": { + "code": "sd_status", + "type": "Integer", + "values": { + "min": 1, + "max": 5, + "scale": 0, + "step": 1 + } + }, + "111": { + "code": "sd_format", + "type": "Boolean", + "values": {} + }, + "113": { + "code": "motion_record", + "type": "Boolean", + "values": {} + }, + "115": { + "code": "movement_detect_pic", + "type": "Raw", + "values": {} + }, + "116": { + "code": "ptz_stop", + "type": "Boolean", + "values": {} + }, + "117": { + "code": "sd_format_state", + "type": "Integer", + "values": { + "min": -20000, + "max": 200000, + "scale": 0, + "step": 1 + } + }, + "119": { + "code": "ptz_control", + "type": "Enum", + "values": { + "range": [ + "0", + "1", + "2", + "3", + "4", + "5", + "6", + "7" + ] + } + }, + "126": { + "code": "battery_report_cap", + "type": "Integer", + "values": { + "min": 0, + "max": 15, + "scale": 0, + "step": 1 + } + }, + "132": { + "code": "ptz_calibration", + "type": "Boolean", + "values": {} + }, + "134": { + "code": "motion_switch", + "type": "Boolean", + "values": {} + }, + "136": { + "code": "doorbell_active", + "type": "String", + "values": "{\"maxlen\":255}" + }, + "145": { + "code": "wireless_electricity", + "type": "Integer", + "values": { + "unit": "%", + "min": 0, + "max": 100, + "scale": 0, + "step": 1 + } + }, + "146": { + "code": "wireless_powermode", + "type": "Enum", + "values": { + "range": [ + "0", + "1" + ] + } + }, + "147": { + "code": "wireless_lowpower", + "type": "Integer", + "values": { + "min": 10, + "max": 50, + "scale": 0, + "step": 1 + } + }, + "149": { + "code": "wireless_awake", + "type": "Boolean", + "values": {} + }, + "150": { + "code": "record_switch", + "type": "Boolean", + "values": {} + }, + "151": { + "code": "record_mode", + "type": "Enum", + "values": { + "range": [ + "1", + "2" + ] + } + }, + "152": { + "code": "pir_switch", + "type": "Enum", + "values": { + "range": [ + "0", + "1", + "2", + "3", + "4" + ] + } + }, + "154": { + "code": "doorbell_pic", + "type": "Raw", + "values": {} + }, + "160": { + "code": "basic_device_volume", + "type": "Integer", + "values": { + "unit": "", + "min": 1, + "max": 10, + "scale": 0, + "step": 1 + } + }, + "161": { + "code": "motion_tracking", + "type": "Boolean", + "values": {} + }, + "162": { + "code": "device_restart", + "type": "Boolean", + "values": {} + }, + "170": { + "code": "humanoid_filter", + "type": "Boolean", + "values": {} + }, + "174": { + "code": "cruise_switch", + "type": "Boolean", + "values": {} + }, + "175": { + "code": "cruise_mode", + "type": "Enum", + "values": { + "range": [ + "0", + "1" + ] + } + }, + "185": { + "code": "alarm_message", + "type": "String", + "values": "{}" + }, + "189": { + "code": "ipc_work_mode", + "type": "Enum", + "values": { + "range": [ + "0", + "1" + ] + } + }, + "212": { + "code": "initiative_message", + "type": "Raw", + "values": {} + } + }, + "ip": "", + "version": "" + }, + { + "name": "d\u00e9tecteur chambre d\u00e9lia", + "id": "bf9684f9ed52e74d0a9efm", + "key": "n@y:4!#PatodN8cK", + "mac": "b8:06:0d:03:1f:66", + "uuid": "019763a208b013f0", + "category": "pir", + "product_name": "Motion Sensor", + "product_id": "rjzon9kyxpoeksj3", + "biz_type": 0, + "model": "", + "sub": false, + "icon": "https://images.tuyaeu.com/smart/icon/ay1525749833414yotNt/977689dc3cf45a12a3b33f1d4cb9ff36.png", + "mapping": { + "1": { + "code": "pir", + "type": "Enum", + "values": { + "range": [ + "pir", + "none" + ] + } + }, + "3": { + "code": "battery_state", + "type": "Enum", + "values": { + "range": [ + "low", + "middle", + "high" + ] + } + } + }, + "ip": "", + "version": "" + }, + { + "name": "D\u00e9tecteur cuisine", + "id": "bf7407c4b40fdf460bwa6a", + "key": "vziN+(KEthkR1)Dh", + "mac": "b8:06:0d:02:eb:4f", + "uuid": "9bd2334f02c94371", + "category": "pir", + "product_name": "Motion Sensor", + "product_id": "rjzon9kyxpoeksj3", + "biz_type": 0, + "model": "", + "sub": false, + "icon": "https://images.tuyaeu.com/smart/icon/ay1525749833414yotNt/977689dc3cf45a12a3b33f1d4cb9ff36.png", + "mapping": { + "1": { + "code": "pir", + "type": "Enum", + "values": { + "range": [ + "pir", + "none" + ] + } + }, + "3": { + "code": "battery_state", + "type": "Enum", + "values": { + "range": [ + "low", + "middle", + "high" + ] + } + } + }, + "ip": "", + "version": "" + }, + { + "name": "Detecteur fum\u00e9e chambre", + "id": "bf8fdf6eb4c85d4deci2c3", + "key": "j$RUk3B2b;cg_/>l", + "mac": "b8:06:0d:6f:4a:22", + "uuid": "3953ead345c08d00", + "sn": "10014068401264", + "category": "ywbj", + "product_name": "Smoke detector", + "product_id": "jypukhecbhaw1c47", + "biz_type": 0, + "model": "YG400A-CBU", + "sub": false, + "icon": "https://images.tuyaeu.com/smart/icon/ay1537847617560vAgbw/25f8dac62666b48bcf179530abb05422.jpg", + "mapping": { + "1": { + "code": "smoke_sensor_status", + "type": "Enum", + "values": { + "range": [ + "alarm", + "normal" + ] + } + }, + "4": { + "code": "temper_alarm", + "type": "Boolean", + "values": {} + }, + "15": { + "code": "battery_percentage", + "type": "Integer", + "values": { + "unit": "%", + "min": 0, + "max": 100, + "scale": 0, + "step": 1 + } + } + }, + "ip": "", + "version": "" + }, + { + "name": "light 2", + "id": "bf5516c52504a7a8dcof7r", + "key": "|iyOE'];IEiaQ7}l", + "mac": "d8:d6:68:88:56:9d", + "uuid": "ea51f80ebfc154f7", + "sn": "10013438500303", + "category": "dj", + "product_name": "", + "product_id": "1uq6temf0dfdxshu", + "biz_type": 0, + "model": "SYB09LPH", + "sub": false, + "icon": "https://images.tuyaeu.com/smart/icon/ay1465021689173TLGxd/450969da3811ab0956e9fa94dc397504.jpg", + "mapping": { + "20": { + "code": "switch_led", + "type": "Boolean", + "values": {} + }, + "21": { + "code": "work_mode", + "type": "Enum", + "values": { + "range": [ + "white", + "colour", + "scene", + "music" + ] + } + }, + "22": { + "code": "bright_value_v2", + "type": "Integer", + "values": { + "min": 10, + "max": 1000, + "scale": 0, + "step": 1 + } + }, + "23": { + "code": "temp_value_v2", + "type": "Integer", + "values": { + "min": 0, + "max": 1000, + "scale": 0, + "step": 1 + } + }, + "24": { + "code": "colour_data_v2", + "type": "Json", + "raw_values": "{\"h\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1},\"v\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}}", + "values": { + "h": { + "min": 0, + "scale": 0, + "unit": "", + "max": 360, + "step": 1 + }, + "s": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + }, + "v": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + } + } + }, + "25": { + "code": "scene_data_v2", + "type": "Json", + "raw_values": "{\"scene_num\":{\"min\":1,\"scale\":0,\"max\":8,\"step\":1},\"scene_units\": {\"unit_change_mode\":{\"range\":[\"static\",\"jump\",\"gradient\"]},\"unit_switch_duration\":{\"min\":0,\"scale\":0,\"max\":100,\"step\":1},\"unit_gradient_duration\":{\"min\":0,\"scale\":0,\"max\":100,\"step\":1},\"bright\":{\"min\":0,\"scale\":0,\"max\":1000,\"step\":1},\"temperature\":{\"min\":0,\"scale\":0,\"max\":1000,\"step\":1},\"h\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1},\"v\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}}}", + "values": { + "scene_num": { + "min": 1, + "scale": 0, + "max": 8, + "step": 1 + }, + "scene_units": { + "unit_change_mode": { + "range": [ + "static", + "jump", + "gradient" + ] + }, + "unit_switch_duration": { + "min": 0, + "scale": 0, + "max": 100, + "step": 1 + }, + "unit_gradient_duration": { + "min": 0, + "scale": 0, + "max": 100, + "step": 1 + }, + "bright": { + "min": 0, + "scale": 0, + "max": 1000, + "step": 1 + }, + "temperature": { + "min": 0, + "scale": 0, + "max": 1000, + "step": 1 + }, + "h": { + "min": 0, + "scale": 0, + "unit": "", + "max": 360, + "step": 1 + }, + "s": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + }, + "v": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + } + } + } + }, + "26": { + "code": "countdown_1", + "type": "Integer", + "values": { + "unit": "s", + "min": 0, + "max": 86400, + "scale": 0, + "step": 1 + } + }, + "27": { + "code": "music_data", + "type": "Json", + "raw_values": "{\"change_mode\":{\"range\":[\"direct\",\"gradient\"]}, \"bright\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}, \"temperature\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}, \"h\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1},\"v\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1}}", + "values": { + "change_mode": { + "range": [ + "direct", + "gradient" + ] + }, + "bright": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + }, + "temperature": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + }, + "h": { + "min": 0, + "scale": 0, + "unit": "", + "max": 360, + "step": 1 + }, + "s": { + "min": 0, + "scale": 0, + "unit": "", + "max": 255, + "step": 1 + }, + "v": { + "min": 0, + "scale": 0, + "unit": "", + "max": 255, + "step": 1 + } + } + }, + "28": { + "code": "control_data", + "type": "Json", + "raw_values": "{\"change_mode\":{\"range\":[\"direct\",\"gradient\"]}, \"bright\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}, \"temperature\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}, \"h\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1},\"v\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1}}", + "values": { + "change_mode": { + "range": [ + "direct", + "gradient" + ] + }, + "bright": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + }, + "temperature": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + }, + "h": { + "min": 0, + "scale": 0, + "unit": "", + "max": 360, + "step": 1 + }, + "s": { + "min": 0, + "scale": 0, + "unit": "", + "max": 255, + "step": 1 + }, + "v": { + "min": 0, + "scale": 0, + "unit": "", + "max": 255, + "step": 1 + } + } + }, + "30": { + "code": "rhythm_mode", + "type": "Raw", + "values": { + "maxlen": "255" + } + }, + "31": { + "code": "sleep_mode", + "type": "Raw", + "values": { + "maxlen": "255" + } + }, + "32": { + "code": "wakeup_mode", + "type": "Raw", + "values": { + "maxlen": "255" + } + }, + "33": { + "code": "power_memory", + "type": "Raw", + "values": {} + }, + "209": { + "code": "cycle_timing", + "type": "Raw", + "values": {} + }, + "210": { + "code": "random_timing", + "type": "Raw", + "values": {} + } + }, + "ip": "192.168.1.54", + "version": "3.5" + }, + { + "name": "Light 1", + "id": "bfdc2f8e4effa0d826gnxg", + "key": "a_8Bhm|P1L;{wCHL", + "mac": "d8:d6:68:88:60:28", + "uuid": "ac759c73d50d90cd", + "sn": "10013438500194", + "category": "dj", + "product_name": "", + "product_id": "1uq6temf0dfdxshu", + "biz_type": 0, + "model": "SYB09LPH", + "sub": false, + "icon": "https://images.tuyaeu.com/smart/icon/ay1465021689173TLGxd/450969da3811ab0956e9fa94dc397504.jpg", + "mapping": { + "20": { + "code": "switch_led", + "type": "Boolean", + "values": {} + }, + "21": { + "code": "work_mode", + "type": "Enum", + "values": { + "range": [ + "white", + "colour", + "scene", + "music" + ] + } + }, + "22": { + "code": "bright_value_v2", + "type": "Integer", + "values": { + "min": 10, + "max": 1000, + "scale": 0, + "step": 1 + } + }, + "23": { + "code": "temp_value_v2", + "type": "Integer", + "values": { + "min": 0, + "max": 1000, + "scale": 0, + "step": 1 + } + }, + "24": { + "code": "colour_data_v2", + "type": "Json", + "raw_values": "{\"h\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1},\"v\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}}", + "values": { + "h": { + "min": 0, + "scale": 0, + "unit": "", + "max": 360, + "step": 1 + }, + "s": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + }, + "v": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + } + } + }, + "25": { + "code": "scene_data_v2", + "type": "Json", + "raw_values": "{\"scene_num\":{\"min\":1,\"scale\":0,\"max\":8,\"step\":1},\"scene_units\": {\"unit_change_mode\":{\"range\":[\"static\",\"jump\",\"gradient\"]},\"unit_switch_duration\":{\"min\":0,\"scale\":0,\"max\":100,\"step\":1},\"unit_gradient_duration\":{\"min\":0,\"scale\":0,\"max\":100,\"step\":1},\"bright\":{\"min\":0,\"scale\":0,\"max\":1000,\"step\":1},\"temperature\":{\"min\":0,\"scale\":0,\"max\":1000,\"step\":1},\"h\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1},\"v\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}}}", + "values": { + "scene_num": { + "min": 1, + "scale": 0, + "max": 8, + "step": 1 + }, + "scene_units": { + "unit_change_mode": { + "range": [ + "static", + "jump", + "gradient" + ] + }, + "unit_switch_duration": { + "min": 0, + "scale": 0, + "max": 100, + "step": 1 + }, + "unit_gradient_duration": { + "min": 0, + "scale": 0, + "max": 100, + "step": 1 + }, + "bright": { + "min": 0, + "scale": 0, + "max": 1000, + "step": 1 + }, + "temperature": { + "min": 0, + "scale": 0, + "max": 1000, + "step": 1 + }, + "h": { + "min": 0, + "scale": 0, + "unit": "", + "max": 360, + "step": 1 + }, + "s": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + }, + "v": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + } + } + } + }, + "26": { + "code": "countdown_1", + "type": "Integer", + "values": { + "unit": "s", + "min": 0, + "max": 86400, + "scale": 0, + "step": 1 + } + }, + "27": { + "code": "music_data", + "type": "Json", + "raw_values": "{\"change_mode\":{\"range\":[\"direct\",\"gradient\"]}, \"bright\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}, \"temperature\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}, \"h\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1},\"v\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1}}", + "values": { + "change_mode": { + "range": [ + "direct", + "gradient" + ] + }, + "bright": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + }, + "temperature": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + }, + "h": { + "min": 0, + "scale": 0, + "unit": "", + "max": 360, + "step": 1 + }, + "s": { + "min": 0, + "scale": 0, + "unit": "", + "max": 255, + "step": 1 + }, + "v": { + "min": 0, + "scale": 0, + "unit": "", + "max": 255, + "step": 1 + } + } + }, + "28": { + "code": "control_data", + "type": "Json", + "raw_values": "{\"change_mode\":{\"range\":[\"direct\",\"gradient\"]}, \"bright\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}, \"temperature\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}, \"h\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1},\"v\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1}}", + "values": { + "change_mode": { + "range": [ + "direct", + "gradient" + ] + }, + "bright": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + }, + "temperature": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + }, + "h": { + "min": 0, + "scale": 0, + "unit": "", + "max": 360, + "step": 1 + }, + "s": { + "min": 0, + "scale": 0, + "unit": "", + "max": 255, + "step": 1 + }, + "v": { + "min": 0, + "scale": 0, + "unit": "", + "max": 255, + "step": 1 + } + } + }, + "30": { + "code": "rhythm_mode", + "type": "Raw", + "values": { + "maxlen": "255" + } + }, + "31": { + "code": "sleep_mode", + "type": "Raw", + "values": { + "maxlen": "255" + } + }, + "32": { + "code": "wakeup_mode", + "type": "Raw", + "values": { + "maxlen": "255" + } + }, + "33": { + "code": "power_memory", + "type": "Raw", + "values": {} + }, + "209": { + "code": "cycle_timing", + "type": "Raw", + "values": {} + }, + "210": { + "code": "random_timing", + "type": "Raw", + "values": {} + } + }, + "ip": "192.168.1.138", + "version": "3.5" + }, + { + "name": "sensor chambre", + "id": "bf4bad4f995ba17c0fghjk", + "key": "F9s>V_Y1QV||*UNf", + "mac": "d8:d6:68:9e:aa:63", + "uuid": "2f40f87ec53f657c", + "sn": "10013491100F37", + "category": "mcs", + "product_name": "Contact Sensor", + "product_id": "g2uishoy2nasxgz0", + "biz_type": 0, + "model": "Door Sensor", + "sub": false, + "icon": "https://images.tuyaeu.com/smart/icon/ay1574490117625MIxZY/fa22e30b32b420105d0d6090fdd93c39.png", + "mapping": { + "1": { + "code": "doorcontact_state", + "type": "Boolean", + "values": {} + }, + "2": { + "code": "battery_percentage", + "type": "Integer", + "values": { + "unit": "%", + "min": 0, + "max": 100, + "scale": 0, + "step": 1 + } + } + }, + "ip": "", + "version": "" + }, + { + "name": "prise caf\u00e9", + "id": "bf3254180de3bdd7bfnbei", + "key": "5S2Z#]@_d:0F{bV", + "mac": "4c:a9:19:68:7f:bb", + "uuid": "e4a5299c2c6a46fe", + "category": "kg", + "product_name": "WB02", + "product_id": "8a2rwbhxplktam1x", + "biz_type": 0, + "model": "WB02", + "sub": false, + "icon": "https://images.tuyaeu.com/smart/icon/ay15522876175557bVit/86148ca43769d6aa238413e8f57b685a.png", + "mapping": { + "1": { + "code": "switch_1", + "type": "Boolean", + "values": {} + }, + "2": { + "code": "switch_2", + "type": "Boolean", + "values": {} + }, + "7": { + "code": "countdown_1", + "type": "Integer", + "values": { + "unit": "s", + "min": 0, + "max": 86400, + "scale": 0, + "step": 1 + } + }, + "8": { + "code": "countdown_2", + "type": "Integer", + "values": { + "unit": "s", + "min": 0, + "max": 86400, + "scale": 0, + "step": 1 + } + }, + "14": { + "code": "relay_status", + "type": "Enum", + "values": { + "range": [ + "power_off", + "power_on", + "last" + ] + } + }, + "16": { + "code": "switch_backlight", + "type": "Boolean", + "values": {} + }, + "17": { + "code": "cycle_time", + "type": "String", + "values": "{}" + }, + "18": { + "code": "random_time", + "type": "String", + "values": "{}" + }, + "19": { + "code": "switch_inching", + "type": "String", + "values": "{}" + } + }, + "ip": "192.168.1.28", + "version": "3.4" + }, + { + "name": "bureau dino", + "id": "820180048cce4e2aecc7", + "key": "_rgNtA^X&Vp)A|^l", + "mac": "8c:ce:4e:2a:ec:c7", + "uuid": "820180048cce4e2aecc7", + "category": "pc", + "product_name": "Smart Power Strip", + "product_id": "tsbguim4trl6fa7g", + "biz_type": 0, + "model": "Po01-T-AR\uff08P1\uff09", + "sub": false, + "icon": "https://images.tuyaeu.com/smart/icon/ay1517974017716dABhC/7f72f014bbd715b7af14e1922d640de7.png", + "mapping": { + "1": { + "code": "switch_1", + "type": "Boolean", + "values": {} + }, + "2": { + "code": "switch_2", + "type": "Boolean", + "values": {} + }, + "3": { + "code": "switch_3", + "type": "Boolean", + "values": {} + }, + "7": { + "code": "switch_usb1", + "type": "Boolean", + "values": {} + }, + "9": { + "code": "countdown_1", + "type": "Integer", + "values": { + "unit": "s", + "min": 0, + "max": 86400, + "scale": 0, + "step": 1 + } + }, + "10": { + "code": "countdown_2", + "type": "Integer", + "values": { + "unit": "s", + "min": 0, + "max": 86400, + "scale": 0, + "step": 1 + } + }, + "11": { + "code": "countdown_3", + "type": "Integer", + "values": { + "unit": "s", + "min": 0, + "max": 86400, + "scale": 0, + "step": 1 + } + }, + "15": { + "code": "countdown_usb1", + "type": "Integer", + "values": { + "unit": "s", + "min": 0, + "max": 86400, + "scale": 0, + "step": 1 + } + }, + "17": { + "code": "add_ele", + "type": "Integer", + "values": { + "unit": "", + "min": 0, + "max": 50000, + "scale": 3, + "step": 100 + } + }, + "18": { + "code": "cur_current", + "type": "Integer", + "values": { + "unit": "mA", + "min": 0, + "max": 30000, + "scale": 0, + "step": 1 + } + }, + "19": { + "code": "cur_power", + "type": "Integer", + "values": { + "unit": "W", + "min": 0, + "max": 50000, + "scale": 1, + "step": 1 + } + }, + "20": { + "code": "cur_voltage", + "type": "Integer", + "values": { + "unit": "V", + "min": 0, + "max": 5000, + "scale": 1, + "step": 1 + } + } + }, + "ip": "192.168.1.160", + "version": "3.3" + }, + { + "name": "PC", + "id": "bfe57aa0e61a9b529bzrff", + "key": "|fI8f~QH~5>>m0x?", + "mac": "b8:06:0d:3e:79:77", + "uuid": "e99882b484024f72", + "sn": "CDDD-00800223", + "category": "cz", + "product_name": "PC", + "product_id": "rtbhfbuii82scjrp", + "biz_type": 0, + "model": "JH-PcPro+", + "sub": false, + "icon": "https://images.tuyaeu.com/smart/icon/ay1552295613286EPqcq/28ed5ba6da3ebeaccc8b38134a41259a.png", + "mapping": { + "1": { + "code": "switch_1", + "type": "Boolean", + "values": {} + }, + "7": { + "code": "switch_usb1", + "type": "Boolean", + "values": {} + }, + "8": { + "code": "switch_usb2", + "type": "Boolean", + "values": {} + }, + "38": { + "code": "relay_status", + "type": "Enum", + "values": { + "range": [ + "power_off", + "power_on" + ] + } + }, + "40": { + "code": "child_lock", + "type": "Boolean", + "values": {} + } + }, + "ip": "192.168.1.128", + "version": "3.4" + }, + { + "name": "volet jean luc", + "id": "bf0e197f469e9f2670fb27", + "key": "j$doVJIPumHd2PUf", + "mac": "b8:06:0d:69:a8:8b", + "uuid": "7b42b4575e8aa241", + "sn": "10014052300BE8", + "category": "clkg", + "product_name": "Curtain switch", + "product_id": "4pqpkp1rskkjtxay", + "biz_type": 0, + "model": "qcsc400wv3", + "sub": false, + "icon": "https://images.tuyaeu.com/smart/icon/bay1611024616021eetm/09b246c4d0b2becae91a09c7a47508b2.png", + "mapping": { + "1": { + "code": "control", + "type": "Enum", + "values": { + "range": [ + "open", + "stop", + "close" + ] + } + }, + "8": { + "code": "control_back_mode", + "type": "Enum", + "values": { + "range": [ + "forward", + "back" + ] + } + }, + "10": { + "code": "tr_timecon", + "type": "Integer", + "values": { + "unit": "s", + "min": 1, + "max": 120, + "scale": 0, + "step": 1 + } + } + }, + "ip": "192.168.1.20", + "version": "3.5" + }, + { + "name": "Sir\u00e8ne intelligente", + "id": "bf4054de281cb6ada8actg", + "key": "HokvwP_PM{r#SIHb", + "mac": "4c:a9:19:01:08:14", + "uuid": "284e0c9f111b8ddc", + "sn": "10014448200354", + "category": "sgbj", + "product_name": "Smart Siren", + "product_id": "d7bwplp3edtnkxxh", + "biz_type": 0, + "model": "H1-SOS", + "sub": false, + "icon": "https://images.tuyaeu.com/smart/icon/ay1537847617560vAgbw/6abc8af6079bf64231455aff9bae44f0.jpg", + "mapping": {}, + "ip": "192.168.1.149", + "version": "3.4" + }, + { + "name": "Cam-Dino", + "id": "bf584a5db6d2208dcf2bol", + "key": "mAF-Jj#O.#0@Lk?[", + "mac": "c5:92:42:1a:13:79", + "uuid": "aoni6b7bc592421a1379", + "category": "sp", + "product_name": "Smart Camera", + "product_id": "biw8urjw2dvss3ur", + "biz_type": 0, + "model": "SQW", + "sub": false, + "icon": "https://images.tuyaeu.com/smart/icon/bay1608959728923ed4V/8e541d49da2047d72b0fb73811efca62.png", + "mapping": { + "101": { + "code": "basic_indicator", + "type": "Boolean", + "values": {} + }, + "103": { + "code": "basic_flip", + "type": "Boolean", + "values": {} + }, + "104": { + "code": "basic_osd", + "type": "Boolean", + "values": {} + }, + "105": { + "code": "basic_private", + "type": "Boolean", + "values": {} + }, + "106": { + "code": "motion_sensitivity", + "type": "Enum", + "values": { + "range": [ + "0", + "1", + "2" + ] + } + }, + "108": { + "code": "basic_nightvision", + "type": "Enum", + "values": { + "range": [ + "0", + "1", + "2" + ] + } + }, + "109": { + "code": "sd_storge", + "type": "String", + "values": "{\"maxlen\":255}" + }, + "110": { + "code": "sd_status", + "type": "Integer", + "values": { + "min": 1, + "max": 5, + "scale": 0, + "step": 1 + } + }, + "111": { + "code": "sd_format", + "type": "Boolean", + "values": {} + }, + "115": { + "code": "movement_detect_pic", + "type": "Raw", + "values": {} + }, + "116": { + "code": "ptz_stop", + "type": "Boolean", + "values": {} + }, + "117": { + "code": "sd_format_state", + "type": "Integer", + "values": { + "min": -20000, + "max": 200000, + "scale": 0, + "step": 1 + } + }, + "119": { + "code": "ptz_control", + "type": "Enum", + "values": { + "range": [ + "0", + "1", + "2", + "3", + "4", + "5", + "6", + "7" + ] + } + }, + "120": { + "code": "ipc_auto_siren", + "type": "Boolean", + "values": {} + }, + "132": { + "code": "ptz_calibration", + "type": "Boolean", + "values": {} + }, + "134": { + "code": "motion_switch", + "type": "Boolean", + "values": {} + }, + "139": { + "code": "decibel_switch", + "type": "Boolean", + "values": {} + }, + "140": { + "code": "decibel_sensitivity", + "type": "Enum", + "values": { + "range": [ + "0", + "1" + ] + } + }, + "141": { + "code": "decibel_upload", + "type": "String", + "values": "{\"maxlen\":255}" + }, + "150": { + "code": "record_switch", + "type": "Boolean", + "values": {} + }, + "151": { + "code": "record_mode", + "type": "Enum", + "values": { + "range": [ + "1", + "2" + ] + } + }, + "159": { + "code": "siren_switch", + "type": "Boolean", + "values": {} + }, + "160": { + "code": "basic_device_volume", + "type": "Integer", + "values": { + "unit": "", + "min": 1, + "max": 10, + "scale": 0, + "step": 1 + } + }, + "161": { + "code": "motion_tracking", + "type": "Boolean", + "values": {} + }, + "162": { + "code": "device_restart", + "type": "Boolean", + "values": {} + }, + "168": { + "code": "motion_area_switch", + "type": "Boolean", + "values": {} + }, + "169": { + "code": "motion_area", + "type": "String", + "values": "{\"maxlen\":255}" + }, + "170": { + "code": "humanoid_filter", + "type": "Boolean", + "values": {} + }, + "174": { + "code": "cruise_switch", + "type": "Boolean", + "values": {} + }, + "175": { + "code": "cruise_mode", + "type": "Enum", + "values": { + "range": [ + "0", + "1" + ] + } + }, + "176": { + "code": "cruise_time_mode", + "type": "Enum", + "values": { + "range": [ + "0", + "1" + ] + } + }, + "177": { + "code": "cruise_time", + "type": "String", + "values": "{}" + }, + "185": { + "code": "alarm_message", + "type": "String", + "values": "{}" + }, + "188": { + "code": "basic_anti_flicker", + "type": "Enum", + "values": { + "range": [ + "0", + "1", + "2" + ] + } + }, + "194": { + "code": "ipc_siren_duration", + "type": "Integer", + "values": { + "unit": "s", + "min": 10, + "max": 600, + "scale": 0, + "step": 10 + } + }, + "195": { + "code": "ipc_siren_volume", + "type": "Integer", + "values": { + "unit": "%", + "min": 0, + "max": 100, + "scale": 0, + "step": 1 + } + }, + "199": { + "code": "ipc_preset_set", + "type": "Enum", + "values": { + "range": [ + "1", + "2", + "3", + "4" + ] + } + }, + "212": { + "code": "initiative_message", + "type": "Raw", + "values": {} + }, + "190": { + "code": "ipc_preset_action", + "type": "Enum", + "values": { + "range": [ + "1", + "2", + "3", + "4", + "5", + "6" + ] + } + } + }, + "ip": "192.168.1.80", + "version": "3.3" + }, + { + "name": "bambulight", + "id": "bfd5eb950aecda95d3mgpq", + "key": "R=_N.r9`clUY!JKA", + "mac": "f8:17:2d:75:a4:f4", + "uuid": "71be6e7cdc78dcde", + "category": "dd", + "product_name": "C\u5355\u8272\u706f\u5e26", + "product_id": "pkm8wzcxbefg6vv6", + "biz_type": 0, + "model": "", + "sub": false, + "icon": "https://images.tuyaeu.com/smart/icon/ay1521618643672lvY0O/49c7fcde813e7e9d6c1539e4facc5500.png", + "mapping": { + "20": { + "code": "switch_led", + "type": "Boolean", + "values": {} + }, + "21": { + "code": "work_mode", + "type": "Enum", + "values": { + "range": [ + "white", + "colour", + "scene", + "music" + ] + } + }, + "22": { + "code": "bright_value", + "type": "Integer", + "values": { + "min": 10, + "max": 1000, + "scale": 0, + "step": 1 + } + }, + "25": { + "code": "scene_data", + "type": "Json", + "raw_values": "{\"scene_num\":{\"min\":1,\"scale\":0,\"max\":8,\"step\":1},\"scene_units\": {\"unit_change_mode\":{\"range\":[\"static\",\"jump\",\"gradient\"]},\"unit_switch_duration\":{\"min\":0,\"scale\":0,\"max\":100,\"step\":1},\"unit_gradient_duration\":{\"min\":0,\"scale\":0,\"max\":100,\"step\":1},\"bright\":{\"min\":0,\"scale\":0,\"max\":1000,\"step\":1},\"temperature\":{\"min\":0,\"scale\":0,\"max\":1000,\"step\":1},\"h\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1},\"v\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}}}", + "values": { + "scene_num": { + "min": 1, + "scale": 0, + "max": 8, + "step": 1 + }, + "scene_units": { + "unit_change_mode": { + "range": [ + "static", + "jump", + "gradient" + ] + }, + "unit_switch_duration": { + "min": 0, + "scale": 0, + "max": 100, + "step": 1 + }, + "unit_gradient_duration": { + "min": 0, + "scale": 0, + "max": 100, + "step": 1 + }, + "bright": { + "min": 0, + "scale": 0, + "max": 1000, + "step": 1 + }, + "temperature": { + "min": 0, + "scale": 0, + "max": 1000, + "step": 1 + }, + "h": { + "min": 0, + "scale": 0, + "unit": "", + "max": 360, + "step": 1 + }, + "s": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + }, + "v": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + } + } + } + }, + "26": { + "code": "countdown", + "type": "Integer", + "values": { + "min": 0, + "max": 86400, + "scale": 0, + "step": 1 + } + }, + "28": { + "code": "control_data", + "type": "Json", + "raw_values": "{\"change_mode\":{\"range\":[\"direct\",\"gradient\"]}, \"bright\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}, \"temperature\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}, \"h\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1},\"v\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1}}", + "values": { + "change_mode": { + "range": [ + "direct", + "gradient" + ] + }, + "bright": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + }, + "temperature": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + }, + "h": { + "min": 0, + "scale": 0, + "unit": "", + "max": 360, + "step": 1 + }, + "s": { + "min": 0, + "scale": 0, + "unit": "", + "max": 255, + "step": 1 + }, + "v": { + "min": 0, + "scale": 0, + "unit": "", + "max": 255, + "step": 1 + } + } + } + }, + "ip": "192.168.1.53", + "version": "3.5" + }, + { + "name": "ringlight", + "id": "bfadb5f27d0fe9a778ixwc", + "key": "dOo5*OR3ixjP?OxO", + "mac": "f8:17:2d:6f:72:55", + "uuid": "3c52e36d800e6c9c", + "category": "dd", + "product_name": "C\u5355\u8272\u706f\u5e26", + "product_id": "pkm8wzcxbefg6vv6", + "biz_type": 0, + "model": "", + "sub": false, + "icon": "https://images.tuyaeu.com/smart/icon/ay1521618643672lvY0O/49c7fcde813e7e9d6c1539e4facc5500.png", + "mapping": { + "20": { + "code": "switch_led", + "type": "Boolean", + "values": {} + }, + "21": { + "code": "work_mode", + "type": "Enum", + "values": { + "range": [ + "white", + "colour", + "scene", + "music" + ] + } + }, + "22": { + "code": "bright_value", + "type": "Integer", + "values": { + "min": 10, + "max": 1000, + "scale": 0, + "step": 1 + } + }, + "25": { + "code": "scene_data", + "type": "Json", + "raw_values": "{\"scene_num\":{\"min\":1,\"scale\":0,\"max\":8,\"step\":1},\"scene_units\": {\"unit_change_mode\":{\"range\":[\"static\",\"jump\",\"gradient\"]},\"unit_switch_duration\":{\"min\":0,\"scale\":0,\"max\":100,\"step\":1},\"unit_gradient_duration\":{\"min\":0,\"scale\":0,\"max\":100,\"step\":1},\"bright\":{\"min\":0,\"scale\":0,\"max\":1000,\"step\":1},\"temperature\":{\"min\":0,\"scale\":0,\"max\":1000,\"step\":1},\"h\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1},\"v\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}}}", + "values": { + "scene_num": { + "min": 1, + "scale": 0, + "max": 8, + "step": 1 + }, + "scene_units": { + "unit_change_mode": { + "range": [ + "static", + "jump", + "gradient" + ] + }, + "unit_switch_duration": { + "min": 0, + "scale": 0, + "max": 100, + "step": 1 + }, + "unit_gradient_duration": { + "min": 0, + "scale": 0, + "max": 100, + "step": 1 + }, + "bright": { + "min": 0, + "scale": 0, + "max": 1000, + "step": 1 + }, + "temperature": { + "min": 0, + "scale": 0, + "max": 1000, + "step": 1 + }, + "h": { + "min": 0, + "scale": 0, + "unit": "", + "max": 360, + "step": 1 + }, + "s": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + }, + "v": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + } + } + } + }, + "26": { + "code": "countdown", + "type": "Integer", + "values": { + "min": 0, + "max": 86400, + "scale": 0, + "step": 1 + } + }, + "28": { + "code": "control_data", + "type": "Json", + "raw_values": "{\"change_mode\":{\"range\":[\"direct\",\"gradient\"]}, \"bright\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}, \"temperature\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}, \"h\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1},\"v\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1}}", + "values": { + "change_mode": { + "range": [ + "direct", + "gradient" + ] + }, + "bright": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + }, + "temperature": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + }, + "h": { + "min": 0, + "scale": 0, + "unit": "", + "max": 360, + "step": 1 + }, + "s": { + "min": 0, + "scale": 0, + "unit": "", + "max": 255, + "step": 1 + }, + "v": { + "min": 0, + "scale": 0, + "unit": "", + "max": 255, + "step": 1 + } + } + } + }, + "ip": "192.168.1.70", + "version": "3.5" + }, + { + "name": "chinalight", + "id": "bff3ca58c60d8b18d4x3dn", + "key": "Nt6*~S4<2x9;?Q+-", + "mac": "f8:17:2d:6f:66:89", + "uuid": "f95b88cfd4065f4d", + "category": "dd", + "product_name": "C\u5355\u8272\u706f\u5e26", + "product_id": "pkm8wzcxbefg6vv6", + "biz_type": 0, + "model": "", + "sub": false, + "icon": "https://images.tuyaeu.com/smart/icon/ay1521618643672lvY0O/49c7fcde813e7e9d6c1539e4facc5500.png", + "mapping": { + "20": { + "code": "switch_led", + "type": "Boolean", + "values": {} + }, + "21": { + "code": "work_mode", + "type": "Enum", + "values": { + "range": [ + "white", + "colour", + "scene", + "music" + ] + } + }, + "22": { + "code": "bright_value", + "type": "Integer", + "values": { + "min": 10, + "max": 1000, + "scale": 0, + "step": 1 + } + }, + "25": { + "code": "scene_data", + "type": "Json", + "raw_values": "{\"scene_num\":{\"min\":1,\"scale\":0,\"max\":8,\"step\":1},\"scene_units\": {\"unit_change_mode\":{\"range\":[\"static\",\"jump\",\"gradient\"]},\"unit_switch_duration\":{\"min\":0,\"scale\":0,\"max\":100,\"step\":1},\"unit_gradient_duration\":{\"min\":0,\"scale\":0,\"max\":100,\"step\":1},\"bright\":{\"min\":0,\"scale\":0,\"max\":1000,\"step\":1},\"temperature\":{\"min\":0,\"scale\":0,\"max\":1000,\"step\":1},\"h\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1},\"v\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}}}", + "values": { + "scene_num": { + "min": 1, + "scale": 0, + "max": 8, + "step": 1 + }, + "scene_units": { + "unit_change_mode": { + "range": [ + "static", + "jump", + "gradient" + ] + }, + "unit_switch_duration": { + "min": 0, + "scale": 0, + "max": 100, + "step": 1 + }, + "unit_gradient_duration": { + "min": 0, + "scale": 0, + "max": 100, + "step": 1 + }, + "bright": { + "min": 0, + "scale": 0, + "max": 1000, + "step": 1 + }, + "temperature": { + "min": 0, + "scale": 0, + "max": 1000, + "step": 1 + }, + "h": { + "min": 0, + "scale": 0, + "unit": "", + "max": 360, + "step": 1 + }, + "s": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + }, + "v": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + } + } + } + }, + "26": { + "code": "countdown", + "type": "Integer", + "values": { + "min": 0, + "max": 86400, + "scale": 0, + "step": 1 + } + }, + "28": { + "code": "control_data", + "type": "Json", + "raw_values": "{\"change_mode\":{\"range\":[\"direct\",\"gradient\"]}, \"bright\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}, \"temperature\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}, \"h\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1},\"v\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1}}", + "values": { + "change_mode": { + "range": [ + "direct", + "gradient" + ] + }, + "bright": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + }, + "temperature": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + }, + "h": { + "min": 0, + "scale": 0, + "unit": "", + "max": 360, + "step": 1 + }, + "s": { + "min": 0, + "scale": 0, + "unit": "", + "max": 255, + "step": 1 + }, + "v": { + "min": 0, + "scale": 0, + "unit": "", + "max": 255, + "step": 1 + } + } + } + }, + "ip": "192.168.1.122", + "version": "3.5" + }, + { + "name": "Light tv", + "id": "bfca435612874e22ecfqa0", + "key": "Nei5]1k?GzT)c]ZM", + "mac": "c4:82:e1:de:b1:4a", + "uuid": "c07c8571f5eb0d33", + "sn": "10012946200057", + "category": "dd", + "product_name": "TV Sync Backlights", + "product_id": "gaobbrxqiblcng2p", + "biz_type": 0, + "model": "", + "sub": false, + "icon": "https://images.tuyaeu.com/smart/icon/bay1620612456877DitN/1aae025ef332c2e5bd1ad8abd4831443.png", + "mapping": {}, + "ip": "192.168.1.115", + "version": "3.4" + }, + { + "name": "windowled", + "id": "bf10d8832c8447c512jedz", + "key": "e#Z$#dvgmRo}nS8^", + "mac": "f8:17:2d:cd:24:f7", + "uuid": "60c8aec31f22286a", + "category": "dd", + "product_name": "YH-RGB2", + "product_id": "7jb4fq2ddmkpjiwd", + "biz_type": 0, + "model": "", + "sub": false, + "icon": "https://images.tuyaeu.com/smart/solution/142006/b9dd72a8410f8faa_cover.png", + "mapping": { + "20": { + "code": "switch_led", + "type": "Boolean", + "values": {} + }, + "21": { + "code": "work_mode", + "type": "Enum", + "values": { + "range": [ + "white", + "colour", + "scene", + "music" + ] + } + }, + "24": { + "code": "colour_data", + "type": "Json", + "raw_values": "{\"h\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1},\"v\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}}", + "values": { + "h": { + "min": 0, + "scale": 0, + "unit": "", + "max": 360, + "step": 1 + }, + "s": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + }, + "v": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + } + } + }, + "25": { + "code": "scene_data", + "type": "Json", + "raw_values": "{\"scene_num\":{\"min\":1,\"scale\":0,\"max\":8,\"step\":1},\"scene_units\": {\"unit_change_mode\":{\"range\":[\"static\",\"jump\",\"gradient\"]},\"unit_switch_duration\":{\"min\":0,\"scale\":0,\"max\":100,\"step\":1},\"unit_gradient_duration\":{\"min\":0,\"scale\":0,\"max\":100,\"step\":1},\"bright\":{\"min\":0,\"scale\":0,\"max\":1000,\"step\":1},\"temperature\":{\"min\":0,\"scale\":0,\"max\":1000,\"step\":1},\"h\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1},\"v\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}}}", + "values": { + "scene_num": { + "min": 1, + "scale": 0, + "max": 8, + "step": 1 + }, + "scene_units": { + "unit_change_mode": { + "range": [ + "static", + "jump", + "gradient" + ] + }, + "unit_switch_duration": { + "min": 0, + "scale": 0, + "max": 100, + "step": 1 + }, + "unit_gradient_duration": { + "min": 0, + "scale": 0, + "max": 100, + "step": 1 + }, + "bright": { + "min": 0, + "scale": 0, + "max": 1000, + "step": 1 + }, + "temperature": { + "min": 0, + "scale": 0, + "max": 1000, + "step": 1 + }, + "h": { + "min": 0, + "scale": 0, + "unit": "", + "max": 360, + "step": 1 + }, + "s": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + }, + "v": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + } + } + } + }, + "26": { + "code": "countdown", + "type": "Integer", + "values": { + "min": 0, + "max": 86400, + "scale": 0, + "step": 1 + } + }, + "28": { + "code": "control_data", + "type": "Json", + "raw_values": "{\"change_mode\":{\"range\":[\"direct\",\"gradient\"]}, \"bright\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}, \"temperature\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}, \"h\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1},\"v\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1}}", + "values": { + "change_mode": { + "range": [ + "direct", + "gradient" + ] + }, + "bright": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + }, + "temperature": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + }, + "h": { + "min": 0, + "scale": 0, + "unit": "", + "max": 360, + "step": 1 + }, + "s": { + "min": 0, + "scale": 0, + "unit": "", + "max": 255, + "step": 1 + }, + "v": { + "min": 0, + "scale": 0, + "unit": "", + "max": 255, + "step": 1 + } + } + } + }, + "ip": "192.168.1.8", + "version": "3.5" + }, + { + "name": "imprimante 3d", + "id": "bf9043f5954449c435mcec", + "key": "t0o#ih7L!$;+6R(2", + "mac": "b8:06:0d:fb:a8:1b", + "uuid": "781ee18e0fb21b16", + "category": "cz", + "product_name": "Smart Plug +", + "product_id": "ddms3xyc8sfctabe", + "biz_type": 0, + "model": "", + "sub": false, + "icon": "https://images.tuyaeu.com/smart/icon/ay15107356719526e3ps/98e0287ec5398acf336febfd46948dd1.png", + "mapping": { + "1": { + "code": "switch_1", + "type": "Boolean", + "values": {} + }, + "9": { + "code": "countdown_1", + "type": "Integer", + "values": { + "unit": "s", + "min": 0, + "max": 86400, + "scale": 0, + "step": 1 + } + }, + "17": { + "code": "add_ele", + "type": "Integer", + "values": { + "min": 0, + "max": 50000, + "scale": 3, + "step": 100 + } + }, + "18": { + "code": "cur_current", + "type": "Integer", + "values": { + "unit": "mA", + "min": 0, + "max": 30000, + "scale": 0, + "step": 1 + } + }, + "19": { + "code": "cur_power", + "type": "Integer", + "values": { + "unit": "W", + "min": 0, + "max": 80000, + "scale": 1, + "step": 1 + } + }, + "20": { + "code": "cur_voltage", + "type": "Integer", + "values": { + "unit": "V", + "min": 0, + "max": 5000, + "scale": 1, + "step": 1 + } + }, + "38": { + "code": "relay_status", + "type": "Enum", + "values": { + "range": [ + "power_off", + "power_on", + "last" + ] + } + }, + "39": { + "code": "overcharge_switch", + "type": "Boolean", + "values": {} + }, + "41": { + "code": "child_lock", + "type": "Boolean", + "values": {} + }, + "42": { + "code": "cycle_time", + "type": "String", + "values": "{}" + }, + "43": { + "code": "random_time", + "type": "String", + "values": "{}" + }, + "44": { + "code": "switch_inching", + "type": "String", + "values": "{}" + } + }, + "ip": "192.168.1.92", + "version": "3.4" + }, + { + "name": "volet cuisine", + "id": "bf81367b1f5c267af7yyht", + "key": "9l{9^IYi}CT63k.b", + "mac": "d8:d6:68:c0:f1:c5", + "uuid": "89a27ed28f171442", + "sn": "1001359910043E", + "category": "clkg", + "product_name": "Curtain switch", + "product_id": "4pqpkp1rskkjtxay", + "biz_type": 0, + "model": "qcsc400wv3", + "sub": false, + "icon": "https://images.tuyaeu.com/smart/icon/bay1611024616021eetm/09b246c4d0b2becae91a09c7a47508b2.png", + "mapping": { + "1": { + "code": "control", + "type": "Enum", + "values": { + "range": [ + "open", + "stop", + "close" + ] + } + }, + "8": { + "code": "control_back_mode", + "type": "Enum", + "values": { + "range": [ + "forward", + "back" + ] + } + }, + "10": { + "code": "tr_timecon", + "type": "Integer", + "values": { + "unit": "s", + "min": 1, + "max": 120, + "scale": 0, + "step": 1 + } + } + }, + "ip": "192.168.1.118", + "version": "3.5" + }, + { + "name": "Volet dino", + "id": "bff082745aedf9fc1aqy3e", + "key": "VXg'ZP9IOI|:N)r:", + "mac": "38:a5:c9:1e:da:ad", + "uuid": "197acbff0fa71bc7", + "sn": "1001665530030E", + "category": "clkg", + "product_name": "Curtain switch", + "product_id": "4pqpkp1rskkjtxay", + "biz_type": 0, + "model": "qcsc400wv3", + "sub": false, + "icon": "https://images.tuyaeu.com/smart/icon/bay1611024616021eetm/09b246c4d0b2becae91a09c7a47508b2.png", + "mapping": { + "1": { + "code": "control", + "type": "Enum", + "values": { + "range": [ + "open", + "stop", + "close" + ] + } + }, + "8": { + "code": "control_back_mode", + "type": "Enum", + "values": { + "range": [ + "forward", + "back" + ] + } + }, + "10": { + "code": "tr_timecon", + "type": "Integer", + "values": { + "unit": "s", + "min": 1, + "max": 120, + "scale": 0, + "step": 1 + } + } + }, + "ip": "192.168.1.198", + "version": "3.5" + }, + { + "name": "ecran gauche", + "id": "bfc369d2ca89602058xajc", + "key": "+/l==gSiCON6aPp~@", + "mac": "d8:d6:68:87:07:6a", + "uuid": "f8fedb18f483de45", + "category": "cz", + "product_name": "Smart Plug +", + "product_id": "ddms3xyc8sfctabe", + "biz_type": 0, + "model": "", + "sub": false, + "icon": "https://images.tuyaeu.com/smart/icon/ay15107356719526e3ps/98e0287ec5398acf336febfd46948dd1.png", + "mapping": { + "1": { + "code": "switch_1", + "type": "Boolean", + "values": {} + }, + "9": { + "code": "countdown_1", + "type": "Integer", + "values": { + "unit": "s", + "min": 0, + "max": 86400, + "scale": 0, + "step": 1 + } + }, + "17": { + "code": "add_ele", + "type": "Integer", + "values": { + "min": 0, + "max": 50000, + "scale": 3, + "step": 100 + } + }, + "18": { + "code": "cur_current", + "type": "Integer", + "values": { + "unit": "mA", + "min": 0, + "max": 30000, + "scale": 0, + "step": 1 + } + }, + "19": { + "code": "cur_power", + "type": "Integer", + "values": { + "unit": "W", + "min": 0, + "max": 80000, + "scale": 1, + "step": 1 + } + }, + "20": { + "code": "cur_voltage", + "type": "Integer", + "values": { + "unit": "V", + "min": 0, + "max": 5000, + "scale": 1, + "step": 1 + } + }, + "38": { + "code": "relay_status", + "type": "Enum", + "values": { + "range": [ + "power_off", + "power_on", + "last" + ] + } + }, + "39": { + "code": "overcharge_switch", + "type": "Boolean", + "values": {} + }, + "41": { + "code": "child_lock", + "type": "Boolean", + "values": {} + }, + "42": { + "code": "cycle_time", + "type": "String", + "values": "{}" + }, + "43": { + "code": "random_time", + "type": "String", + "values": "{}" + }, + "44": { + "code": "switch_inching", + "type": "String", + "values": "{}" + } + }, + "ip": "192.168.1.99", + "version": "3.4" + }, + { + "name": "SW2", + "id": "bf06f9007abca55618iiwv", + "key": "fkkV`gX-@(}H.0U=", + "mac": "b8:06:0d:28:c1:93", + "uuid": "08bf13f7dd1cfa49", + "sn": "1001386661531A", + "category": "tdq", + "product_name": "T34-Smart Plug+", + "product_id": "m4jtkjc43ltrilru", + "biz_type": 0, + "model": "", + "sub": false, + "icon": "https://images.tuyaeu.com/smart/icon/bay1677130922441Tlce/e20919d47fc7e35c12cfdaa2648baae4.png", + "mapping": { + "1": { + "code": "switch_1", + "type": "Boolean", + "values": {} + }, + "9": { + "code": "countdown_1", + "type": "Integer", + "values": { + "unit": "s", + "min": 0, + "max": 86400, + "scale": 0, + "step": 1 + } + }, + "20": { + "code": "add_ele", + "type": "Integer", + "values": { + "unit": "kW\u00b7h", + "min": 0, + "max": 50000, + "scale": 3, + "step": 100 + } + }, + "21": { + "code": "cur_current", + "type": "Integer", + "values": { + "unit": "mA", + "min": 0, + "max": 30000, + "scale": 0, + "step": 1 + } + }, + "22": { + "code": "cur_power", + "type": "Integer", + "values": { + "unit": "W", + "min": 0, + "max": 50000, + "scale": 1, + "step": 1 + } + }, + "23": { + "code": "cur_voltage", + "type": "Integer", + "values": { + "unit": "V", + "min": 0, + "max": 5000, + "scale": 1, + "step": 1 + } + }, + "24": { + "code": "test_bit", + "type": "Integer", + "values": { + "min": 0, + "max": 5, + "scale": 0, + "step": 1 + } + }, + "29": { + "code": "fault", + "type": "Bitmap", + "values": { + "label": [ + "ov_cr", + "ov_vol", + "ov_pwr", + "ls_cr", + "ls_vol", + "ls_pow" + ] + } + }, + "38": { + "code": "relay_status", + "type": "Enum", + "values": { + "range": [ + "0", + "1", + "2" + ] + } + }, + "42": { + "code": "random_time", + "type": "String", + "values": "{\"maxlen\":255}" + }, + "43": { + "code": "cycle_time", + "type": "String", + "values": "{\"maxlen\":255}" + }, + "44": { + "code": "switch_inching", + "type": "String", + "values": "{\"maxlen\":255}" + } + }, + "ip": "192.168.1.68", + "version": "3.4" + }, + { + "name": "SW2 light", + "id": "bf94bdd65e67c4a7d7mv3l", + "key": "Q|cJm'{Y2;27nuPG", + "mac": "38:2c:e5:52:a3:59", + "uuid": "482605c32295c7f5", + "category": "dd", + "product_name": "C\u5355\u8272\u706f\u5e26", + "product_id": "pkm8wzcxbefg6vv6", + "biz_type": 0, + "model": "", + "sub": false, + "icon": "https://images.tuyaeu.com/smart/icon/ay1521618643672lvY0O/49c7fcde813e7e9d6c1539e4facc5500.png", + "mapping": { + "20": { + "code": "switch_led", + "type": "Boolean", + "values": {} + }, + "21": { + "code": "work_mode", + "type": "Enum", + "values": { + "range": [ + "white", + "colour", + "scene", + "music" + ] + } + }, + "22": { + "code": "bright_value", + "type": "Integer", + "values": { + "min": 10, + "max": 1000, + "scale": 0, + "step": 1 + } + }, + "25": { + "code": "scene_data", + "type": "Json", + "raw_values": "{\"scene_num\":{\"min\":1,\"scale\":0,\"max\":8,\"step\":1},\"scene_units\": {\"unit_change_mode\":{\"range\":[\"static\",\"jump\",\"gradient\"]},\"unit_switch_duration\":{\"min\":0,\"scale\":0,\"max\":100,\"step\":1},\"unit_gradient_duration\":{\"min\":0,\"scale\":0,\"max\":100,\"step\":1},\"bright\":{\"min\":0,\"scale\":0,\"max\":1000,\"step\":1},\"temperature\":{\"min\":0,\"scale\":0,\"max\":1000,\"step\":1},\"h\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1},\"v\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}}}", + "values": { + "scene_num": { + "min": 1, + "scale": 0, + "max": 8, + "step": 1 + }, + "scene_units": { + "unit_change_mode": { + "range": [ + "static", + "jump", + "gradient" + ] + }, + "unit_switch_duration": { + "min": 0, + "scale": 0, + "max": 100, + "step": 1 + }, + "unit_gradient_duration": { + "min": 0, + "scale": 0, + "max": 100, + "step": 1 + }, + "bright": { + "min": 0, + "scale": 0, + "max": 1000, + "step": 1 + }, + "temperature": { + "min": 0, + "scale": 0, + "max": 1000, + "step": 1 + }, + "h": { + "min": 0, + "scale": 0, + "unit": "", + "max": 360, + "step": 1 + }, + "s": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + }, + "v": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + } + } + } + }, + "26": { + "code": "countdown", + "type": "Integer", + "values": { + "min": 0, + "max": 86400, + "scale": 0, + "step": 1 + } + }, + "28": { + "code": "control_data", + "type": "Json", + "raw_values": "{\"change_mode\":{\"range\":[\"direct\",\"gradient\"]}, \"bright\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}, \"temperature\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}, \"h\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1},\"v\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1}}", + "values": { + "change_mode": { + "range": [ + "direct", + "gradient" + ] + }, + "bright": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + }, + "temperature": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + }, + "h": { + "min": 0, + "scale": 0, + "unit": "", + "max": 360, + "step": 1 + }, + "s": { + "min": 0, + "scale": 0, + "unit": "", + "max": 255, + "step": 1 + }, + "v": { + "min": 0, + "scale": 0, + "unit": "", + "max": 255, + "step": 1 + } + } + } + }, + "ip": "", + "version": "" + }, + { + "name": "D\u00e9tecteur bureau jean luc", + "id": "bfabc589c6b76ea7f3ukkb", + "key": "ccm}UFMjiQ;T608<", + "mac": "b8:06:0d:02:e7:77", + "uuid": "b60390c7c591ba60", + "category": "pir", + "product_name": "Motion Sensor", + "product_id": "rjzon9kyxpoeksj3", + "biz_type": 0, + "model": "", + "sub": false, + "icon": "https://images.tuyaeu.com/smart/icon/ay1525749833414yotNt/977689dc3cf45a12a3b33f1d4cb9ff36.png", + "mapping": { + "1": { + "code": "pir", + "type": "Enum", + "values": { + "range": [ + "pir", + "none" + ] + } + }, + "3": { + "code": "battery_state", + "type": "Enum", + "values": { + "range": [ + "low", + "middle", + "high" + ] + } + } + }, + "ip": "", + "version": "" + }, + { + "name": "D\u00e9tecteur salon", + "id": "bf69fec5a1a684d238owvx", + "key": "eZGu63iM^pjT$ngL", + "mac": "b8:06:0d:02:9d:9e", + "uuid": "574dda4ae343b136", + "category": "pir", + "product_name": "Motion Sensor", + "product_id": "rjzon9kyxpoeksj3", + "biz_type": 0, + "model": "", + "sub": false, + "icon": "https://images.tuyaeu.com/smart/icon/ay1525749833414yotNt/977689dc3cf45a12a3b33f1d4cb9ff36.png", + "mapping": { + "1": { + "code": "pir", + "type": "Enum", + "values": { + "range": [ + "pir", + "none" + ] + } + }, + "3": { + "code": "battery_state", + "type": "Enum", + "values": { + "range": [ + "low", + "middle", + "high" + ] + } + } + }, + "ip": "", + "version": "" + }, + { + "name": "Temperature & Humidity Sensor", + "id": "bfada85ab6fee70349uhqc", + "key": "KbrKX|)Oy)eA_t>B", + "mac": "d8:d6:68:61:24:fd", + "uuid": "bdcf0249b328be57", + "sn": "100133461017A0", + "category": "wsdcg", + "product_name": "Temperature & Humidity Sensor", + "product_id": "43ykthb7hebzsuaf", + "biz_type": 0, + "model": "TH08", + "sub": false, + "icon": "https://images.tuyaeu.com/smart/icon/ay1574490117625MIxZY/f36a9d707612825b36fa56c607965fca.png", + "mapping": { + "1": { + "code": "va_temperature", + "type": "Integer", + "values": { + "unit": "\u00b0C", + "min": -200, + "max": 600, + "scale": 1, + "step": 1 + } + }, + "2": { + "code": "va_humidity", + "type": "Integer", + "values": { + "unit": "%", + "min": 0, + "max": 100, + "scale": 0, + "step": 1 + } + }, + "4": { + "code": "battery_percentage", + "type": "Integer", + "values": { + "unit": "%", + "min": 0, + "max": 100, + "scale": 0, + "step": 1 + } + }, + "9": { + "code": "temp_unit_convert", + "type": "Enum", + "values": { + "range": [ + "c", + "f" + ] + } + }, + "10": { + "code": "maxtemp_set", + "type": "Integer", + "values": { + "unit": "\u00b0C", + "min": -200, + "max": 600, + "scale": 1, + "step": 1 + } + }, + "11": { + "code": "minitemp_set", + "type": "Integer", + "values": { + "unit": "\u00b0C", + "min": -200, + "max": 600, + "scale": 1, + "step": 1 + } + }, + "12": { + "code": "maxhum_set", + "type": "Integer", + "values": { + "unit": "%", + "min": 0, + "max": 100, + "scale": 0, + "step": 1 + } + }, + "13": { + "code": "minihum_set", + "type": "Integer", + "values": { + "unit": "%", + "min": 0, + "max": 100, + "scale": 0, + "step": 1 + } + }, + "14": { + "code": "temp_alarm", + "type": "Enum", + "values": { + "range": [ + "loweralarm", + "upperalarm", + "cancel" + ] + } + }, + "15": { + "code": "hum_alarm", + "type": "Enum", + "values": { + "range": [ + "loweralarm", + "upperalarm", + "cancel" + ] + } + }, + "19": { + "code": "temp_sensitivity", + "type": "Integer", + "values": { + "unit": "\u00b0C", + "min": 3, + "max": 20, + "scale": 1, + "step": 1 + } + }, + "20": { + "code": "hum_sensitivity", + "type": "Integer", + "values": { + "unit": "%", + "min": 3, + "max": 20, + "scale": 0, + "step": 1 + } + } + }, + "ip": "", + "version": "" + }, + { + "name": "led chambre", + "id": "bf6c6b8d6dd0d74a1fnv9u", + "key": "|'u(iF:-4Q~5dj6f", + "mac": "b8:06:0d:7a:85:0c", + "uuid": "d05e1caed370504b", + "category": "dd", + "product_name": "Smart Led Strip", + "product_id": "htvilqbp8xfctgke", + "biz_type": 0, + "model": "", + "sub": false, + "icon": "https://images.tuyaeu.com/smart/program_category_icon/dd.png", + "mapping": { + "20": { + "code": "switch_led", + "type": "Boolean", + "values": {} + }, + "21": { + "code": "work_mode", + "type": "Enum", + "values": { + "range": [ + "white", + "colour", + "scene", + "music" + ] + } + }, + "24": { + "code": "colour_data", + "type": "Json", + "raw_values": "{\"h\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1},\"v\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}}", + "values": { + "h": { + "min": 0, + "scale": 0, + "unit": "", + "max": 360, + "step": 1 + }, + "s": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + }, + "v": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + } + } + }, + "25": { + "code": "scene_data", + "type": "Json", + "raw_values": "{\"scene_num\":{\"min\":1,\"scale\":0,\"max\":8,\"step\":1},\"scene_units\": {\"unit_change_mode\":{\"range\":[\"static\",\"jump\",\"gradient\"]},\"unit_switch_duration\":{\"min\":0,\"scale\":0,\"max\":100,\"step\":1},\"unit_gradient_duration\":{\"min\":0,\"scale\":0,\"max\":100,\"step\":1},\"bright\":{\"min\":0,\"scale\":0,\"max\":1000,\"step\":1},\"temperature\":{\"min\":0,\"scale\":0,\"max\":1000,\"step\":1},\"h\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1},\"v\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}}}", + "values": { + "scene_num": { + "min": 1, + "scale": 0, + "max": 8, + "step": 1 + }, + "scene_units": { + "unit_change_mode": { + "range": [ + "static", + "jump", + "gradient" + ] + }, + "unit_switch_duration": { + "min": 0, + "scale": 0, + "max": 100, + "step": 1 + }, + "unit_gradient_duration": { + "min": 0, + "scale": 0, + "max": 100, + "step": 1 + }, + "bright": { + "min": 0, + "scale": 0, + "max": 1000, + "step": 1 + }, + "temperature": { + "min": 0, + "scale": 0, + "max": 1000, + "step": 1 + }, + "h": { + "min": 0, + "scale": 0, + "unit": "", + "max": 360, + "step": 1 + }, + "s": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + }, + "v": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + } + } + } + }, + "26": { + "code": "countdown", + "type": "Integer", + "values": { + "min": 0, + "max": 86400, + "scale": 0, + "step": 1 + } + }, + "27": { + "code": "music_data", + "type": "Json", + "raw_values": "{\"change_mode\":{\"range\":[\"direct\",\"gradient\"]}, \"bright\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}, \"temperature\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}, \"h\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1},\"v\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1}}", + "values": { + "change_mode": { + "range": [ + "direct", + "gradient" + ] + }, + "bright": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + }, + "temperature": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + }, + "h": { + "min": 0, + "scale": 0, + "unit": "", + "max": 360, + "step": 1 + }, + "s": { + "min": 0, + "scale": 0, + "unit": "", + "max": 255, + "step": 1 + }, + "v": { + "min": 0, + "scale": 0, + "unit": "", + "max": 255, + "step": 1 + } + } + }, + "28": { + "code": "control_data", + "type": "Json", + "raw_values": "{\"change_mode\":{\"range\":[\"direct\",\"gradient\"]}, \"bright\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}, \"temperature\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}, \"h\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1},\"v\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1}}", + "values": { + "change_mode": { + "range": [ + "direct", + "gradient" + ] + }, + "bright": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + }, + "temperature": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + }, + "h": { + "min": 0, + "scale": 0, + "unit": "", + "max": 360, + "step": 1 + }, + "s": { + "min": 0, + "scale": 0, + "unit": "", + "max": 255, + "step": 1 + }, + "v": { + "min": 0, + "scale": 0, + "unit": "", + "max": 255, + "step": 1 + } + } + } + }, + "ip": "", + "version": "" + }, + { + "name": "spa", + "id": "bf05a9e59025d05c0ccsew", + "key": "K;J1v3PLhh-7(9{#", + "mac": "18:de:50:fb:52:dd", + "uuid": "fc0501283a938468", + "sn": "YHLD-095002E4", + "category": "tdq", + "product_name": "1-433", + "product_id": "9htyiowaf5rtdhrv", + "biz_type": 0, + "model": "", + "sub": false, + "icon": "https://images.tuyaeu.com/smart/icon/bay1669863773544vjP7/c21e4d0df44fb5e03b78aa6391f67e19.png", + "mapping": { + "1": { + "code": "switch_1", + "type": "Boolean", + "values": {} + }, + "9": { + "code": "countdown_1", + "type": "Integer", + "values": { + "unit": "s", + "min": 0, + "max": 86400, + "scale": 0, + "step": 1 + } + }, + "38": { + "code": "relay_status", + "type": "Enum", + "values": { + "range": [ + "0", + "1", + "2" + ] + } + }, + "42": { + "code": "random_time", + "type": "String", + "values": "{\"maxlen\":255}" + }, + "43": { + "code": "cycle_time", + "type": "String", + "values": "{\"maxlen\":255}" + }, + "44": { + "code": "switch_inching", + "type": "String", + "values": "{\"maxlen\":255}" + }, + "47": { + "code": "switch_type", + "type": "Enum", + "values": { + "range": [ + "flip", + "sync", + "button" + ] + } + }, + "49": { + "code": "remote_add", + "type": "Raw", + "values": {} + }, + "50": { + "code": "remote_list", + "type": "Raw", + "values": {} + } + }, + "ip": "", + "version": "" + }, + { + "name": "Capteur porte garage", + "id": "bfdce72165f5206a4elrrf", + "key": "ZHr<|SN!)s5)Yo[9", + "mac": "b8:06:0d:3b:4e:86", + "uuid": "1ef4672efcd20da1", + "sn": "10013922407530", + "category": "mcs", + "product_name": "Contact Sensor", + "product_id": "g2uishoy2nasxgz0", + "biz_type": 0, + "model": "Door Sensor", + "sub": false, + "icon": "https://images.tuyaeu.com/smart/icon/ay1574490117625MIxZY/fa22e30b32b420105d0d6090fdd93c39.png", + "mapping": { + "1": { + "code": "doorcontact_state", + "type": "Boolean", + "values": {} + }, + "2": { + "code": "battery_percentage", + "type": "Integer", + "values": { + "unit": "%", + "min": 0, + "max": 100, + "scale": 0, + "step": 1 + } + } + }, + "ip": "", + "version": "" + }, + { + "name": "lumi\u00e8re cuisine", + "id": "bffa5d4e1ba85ea64dm09r", + "key": "0{C{XEr_f>+wQq5g", + "mac": "d8:d6:68:a9:31:d6", + "uuid": "56a48840b68b4009", + "sn": "XHCD-1950066C", + "category": "cz", + "product_name": "QIACHIP Smart Switch ", + "product_id": "cs4ooidd4toa2yon", + "biz_type": 0, + "model": "KR2201WB3", + "sub": false, + "icon": "https://images.tuyaeu.com/smart/icon/ay15609465299162YKk0/70f4532fde246db2e3f6cc3173f6c732.png", + "mapping": { + "1": { + "code": "switch_1", + "type": "Boolean", + "values": {} + }, + "9": { + "code": "countdown_1", + "type": "Integer", + "values": { + "unit": "s", + "min": 0, + "max": 86400, + "scale": 0, + "step": 1 + } + }, + "38": { + "code": "relay_status", + "type": "Enum", + "values": { + "range": [ + "power_off", + "power_on", + "last" + ] + } + }, + "41": { + "code": "child_lock", + "type": "Boolean", + "values": {} + }, + "42": { + "code": "cycle_time", + "type": "String", + "values": "{}" + }, + "43": { + "code": "random_time", + "type": "String", + "values": "{}" + }, + "44": { + "code": "switch_inching", + "type": "String", + "values": "{}" + } + }, + "ip": "", + "version": "" + }, + { + "name": "capteur porte garage 2", + "id": "bfbb6b0de6a38d203brz09", + "key": "'<9=TIE^M=wvSD.{", + "mac": "b8:06:0d:3a:f4:f4", + "uuid": "857a104aaa398798", + "sn": "100139224021C0", + "category": "mcs", + "product_name": "Contact Sensor", + "product_id": "g2uishoy2nasxgz0", + "biz_type": 0, + "model": "Door Sensor", + "sub": false, + "icon": "https://images.tuyaeu.com/smart/icon/ay1574490117625MIxZY/fa22e30b32b420105d0d6090fdd93c39.png", + "mapping": { + "1": { + "code": "doorcontact_state", + "type": "Boolean", + "values": {} + }, + "2": { + "code": "battery_percentage", + "type": "Integer", + "values": { + "unit": "%", + "min": 0, + "max": 100, + "scale": 0, + "step": 1 + } + } + }, + "ip": "", + "version": "" + }, + { + "name": "lave vaisselle", + "id": "bfb7dbulpek8mg43", + "key": "rSC|I}UjaYb60eLM", + "mac": "DC:23:50:08:D7:8F", + "uuid": "9adfc604f5b871a9", + "sn": "100130229012DB", + "category": "szjqr", + "product_name": "CUBETOUCH II", + "product_id": "xhf790if", + "biz_type": 0, + "model": "CBTB3002", + "sub": false, + "icon": "https://images.tuyaeu.com/smart/icon/bay1618467175599MrKr/9b0ac1affcafaa8cff9fad2e3ef5abae.png", + "mapping": { + "1": { + "code": "switch", + "type": "Boolean", + "values": {} + }, + "2": { + "code": "mode", + "type": "Enum", + "values": { + "range": [ + "click" + ] + } + }, + "3": { + "code": "click_sustain_time", + "type": "Integer", + "values": { + "unit": "s", + "min": 0, + "max": 10, + "scale": 0, + "step": 1 + } + }, + "5": { + "code": "arm_down_percent", + "type": "Integer", + "values": { + "unit": "%", + "min": 0, + "max": 100, + "scale": 0, + "step": 1 + } + }, + "6": { + "code": "arm_up_percent", + "type": "Integer", + "values": { + "unit": "%", + "min": 0, + "max": 100, + "scale": 0, + "step": 1 + } + }, + "7": { + "code": "charge_status", + "type": "Enum", + "values": { + "range": [ + "none", + "charging", + "charge_done" + ] + } + }, + "8": { + "code": "battery_percentage", + "type": "Integer", + "values": { + "unit": "%", + "min": 0, + "max": 100, + "scale": 0, + "step": 1 + } + } + }, + "ip": "", + "version": "" + } +] \ No newline at end of file diff --git a/scan_wifi.py b/scan_wifi.py new file mode 100644 index 0000000..c821638 --- /dev/null +++ b/scan_wifi.py @@ -0,0 +1,22 @@ +import tinytuya + +# Créer un objet Cloud avec vos identifiants +cloud = tinytuya.Cloud( + apiRegion="eu", # 'eu', 'us', 'cn', selon ton projet + apiKey="fdjdjurkm34yyjp77c7d", + apiSecret="3e71807fb0c6406792bdf4f07f98e577" +) + +# Scanner les appareils +print("🔍 Recherche de vos appareils connectés...") + +devices = cloud.getdevices() + +# Afficher tous les appareils trouvés +for device in devices: + print("="*40) + print(f"Nom : {device['name']}") + print(f"ID : {device['id']}") + print(f"IP : {device.get('ip', 'N/A')}") + print(f"LocalKey : {device.get('local_key', 'N/A')}") + print("="*40) diff --git a/snapshot.json b/snapshot.json new file mode 100644 index 0000000..fafa93b --- /dev/null +++ b/snapshot.json @@ -0,0 +1,746 @@ +{ + "timestamp": 1745608535.9669468, + "devices": [ + { + "id": "bf3254180de3bdd7bfnbei", + "ip": "192.168.1.179", + "uuid": "5ff3703402383ea3", + "active": 2, + "encrypt": true, + "productKey": "uqehhcrmk5depvtl", + "token": true, + "wf_cfg": true, + "sl": 0, + "clientLink": 3, + "name": "prise caf\u00e9", + "key": "5S2Z#]@_d:0F{bV", + "mac": "4c:a9:19:68:7f:bb", + "ability": 0, + "dev_type": "default", + "err": "", + "type": "default", + "dps": { + "dps": { + "1": false, + "2": true, + "7": 0, + "8": 0, + "14": "memory", + "16": true, + "17": "", + "18": "", + "19": "" + } + }, + "origin": "broadcast", + "ver": "3.4" + }, + { + "id": "bfca435612874e22ecfqa0", + "ip": "192.168.1.115", + "active": 2, + "encrypt": true, + "productKey": "gaobbrxqiblcng2p", + "token": true, + "wf_cfg": true, + "name": "Light tv", + "key": "Nei5]1k?GzT)c]ZM", + "mac": "c4:82:e1:de:b1:4a", + "ability": 0, + "dev_type": "default", + "err": "", + "type": "default", + "dps": { + "dps": { + "101": "film_mode", + "102": false, + "103": 1, + "104": 100, + "105": 0, + "108": 64, + "111": "0000ff", + "112": 100, + "113": 5, + "114": 100, + "115": false, + "116": 12, + "117": 7, + "118": 200, + "119": 200, + "120": 0, + "122": "ffffff", + "125": "BRG", + "126": true, + "127": "RD200 _HDMI2.0_240109 V08.08.08.3840*2160P 60Hz36bitYCbCr420.CS 27. 27.296M.HDR.2200.2250. 148. 072.1.1921.1079.0.hdcp22.led 38." + } + }, + "origin": "broadcast", + "ver": "3.4" + }, + { + "id": "bf06f9007abca55618iiwv", + "ip": "192.168.1.68", + "active": 2, + "encrypt": true, + "productKey": "keyjnuy4s3kre7m7", + "token": true, + "wf_cfg": true, + "name": "SW2", + "key": "fkkV`gX-@(}H.0U=", + "mac": "b8:06:0d:28:c1:93", + "ability": 0, + "dev_type": "default", + "err": "", + "type": "default", + "dps": { + "dps": { + "1": false, + "9": 0, + "20": 1, + "21": 0, + "22": 0, + "23": 2333, + "24": 1, + "29": 0, + "38": "memory", + "42": "", + "43": "", + "44": "AAAC" + } + }, + "origin": "broadcast", + "ver": "3.4" + }, + { + "id": "bfc369d2ca89602058xajc", + "ip": "192.168.1.13", + "active": 2, + "encrypt": true, + "productKey": "keyjup78v54myhan", + "token": true, + "wf_cfg": true, + "name": "ecran gauche", + "key": "+/l==gS>m0x?", + "mac": "b8:06:0d:3e:79:77", + "ability": 0, + "dev_type": "default", + "err": "", + "type": "default", + "dps": { + "dps": { + "1": true, + "7": false, + "8": true, + "38": "off", + "40": false, + "101": "0", + "102": "off" + } + }, + "origin": "broadcast", + "ver": "3.4" + }, + { + "id": "bff3ca58c60d8b18d4x3dn", + "ip": "192.168.1.122", + "uuid": "f95b88cfd4065f4d", + "active": 2, + "encrypt": true, + "productKey": "keynremrcjf97twe", + "token": true, + "wf_cfg": true, + "clientLink": 3, + "name": "chinalight", + "key": "Nt6*~S4<2x9;?Q+-", + "mac": "f8:17:2d:6f:66:89", + "ability": 0, + "dev_type": "default", + "err": "", + "type": "default", + "dps": { + "dps": { + "20": false, + "21": "white", + "22": 1000, + "25": "000e0d0000000000000000c803e8", + "26": 0, + "34": false + } + }, + "origin": "broadcast", + "ver": "3.5" + }, + { + "id": "bf81674a39ad0f61f4tzjt", + "ip": "192.168.1.99", + "active": 2, + "encrypt": true, + "productKey": "keyjup78v54myhan", + "token": true, + "wf_cfg": true, + "name": "Bureau", + "key": "~@d`/>iCON6aPp~@", + "mac": "d8:d6:68:87:07:6a", + "ability": 0, + "dev_type": "default", + "err": "", + "type": "default", + "dps": { + "dps": { + "1": true, + "9": 0, + "17": 27, + "18": 417, + "19": 546, + "20": 2294, + "21": 1, + "22": 557, + "23": 26736, + "24": 14371, + "25": 2900, + "26": 0, + "38": "memory", + "39": false, + "41": false, + "42": "", + "43": "", + "44": "" + } + }, + "origin": "broadcast", + "ver": "3.4" + }, + { + "id": "bf584a5db6d2208dcf2bol", + "ip": "192.168.1.80", + "active": 2, + "encrypt": true, + "productKey": "biw8urjw2dvss3ur", + "token": true, + "name": "Cam-Dino", + "key": "mAF-Jj#O.#0@Lk?[", + "mac": "c5:92:42:1a:13:79", + "ability": 0, + "wf_cfg": "", + "dev_type": "default", + "err": "", + "type": "default", + "dps": { + "dps": { + "101": true, + "103": false, + "104": true, + "105": false, + "106": "1", + "108": "0", + "109": "61038592|48714752|12323840", + "110": 1, + "117": 0, + "120": false, + "134": false, + "139": false, + "140": "0", + "150": true, + "151": "2", + "159": false, + "160": 10, + "161": false, + "168": false, + "169": "", + "170": false, + "174": false, + "175": "0", + "176": "0", + "188": "0", + "194": 20, + "195": 50, + "237": false, + "239": false + } + }, + "origin": "broadcast", + "ver": "3.3" + } + ] +} \ No newline at end of file diff --git a/tinytuya.json b/tinytuya.json new file mode 100644 index 0000000..5fbbf0c --- /dev/null +++ b/tinytuya.json @@ -0,0 +1,6 @@ +{ + "apiKey": "fdjdjurkm34yyjp77c7d", + "apiSecret": "3e71807fb0c6406792bdf4f07f98e577", + "apiRegion": "eu", + "apiDeviceID": "scan" +} \ No newline at end of file diff --git a/tuya-control/README.md b/tuya-control/README.md new file mode 100644 index 0000000..07c4429 --- /dev/null +++ b/tuya-control/README.md @@ -0,0 +1,83 @@ +# Tuya Control pour StreamDeck + +Ce projet permet de contrôler vos appareils Tuya (prises, lumières, volets, etc.) via des scripts Python, conçus pour être utilisés avec un StreamDeck. + +## Structure du projet + +``` +tuya-control/ +├── common/ # Fonctions utilitaires communes +│ ├── utils.py # Fonctions partagées +│ └── config.py # Configuration générale +├── devices/ # Scripts spécifiques par type d'appareil +│ ├── lights/ # Contrôle des lumières +│ ├── shutters/ # Contrôle des volets +│ ├── plugs/ # Contrôle des prises +│ ├── cameras/ # Contrôle des caméras +│ └── others/ # Autres types d'appareils +├── scripts/ # Scripts utilitaires +│ ├── scan_devices.py # Scanner les appareils sur le réseau +│ └── status_devices.py # Afficher le statut des appareils +├── devices.json # Base de données des appareils +└── README.md # Ce fichier +``` + +## Configuration du StreamDeck + +Pour utiliser ces scripts avec votre StreamDeck: + +1. Configurez une touche sur votre StreamDeck pour exécuter un script Python +2. Pointez vers le script correspondant à l'appareil que vous souhaitez contrôler + (ex: `tuya-control/devices/lights/light_1_toggle.py`) +3. Définissez une icône appropriée pour l'état ON/OFF + +Chaque script gère automatiquement la détection de l'état actuel et bascule entre allumé/éteint ou ouvert/fermé/arrêté selon le type d'appareil. + +## Exemples d'utilisation + +### Contrôler une prise +```bash +python tuya-control/devices/plugs/prise_cafe_toggle.py +``` + +### Contrôler un volet +```bash +python tuya-control/devices/shutters/volet_salon_toggle.py +``` + +### Contrôler une lumière +```bash +python tuya-control/devices/lights/light_1_toggle.py +``` + +### Scanner les appareils sur le réseau +```bash +python tuya-control/scripts/scan_devices.py +``` + +### Afficher le statut des appareils +```bash +python tuya-control/scripts/status_devices.py +``` + +## Personnalisation + +Pour ajouter ou modifier des appareils, il suffit de copier un script existant et d'adapter: +- L'ID de l'appareil +- Le nom de l'appareil +- Le type de commande (DPS) spécifique à l'appareil + +## Dépendances + +Ce projet nécessite: +- Python 3.6+ +- La bibliothèque tinytuya + +Pour installer les dépendances: +```bash +pip install tinytuya +``` + +## Remarques + +Pour que les scripts fonctionnent, le fichier `devices.json` doit contenir les informations de connexion pour tous vos appareils, incluant les clés locales. \ No newline at end of file diff --git a/tuya-control/common/__pycache__/config.cpython-313.pyc b/tuya-control/common/__pycache__/config.cpython-313.pyc new file mode 100644 index 0000000..619cb79 Binary files /dev/null and b/tuya-control/common/__pycache__/config.cpython-313.pyc differ diff --git a/tuya-control/common/__pycache__/utils.cpython-313.pyc b/tuya-control/common/__pycache__/utils.cpython-313.pyc new file mode 100644 index 0000000..4999bd2 Binary files /dev/null and b/tuya-control/common/__pycache__/utils.cpython-313.pyc differ diff --git a/tuya-control/common/config.py b/tuya-control/common/config.py new file mode 100644 index 0000000..4eaac00 --- /dev/null +++ b/tuya-control/common/config.py @@ -0,0 +1,24 @@ +""" +Configuration pour l'accès à l'API Tuya. +Ce fichier centralise les informations de connexion pour tous les scripts. +""" + +# Informations de l'API Tuya +API_REGION = "eu" +API_KEY = "fdjdjurkm34yyjp77c7d" +API_SECRET = "3e71807fb0c6406792bdf4f07f98e577" + +# Mode de connexion - 'scan', 'local', ou 'both' +CONNECTION_MODE = "local" # Privilégier la connexion locale pour plus de rapidité + +# Délai d'attente en secondes pour les opérations réseau +TIMEOUT = 3.0 + +# Gestion des voyants sur les appareils +DISABLE_STATUS_LED = False # True = désactiver les LEDs des appareils (si supporté) + +# Configuration du mode verbose +VERBOSE_MODE = True # Afficher plus d'informations pendant l'exécution + +# Préfixe pour l'intégration avec StreamDeck +STREAMDECK_PREFIX = "TUYA_" # Préfixe pour les variables d'environnement \ No newline at end of file diff --git a/tuya-control/common/utils.py b/tuya-control/common/utils.py new file mode 100644 index 0000000..9ac8c13 --- /dev/null +++ b/tuya-control/common/utils.py @@ -0,0 +1,257 @@ +""" +Utilitaires partagés pour les scripts de contrôle des appareils Tuya. +Ce module fournit des fonctions communes utilisées par tous les scripts. +""" + +import os +import sys +import json +import time +import logging +import tinytuya +from . import config + +# Configuration du logging +logging.basicConfig( + level=logging.INFO if config.VERBOSE_MODE else logging.WARNING, + format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', + handlers=[logging.StreamHandler()] +) +logger = logging.getLogger("TuyaControl") + +def load_device_info(device_id): + """ + Charge les informations d'un appareil depuis le fichier devices.json + + Args: + device_id (str): ID de l'appareil Tuya + + Returns: + dict: Informations de l'appareil ou None si non trouvé + """ + try: + # Chemin vers le répertoire parent du projet + base_dir = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + devices_file = os.path.join(base_dir, 'devices.json') + + with open(devices_file, 'r') as f: + devices = json.load(f) + + for device in devices: + if device['id'] == device_id: + return device + + logger.error(f"Appareil avec ID {device_id} non trouvé dans devices.json") + return None + + except Exception as e: + logger.error(f"Erreur lors du chargement des informations de l'appareil: {e}") + return None + +def connect_device(device_id, device_ip=None, device_key=None, device_version=3.3): + """ + Se connecte à un appareil Tuya + + Args: + device_id (str): ID de l'appareil + device_ip (str, optional): IP de l'appareil (facultatif si mode scan) + device_key (str, optional): Clé de l'appareil (facultatif si chargé depuis devices.json) + device_version (float, optional): Version du protocole + + Returns: + tinytuya.Device: Instance de l'appareil connecté ou None en cas d'erreur + """ + try: + # Si la clé n'est pas fournie, charger depuis devices.json + if device_key is None: + device_info = load_device_info(device_id) + if not device_info: + logger.error(f"Impossible de trouver les informations pour l'appareil {device_id}") + return None + device_key = device_info.get('key') + + # Créer l'objet appareil + device = tinytuya.Device( + dev_id=device_id, + address=device_ip, # None si on veut que la bibliothèque recherche l'appareil + local_key=device_key, + version=device_version + ) + + # Configurer le timeout + device.set_socketTimeout(config.TIMEOUT) + + # Tester la connexion + status = device.status() + if 'Error' in status: + logger.error(f"Erreur de connexion à l'appareil {device_id}: {status['Error']}") + return None + + logger.info(f"Connexion réussie à l'appareil {device_id}") + return device + + except Exception as e: + logger.error(f"Erreur lors de la connexion à l'appareil {device_id}: {e}") + return None + +def toggle_device(device, switch_id="1", current_state=None): + """ + Bascule l'état d'un appareil (allumé/éteint) + + Args: + device (tinytuya.Device): Instance de l'appareil + switch_id (str): ID du commutateur (généralement "1" ou "20" pour les lumières) + current_state (bool, optional): État actuel si connu, sinon sera détecté + + Returns: + bool: Nouvel état (True=On, False=Off) ou None en cas d'erreur + """ + try: + # Si l'état actuel n'est pas fourni, l'obtenir + if current_state is None: + status = device.status() + if 'dps' in status and switch_id in status['dps']: + current_state = status['dps'][switch_id] + else: + logger.error(f"Impossible de déterminer l'état actuel du commutateur {switch_id}") + return None + + # Basculer l'état (inverse de l'état actuel) + new_state = not current_state + result = device.set_value(switch_id, new_state) + + logger.info(f"Appareil basculé de {current_state} à {new_state}") + return new_state + + except Exception as e: + logger.error(f"Erreur lors du basculement de l'appareil: {e}") + return None + +def control_shutter(device, action="stop"): + """ + Contrôle un volet roulant ou store + + Args: + device (tinytuya.Device): Instance de l'appareil + action (str): Action à effectuer ("stop", "up"/"forward", "down"/"back") + + Returns: + bool: True si réussi, False sinon + """ + try: + # Convertir les actions en commandes spécifiques au dispositif + command = action + if action == "up": + command = "forward" + elif action == "down": + command = "back" + + # Les volets utilisent généralement le point de données "1" pour leurs commandes + result = device.set_value("1", command) + + logger.info(f"Volet contrôlé avec commande: {command}") + return True + + except Exception as e: + logger.error(f"Erreur lors du contrôle du volet: {e}") + return False + +def get_device_status_text(device_id, status=None): + """ + Obtient un texte descriptif de l'état de l'appareil + + Args: + device_id (str): ID de l'appareil + status (dict, optional): État actuel si déjà obtenu + + Returns: + str: Description textuelle de l'état + """ + try: + device_info = load_device_info(device_id) + if not device_info: + return "Appareil inconnu" + + # Si le statut n'est pas fourni, essayer de se connecter et obtenir l'état + if status is None: + device = connect_device(device_id) + if device: + status = device.status() + else: + return "Non connecté" + + # Obtenir le nom de l'appareil + device_name = device_info.get('name', 'Appareil') + + # Analyser l'état selon le type d'appareil + if 'dps' in status: + dps = status['dps'] + + # Pour les prises et la plupart des appareils on/off + if '1' in dps and isinstance(dps['1'], bool): + state = "ALLUMÉ" if dps['1'] else "ÉTEINT" + return f"{device_name}: {state}" + + # Pour les lumières (généralement dps 20) + elif '20' in dps and isinstance(dps['20'], bool): + state = "ALLUMÉE" if dps['20'] else "ÉTEINTE" + return f"{device_name}: {state}" + + # Pour les volets + elif '1' in dps and isinstance(dps['1'], str): + states = { + "stop": "ARRÊTÉ", + "forward": "EN OUVERTURE", + "back": "EN FERMETURE" + } + state = states.get(dps['1'], dps['1'].upper()) + return f"{device_name}: {state}" + + return f"{device_name}: État inconnu" + + except Exception as e: + logger.error(f"Erreur lors de l'obtention de l'état de l'appareil: {e}") + return "Erreur" + +def scan_for_devices(): + """ + Recherche les appareils Tuya disponibles sur le réseau local + + Returns: + list: Liste des appareils trouvés + """ + try: + logger.info("Recherche des appareils Tuya sur le réseau...") + devices = tinytuya.scan() + if devices is None: + devices = [] + logger.info(f"Trouvé {len(devices)} appareils") + return devices + except Exception as e: + logger.error(f"Erreur lors de la recherche d'appareils: {e}") + return [] + +# Fonction pour l'intégration avec StreamDeck +def report_for_streamdeck(result, device_name="Appareil", new_state=None): + """ + Génère un rapport formaté pour l'intégration avec StreamDeck + + Args: + result (bool): Résultat de l'opération + device_name (str): Nom de l'appareil + new_state: Nouvel état (True=On, False=Off, str pour d'autres états) + + Returns: + dict: Rapport formaté + """ + # Format attendu par StreamDeck + report = { + "success": result is not None and result is not False, + "device": device_name, + "state": str(new_state) if new_state is not None else "unknown", + "timestamp": time.time() + } + + # Afficher le rapport au format JSON pour StreamDeck + print(json.dumps(report)) + return report \ No newline at end of file diff --git a/tuya-control/devices/cameras/cam_dino_toggle.py b/tuya-control/devices/cameras/cam_dino_toggle.py new file mode 100644 index 0000000..cc88b20 --- /dev/null +++ b/tuya-control/devices/cameras/cam_dino_toggle.py @@ -0,0 +1,37 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +""" +Script pour basculer l'état de la caméra (activé/désactivé) +À utiliser avec StreamDeck +""" + +import sys +import os + +# Ajouter le répertoire parent au path pour les imports +sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))) +from common.utils import connect_device, toggle_device, report_for_streamdeck + +# ID et nom de l'appareil +DEVICE_ID = "bf584a5db6d2208dcf2bol" +DEVICE_NAME = "Cam-Dino" + +# Pour cette caméra, le commutateur principal est sur le DPS 101 +SWITCH_ID = "101" + +def main(): + """Fonction principale pour basculer l'état de la caméra""" + # Connexion à l'appareil + device = connect_device(DEVICE_ID) + if not device: + report_for_streamdeck(False, DEVICE_NAME) + return + + # Basculer l'état et obtenir le nouvel état + new_state = toggle_device(device, SWITCH_ID) + + # Rapport pour StreamDeck + report_for_streamdeck(new_state is not None, DEVICE_NAME, new_state) + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/tuya-control/devices/lights/all_lights_effects_toggle.py b/tuya-control/devices/lights/all_lights_effects_toggle.py new file mode 100644 index 0000000..b394133 --- /dev/null +++ b/tuya-control/devices/lights/all_lights_effects_toggle.py @@ -0,0 +1,161 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +""" +Script pour basculer l'état de plusieurs lumières d'ambiance simultanément: +- Saber du bureau dino +- Ringlight +- Chinalight +- Windowled + +À utiliser avec StreamDeck +""" + +import sys +import os +import time +import logging +import tinytuya + +# Ajouter le répertoire parent au path pour les imports +sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))) +from common.utils import report_for_streamdeck +from common import config + +# Obtenir le logger +logger = logging.getLogger("TuyaControl") + +# ID et paramètres des appareils +DEVICES = [ + { + "id": "820180048cce4e2aecc7", + "name": "Saber (Bureau Dino)", + "switch": "7", # Code pour la prise USB (saber) + "ip": "192.168.1.160", + "key": "_rgNtA^X&Vp)A|^l", + "version": 3.3 + }, + { + "id": "bfadb5f27d0fe9a778ixwc", + "name": "Ringlight", + "switch": "20", + "ip": "192.168.1.70", + "key": "dOo5*OR3ixjP?OxO", + "version": 3.5 + }, + { + "id": "bff3ca58c60d8b18d4x3dn", + "name": "Chinalight", + "switch": "20", + "ip": "192.168.1.122", + "key": "Nt6*~S4<2x9;?Q+-", + "version": 3.5 + }, + { + "id": "bf10d8832c8447c512jedz", + "name": "Windowled", + "switch": "20", + "ip": "192.168.1.8", + "key": "e#Z$#dvgmRo}nS8^", + "version": 3.5 + } +] + +def connect_device_direct(device_info): + """ + Se connecte directement à un appareil avec son IP sans passer par la découverte + """ + try: + # Créer l'objet appareil + device = tinytuya.Device( + dev_id=device_info["id"], + address=device_info["ip"], + local_key=device_info["key"], + version=device_info["version"] + ) + + # Configurer le timeout + device.set_socketTimeout(config.TIMEOUT) + + # Vérifier la connexion (optionnel) + status = device.status() + if 'Error' in status: + logger.error(f"Erreur de connexion à {device_info['name']} ({device_info['ip']}): {status['Error']}") + return None + + logger.info(f"Connexion réussie à {device_info['name']} ({device_info['ip']})") + return device + + except Exception as e: + logger.error(f"Erreur lors de la connexion à {device_info['name']} ({device_info['ip']}): {e}") + return None + +def main(): + """Fonction principale pour basculer l'état des lumières d'ambiance simultanément""" + # Connexion aux appareils + connected_devices = [] + + for device_info in DEVICES: + try: + # Ajouter un petit délai entre chaque connexion pour éviter les collisions de socket + time.sleep(0.5) + # Connexion directe avec l'IP + device = connect_device_direct(device_info) + if device: + connected_devices.append({ + "device": device, + "name": device_info["name"], + "switch": device_info["switch"] + }) + except Exception as e: + logger.error(f"Erreur de connexion à {device_info['name']}: {e}") + + if not connected_devices: + report_for_streamdeck(False, "Ambiance") + return + + try: + # Déterminer l'état actuel pour décider de la nouvelle action + lights_on = False + + for device_data in connected_devices: + try: + status = device_data["device"].status() + if status.get('dps', {}).get(device_data["switch"], False): + lights_on = True + break + except Exception as e: + logger.error(f"Erreur lors de la récupération du statut de {device_data['name']}: {e}") + + # Définir le nouvel état (inverse de l'état actuel) + new_state = not lights_on + + # Appliquer l'action sur tous les appareils + success = True + for device_data in connected_devices: + try: + result = device_data["device"].set_value(device_data["switch"], new_state) + if result is None or "Error" in str(result): + success = False + logger.error(f"Erreur lors du changement d'état de {device_data['name']}") + # Ajouter un petit délai entre chaque commande + time.sleep(0.2) + except Exception as e: + success = False + logger.error(f"Erreur lors du changement d'état de {device_data['name']}: {e}") + + # Rapport pour StreamDeck + report_for_streamdeck(success, "Ambiance", new_state) + + finally: + # Fermer explicitement toutes les connexions + for device_data in connected_devices: + try: + device_data["device"].set_socketRetryLimit(0) + device_data["device"].set_socketTimeout(1) + if hasattr(device_data["device"], "_connection") and device_data["device"]._connection: + device_data["device"]._connection.close() + except: + pass + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/tuya-control/devices/lights/bambulights.py b/tuya-control/devices/lights/bambulights.py new file mode 100644 index 0000000..5042eb9 --- /dev/null +++ b/tuya-control/devices/lights/bambulights.py @@ -0,0 +1,92 @@ +import tinytuya +import json + +# Informations Cloud Tuya +API_REGION = "eu" +API_KEY = "fdjdjurkm34yyjp77c7d" +API_SECRET = "3e71807fb0c6406792bdf4f07f98e577" + +# Informations de l'appareil +DEVICE_ID = "bfd5eb950aecda95d3mgpq" # ID de bambulight +DEVICE_NAME = "bambulight" +SWITCH_CODE = "switch_led" # Utiliser le code correct pour l'interrupteur + +def main(): + cloud = tinytuya.Cloud( + apiRegion=API_REGION, + apiKey=API_KEY, + apiSecret=API_SECRET + ) + + # Activer le mode debug dans tinytuya + tinytuya.set_debug(True) + + # Lire l'état actuel + print(f"🔍 Récupération du statut pour l'appareil {DEVICE_ID}...") + status = cloud.getstatus(DEVICE_ID) + + # Vérifier si on a bien une réponse + if not status: + print(f"❌ Aucune réponse de l'API Cloud pour {DEVICE_NAME}") + return + + # Essayer d'afficher la réponse complète + try: + print(f"📊 Réponse brute: {status}") + print(f"📊 Type de réponse: {type(status).__name__}") + + if isinstance(status, dict): + print(f"📊 Clés disponibles: {list(status.keys())}") + except Exception as e: + print(f"⚠️ Erreur lors de l'affichage de la réponse: {e}") + + is_on = None + + # Vérifier le format de la réponse + if isinstance(status, dict) and "result" in status: + result = status["result"] + if isinstance(result, list): + for item in result: + if isinstance(item, dict) and item.get("code") == SWITCH_CODE: + is_on = item.get("value") + break + elif isinstance(result, dict) and "status" in result: + for item in result["status"]: + if item.get("code") == SWITCH_CODE: + is_on = item.get("value") + break + elif isinstance(status, list): + for item in status: + if isinstance(item, dict) and item.get("code") == SWITCH_CODE: + is_on = item.get("value") + break + + if is_on is None: + print(f"❌ Impossible de trouver le statut de l'interrupteur '{SWITCH_CODE}' pour {DEVICE_NAME}") + return + + print(f"ℹ️ État actuel de {DEVICE_NAME}: {'ALLUMÉ' if is_on else 'ÉTEINT'}") + + # Basculer l'état + new_value = not is_on + print(f"ℹ️ Nouvel état à appliquer: {'ALLUMÉ' if new_value else 'ÉTEINT'}") + + # Envoyer la commande + commands = { + "commands": [ + {"code": SWITCH_CODE, "value": new_value} + ] + } + print(f"📤 Envoi de la commande: {json.dumps(commands, indent=2)}") + response = cloud.sendcommand(DEVICE_ID, commands) + print(f"📥 Réponse reçue: {json.dumps(response, indent=2) if response else 'Aucune réponse'}") + + # Vérifier si response n'est pas None avant d'appeler get() + if response is not None and response.get("success"): + print(f"✅ {DEVICE_NAME} est maintenant {'allumé' if new_value else 'éteint'}") + else: + error_msg = response.get("msg", "Erreur inconnue") if response else "Pas de réponse" + print(f"❌ Échec pour {DEVICE_NAME}: {error_msg}") + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/tuya-control/devices/lights/bureau_dino_saber_toggle.py b/tuya-control/devices/lights/bureau_dino_saber_toggle.py new file mode 100644 index 0000000..2ea687a --- /dev/null +++ b/tuya-control/devices/lights/bureau_dino_saber_toggle.py @@ -0,0 +1,92 @@ +import tinytuya +import json + +# Informations Cloud Tuya +API_REGION = "eu" +API_KEY = "fdjdjurkm34yyjp77c7d" +API_SECRET = "3e71807fb0c6406792bdf4f07f98e577" + +# Informations de l'appareil +DEVICE_ID = "820180048cce4e2aecc7" # ID du bureau dino +DEVICE_NAME = "Saber (Bureau Dino)" +SWITCH_CODE = "switch_usb1" # Code pour la prise USB (saber) + +def main(): + cloud = tinytuya.Cloud( + apiRegion=API_REGION, + apiKey=API_KEY, + apiSecret=API_SECRET + ) + + # Activer le mode debug dans tinytuya + tinytuya.set_debug(True) + + # Lire l'état actuel + print(f"🔍 Récupération du statut pour l'appareil {DEVICE_ID}...") + status = cloud.getstatus(DEVICE_ID) + + # Vérifier si on a bien une réponse + if not status: + print(f"❌ Aucune réponse de l'API Cloud pour {DEVICE_NAME}") + return + + # Essayer d'afficher la réponse complète + try: + print(f"📊 Réponse brute: {status}") + print(f"📊 Type de réponse: {type(status).__name__}") + + if isinstance(status, dict): + print(f"📊 Clés disponibles: {list(status.keys())}") + except Exception as e: + print(f"⚠️ Erreur lors de l'affichage de la réponse: {e}") + + is_on = None + + # Vérifier le format de la réponse + if isinstance(status, dict) and "result" in status: + result = status["result"] + if isinstance(result, list): + for item in result: + if isinstance(item, dict) and item.get("code") == SWITCH_CODE: + is_on = item.get("value") + break + elif isinstance(result, dict) and "status" in result: + for item in result["status"]: + if item.get("code") == SWITCH_CODE: + is_on = item.get("value") + break + elif isinstance(status, list): + for item in status: + if isinstance(item, dict) and item.get("code") == SWITCH_CODE: + is_on = item.get("value") + break + + if is_on is None: + print(f"❌ Impossible de trouver le statut de l'interrupteur '{SWITCH_CODE}' pour {DEVICE_NAME}") + return + + print(f"ℹ️ État actuel de {DEVICE_NAME}: {'ALLUMÉ' if is_on else 'ÉTEINT'}") + + # Basculer l'état + new_value = not is_on + print(f"ℹ️ Nouvel état à appliquer: {'ALLUMÉ' if new_value else 'ÉTEINT'}") + + # Envoyer la commande + commands = { + "commands": [ + {"code": SWITCH_CODE, "value": new_value} + ] + } + print(f"📤 Envoi de la commande: {json.dumps(commands, indent=2)}") + response = cloud.sendcommand(DEVICE_ID, commands) + print(f"📥 Réponse reçue: {json.dumps(response, indent=2) if response else 'Aucune réponse'}") + + # Vérifier si response n'est pas None avant d'appeler get() + if response is not None and response.get("success"): + print(f"✅ {DEVICE_NAME} est maintenant {'allumé' if new_value else 'éteint'}") + else: + error_msg = response.get("msg", "Erreur inconnue") if response else "Pas de réponse" + print(f"❌ Échec pour {DEVICE_NAME}: {error_msg}") + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/tuya-control/devices/lights/chinalight.py b/tuya-control/devices/lights/chinalight.py new file mode 100644 index 0000000..8e070ed --- /dev/null +++ b/tuya-control/devices/lights/chinalight.py @@ -0,0 +1,92 @@ +import tinytuya +import json + +# Informations Cloud Tuya +API_REGION = "eu" +API_KEY = "fdjdjurkm34yyjp77c7d" +API_SECRET = "3e71807fb0c6406792bdf4f07f98e577" + +# Informations de l'appareil +DEVICE_ID = "bff3ca58c60d8b18d4x3dn" # ID de chinalight +DEVICE_NAME = "chinalight" +SWITCH_CODE = "switch_led" # Utiliser le code correct pour l'interrupteur + +def main(): + cloud = tinytuya.Cloud( + apiRegion=API_REGION, + apiKey=API_KEY, + apiSecret=API_SECRET + ) + + # Activer le mode debug dans tinytuya + tinytuya.set_debug(True) + + # Lire l'état actuel + print(f"🔍 Récupération du statut pour l'appareil {DEVICE_ID}...") + status = cloud.getstatus(DEVICE_ID) + + # Vérifier si on a bien une réponse + if not status: + print(f"❌ Aucune réponse de l'API Cloud pour {DEVICE_NAME}") + return + + # Essayer d'afficher la réponse complète + try: + print(f"📊 Réponse brute: {status}") + print(f"📊 Type de réponse: {type(status).__name__}") + + if isinstance(status, dict): + print(f"📊 Clés disponibles: {list(status.keys())}") + except Exception as e: + print(f"⚠️ Erreur lors de l'affichage de la réponse: {e}") + + is_on = None + + # Vérifier le format de la réponse + if isinstance(status, dict) and "result" in status: + result = status["result"] + if isinstance(result, list): + for item in result: + if isinstance(item, dict) and item.get("code") == SWITCH_CODE: + is_on = item.get("value") + break + elif isinstance(result, dict) and "status" in result: + for item in result["status"]: + if item.get("code") == SWITCH_CODE: + is_on = item.get("value") + break + elif isinstance(status, list): + for item in status: + if isinstance(item, dict) and item.get("code") == SWITCH_CODE: + is_on = item.get("value") + break + + if is_on is None: + print(f"❌ Impossible de trouver le statut de l'interrupteur '{SWITCH_CODE}' pour {DEVICE_NAME}") + return + + print(f"ℹ️ État actuel de {DEVICE_NAME}: {'ALLUMÉ' if is_on else 'ÉTEINT'}") + + # Basculer l'état + new_value = not is_on + print(f"ℹ️ Nouvel état à appliquer: {'ALLUMÉ' if new_value else 'ÉTEINT'}") + + # Envoyer la commande + commands = { + "commands": [ + {"code": SWITCH_CODE, "value": new_value} + ] + } + print(f"📤 Envoi de la commande: {json.dumps(commands, indent=2)}") + response = cloud.sendcommand(DEVICE_ID, commands) + print(f"📥 Réponse reçue: {json.dumps(response, indent=2) if response else 'Aucune réponse'}") + + # Vérifier si response n'est pas None avant d'appeler get() + if response is not None and response.get("success"): + print(f"✅ {DEVICE_NAME} est maintenant {'allumé' if new_value else 'éteint'}") + else: + error_msg = response.get("msg", "Erreur inconnue") if response else "Pas de réponse" + print(f"❌ Échec pour {DEVICE_NAME}: {error_msg}") + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/tuya-control/devices/lights/light_1_toggle.py b/tuya-control/devices/lights/light_1_toggle.py new file mode 100644 index 0000000..3be9103 --- /dev/null +++ b/tuya-control/devices/lights/light_1_toggle.py @@ -0,0 +1,108 @@ +import tinytuya +import json + +# Informations Cloud Tuya +API_REGION = "eu" +API_KEY = "fdjdjurkm34yyjp77c7d" +API_SECRET = "3e71807fb0c6406792bdf4f07f98e577" + +# Informations de l'appareil +DEVICE_ID = "bfdc2f8e4effa0d826gnxg" +DEVICE_NAME = "Light 1" +SWITCH_CODE = "switch_led" # ou "switch" ou "switch_led", dépend du device (à vérifier !) + +def main(): + cloud = tinytuya.Cloud( + apiRegion=API_REGION, + apiKey=API_KEY, + apiSecret=API_SECRET + ) + + # Activer le mode debug dans tinytuya + tinytuya.set_debug(True) + + # Lire l'état actuel + print(f"🔍 Récupération du statut pour l'appareil {DEVICE_ID}...") + status = cloud.getstatus(DEVICE_ID) + + # Vérifier si on a bien une réponse + if not status: + print(f"❌ Aucune réponse de l'API Cloud pour {DEVICE_NAME}") + return + + # Essayer d'afficher la réponse complète + try: + print(f"📊 Réponse brute: {status}") + print(f"📊 Type de réponse: {type(status).__name__}") + + if isinstance(status, dict): + print(f"📊 Clés disponibles: {list(status.keys())}") + except Exception as e: + print(f"⚠️ Erreur lors de l'affichage de la réponse: {e}") + + is_on = None + + # Vérifier le format de la réponse + if isinstance(status, dict) and "result" in status: + result = status["result"] + if isinstance(result, list): + # Format: {"result": [{"code": "switch_led", "value": true}, ...]} + for item in result: + if isinstance(item, dict) and item.get("code") == SWITCH_CODE: + is_on = item.get("value") + break + elif isinstance(result, dict) and "status" in result: + # Format: {"result": {"status": [{"code": "switch_led", "value": true}, ...]}} + for item in result["status"]: + if item.get("code") == SWITCH_CODE: + is_on = item.get("value") + break + elif isinstance(status, list): + # Format alternatif: liste directe de statuts + for item in status: + if isinstance(item, dict) and item.get("code") == SWITCH_CODE: + is_on = item.get("value") + break + + if is_on is None: + print(f"❌ Impossible de trouver le statut de l'interrupteur '{SWITCH_CODE}' pour {DEVICE_NAME}") + + # Afficher les codes disponibles + codes = [] + if isinstance(status, dict) and "result" in status: + result = status["result"] + if isinstance(result, list): + codes = [item.get("code") for item in result if isinstance(item, dict) and "code" in item] + elif isinstance(result, dict) and "status" in result: + codes = [item.get("code") for item in result["status"] if isinstance(item, dict) and "code" in item] + elif isinstance(status, list): + codes = [item.get("code") for item in status if isinstance(item, dict) and "code" in item] + + print(f"💡 Codes disponibles: {codes}") + return + + print(f"ℹ️ État actuel de {DEVICE_NAME}: {'ALLUMÉ' if is_on else 'ÉTEINT'}") + + # Basculer l'état + new_value = not is_on + print(f"ℹ️ Nouvel état à appliquer: {'ALLUMÉ' if new_value else 'ÉTEINT'}") + + # Envoyer la commande + commands = { + "commands": [ + {"code": SWITCH_CODE, "value": new_value} + ] + } + print(f"📤 Envoi de la commande: {json.dumps(commands, indent=2)}") + response = cloud.sendcommand(DEVICE_ID, commands) + print(f"📥 Réponse reçue: {json.dumps(response, indent=2) if response else 'Aucune réponse'}") + + # Vérifier si response n'est pas None avant d'appeler get() + if response is not None and response.get("success"): + print(f"✅ {DEVICE_NAME} est maintenant {'allumé' if new_value else 'éteint'}") + else: + error_msg = response.get("msg", "Erreur inconnue") if response else "Pas de réponse" + print(f"❌ Échec pour {DEVICE_NAME}: {error_msg}") + +if __name__ == "__main__": + main() diff --git a/tuya-control/devices/lights/light_2_toggle.py b/tuya-control/devices/lights/light_2_toggle.py new file mode 100644 index 0000000..24c069c --- /dev/null +++ b/tuya-control/devices/lights/light_2_toggle.py @@ -0,0 +1,95 @@ +import tinytuya +import json + +# Informations Cloud Tuya +API_REGION = "eu" +API_KEY = "fdjdjurkm34yyjp77c7d" +API_SECRET = "3e71807fb0c6406792bdf4f07f98e577" + +# Informations de l'appareil +DEVICE_ID = "bf5516c52504a7a8dcof7r" +DEVICE_NAME = "Light 2" +SWITCH_CODE = "switch_led" # ou "switch" ou "switch_led", dépend du device (à vérifier !) + +def main(): + cloud = tinytuya.Cloud( + apiRegion=API_REGION, + apiKey=API_KEY, + apiSecret=API_SECRET + ) + + # Activer le mode debug dans tinytuya + tinytuya.set_debug(True) + + # Lire l'état actuel + print(f"🔍 Récupération du statut pour l'appareil {DEVICE_ID}...") + status = cloud.getstatus(DEVICE_ID) + + # Vérifier si on a bien une réponse + if not status: + print(f"❌ Aucune réponse de l'API Cloud pour {DEVICE_NAME}") + return + + # Essayer d'afficher la réponse complète + try: + print(f"📊 Réponse brute: {status}") + print(f"📊 Type de réponse: {type(status).__name__}") + + if isinstance(status, dict): + print(f"📊 Clés disponibles: {list(status.keys())}") + except Exception as e: + print(f"⚠️ Erreur lors de l'affichage de la réponse: {e}") + + is_on = None + + # Vérifier le format de la réponse + if isinstance(status, dict) and "result" in status: + result = status["result"] + if isinstance(result, list): + # Format: {"result": [{"code": "switch_led", "value": true}, ...]} + for item in result: + if isinstance(item, dict) and item.get("code") == SWITCH_CODE: + is_on = item.get("value") + break + elif isinstance(result, dict) and "status" in result: + # Format: {"result": {"status": [{"code": "switch_led", "value": true}, ...]}} + for item in result["status"]: + if item.get("code") == SWITCH_CODE: + is_on = item.get("value") + break + elif isinstance(status, list): + # Format alternatif: liste directe de statuts + for item in status: + if isinstance(item, dict) and item.get("code") == SWITCH_CODE: + is_on = item.get("value") + break + + if is_on is None: + print(f"❌ Impossible de trouver le statut de l'interrupteur '{SWITCH_CODE}' pour {DEVICE_NAME}") + return + + print(f"ℹ️ État actuel de {DEVICE_NAME}: {'ALLUMÉ' if is_on else 'ÉTEINT'}") + + # Basculer l'état + new_value = not is_on + print(f"ℹ️ Nouvel état à appliquer: {'ALLUMÉ' if new_value else 'ÉTEINT'}") + + # Envoyer la commande + commands = { + "commands": [ + {"code": SWITCH_CODE, "value": new_value} + ] + } + print(f"📤 Envoi de la commande: {json.dumps(commands, indent=2)}") + response = cloud.sendcommand(DEVICE_ID, commands) + print(f"📥 Réponse reçue: {json.dumps(response, indent=2) if response else 'Aucune réponse'}") + + # Vérifier si response n'est pas None avant d'appeler get() + if response is not None and response.get("success"): + print(f"✅ {DEVICE_NAME} est maintenant {'allumé' if new_value else 'éteint'}") + else: + error_msg = response.get("msg", "Erreur inconnue") if response else "Pas de réponse" + print(f"❌ Échec pour {DEVICE_NAME}: {error_msg}") + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/tuya-control/devices/lights/light_dino_2.py b/tuya-control/devices/lights/light_dino_2.py new file mode 100644 index 0000000..08378dc --- /dev/null +++ b/tuya-control/devices/lights/light_dino_2.py @@ -0,0 +1,106 @@ +import tinytuya +import json + +# Informations Cloud Tuya +API_REGION = "eu" +API_KEY = "fdjdjurkm34yyjp77c7d" +API_SECRET = "3e71807fb0c6406792bdf4f07f98e577" + +# Informations des appareils +DEVICES = [ + { + "id": "bfdc2f8e4effa0d826gnxg", # ID de la lumière 1 + "name": "Light 1", + "switch_code": "switch_led" + }, + { + "id": "bf5516c52504a7a8dcof7r", # ID de la lumière 2 + "name": "Light 2", + "switch_code": "switch_led" + } +] + +def main(): + cloud = tinytuya.Cloud( + apiRegion=API_REGION, + apiKey=API_KEY, + apiSecret=API_SECRET + ) + + # Activer le mode debug dans tinytuya + tinytuya.set_debug(True) + + for device in DEVICES: + device_id = device["id"] + device_name = device["name"] + switch_code = device["switch_code"] + + # Lire l'état actuel + print(f"🔍 Récupération du statut pour l'appareil {device_id}...") + status = cloud.getstatus(device_id) + + # Vérifier si on a bien une réponse + if not status: + print(f"❌ Aucune réponse de l'API Cloud pour {device_name}") + continue + + # Essayer d'afficher la réponse complète + try: + print(f"📊 Réponse brute: {status}") + print(f"📊 Type de réponse: {type(status).__name__}") + + if isinstance(status, dict): + print(f"📊 Clés disponibles: {list(status.keys())}") + except Exception as e: + print(f"⚠️ Erreur lors de l'affichage de la réponse: {e}") + + is_on = None + + # Vérifier le format de la réponse + if isinstance(status, dict) and "result" in status: + result = status["result"] + if isinstance(result, list): + for item in result: + if isinstance(item, dict) and item.get("code") == switch_code: + is_on = item.get("value") + break + elif isinstance(result, dict) and "status" in result: + for item in result["status"]: + if item.get("code") == switch_code: + is_on = item.get("value") + break + elif isinstance(status, list): + for item in status: + if isinstance(item, dict) and item.get("code") == switch_code: + is_on = item.get("value") + break + + if is_on is None: + print(f"❌ Impossible de trouver le statut de l'interrupteur '{switch_code}' pour {device_name}") + continue + + print(f"ℹ️ État actuel de {device_name}: {'ALLUMÉ' if is_on else 'ÉTEINT'}") + + # Basculer l'état + new_value = not is_on + print(f"ℹ️ Nouvel état à appliquer: {'ALLUMÉ' if new_value else 'ÉTEINT'}") + + # Envoyer la commande + commands = { + "commands": [ + {"code": switch_code, "value": new_value} + ] + } + print(f"📤 Envoi de la commande: {json.dumps(commands, indent=2)}") + response = cloud.sendcommand(device_id, commands) + print(f"📥 Réponse reçue: {json.dumps(response, indent=2) if response else 'Aucune réponse'}") + + # Vérifier si response n'est pas None avant d'appeler get() + if response is not None and response.get("success"): + print(f"✅ {device_name} est maintenant {'allumé' if new_value else 'éteint'}") + else: + error_msg = response.get("msg", "Erreur inconnue") if response else "Pas de réponse" + print(f"❌ Échec pour {device_name}: {error_msg}") + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/tuya-control/devices/lights/ringlight_toggle.py b/tuya-control/devices/lights/ringlight_toggle.py new file mode 100644 index 0000000..73e30c9 --- /dev/null +++ b/tuya-control/devices/lights/ringlight_toggle.py @@ -0,0 +1,92 @@ +import tinytuya +import json + +# Informations Cloud Tuya +API_REGION = "eu" +API_KEY = "fdjdjurkm34yyjp77c7d" +API_SECRET = "3e71807fb0c6406792bdf4f07f98e577" + +# Informations de l'appareil +DEVICE_ID = "bfadb5f27d0fe9a778ixwc" # ID de la ringlight +DEVICE_NAME = "ringlight" +SWITCH_CODE = "switch_led" # Utiliser le code correct pour l'interrupteur + +def main(): + cloud = tinytuya.Cloud( + apiRegion=API_REGION, + apiKey=API_KEY, + apiSecret=API_SECRET + ) + + # Activer le mode debug dans tinytuya + tinytuya.set_debug(True) + + # Lire l'état actuel + print(f"🔍 Récupération du statut pour l'appareil {DEVICE_ID}...") + status = cloud.getstatus(DEVICE_ID) + + # Vérifier si on a bien une réponse + if not status: + print(f"❌ Aucune réponse de l'API Cloud pour {DEVICE_NAME}") + return + + # Essayer d'afficher la réponse complète + try: + print(f"📊 Réponse brute: {status}") + print(f"📊 Type de réponse: {type(status).__name__}") + + if isinstance(status, dict): + print(f"📊 Clés disponibles: {list(status.keys())}") + except Exception as e: + print(f"⚠️ Erreur lors de l'affichage de la réponse: {e}") + + is_on = None + + # Vérifier le format de la réponse + if isinstance(status, dict) and "result" in status: + result = status["result"] + if isinstance(result, list): + for item in result: + if isinstance(item, dict) and item.get("code") == SWITCH_CODE: + is_on = item.get("value") + break + elif isinstance(result, dict) and "status" in result: + for item in result["status"]: + if item.get("code") == SWITCH_CODE: + is_on = item.get("value") + break + elif isinstance(status, list): + for item in status: + if isinstance(item, dict) and item.get("code") == SWITCH_CODE: + is_on = item.get("value") + break + + if is_on is None: + print(f"❌ Impossible de trouver le statut de l'interrupteur '{SWITCH_CODE}' pour {DEVICE_NAME}") + return + + print(f"ℹ️ État actuel de {DEVICE_NAME}: {'ALLUMÉ' if is_on else 'ÉTEINT'}") + + # Basculer l'état + new_value = not is_on + print(f"ℹ️ Nouvel état à appliquer: {'ALLUMÉ' if new_value else 'ÉTEINT'}") + + # Envoyer la commande + commands = { + "commands": [ + {"code": SWITCH_CODE, "value": new_value} + ] + } + print(f"📤 Envoi de la commande: {json.dumps(commands, indent=2)}") + response = cloud.sendcommand(DEVICE_ID, commands) + print(f"📥 Réponse reçue: {json.dumps(response, indent=2) if response else 'Aucune réponse'}") + + # Vérifier si response n'est pas None avant d'appeler get() + if response is not None and response.get("success"): + print(f"✅ {DEVICE_NAME} est maintenant {'allumé' if new_value else 'éteint'}") + else: + error_msg = response.get("msg", "Erreur inconnue") if response else "Pas de réponse" + print(f"❌ Échec pour {DEVICE_NAME}: {error_msg}") + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/tuya-control/devices/lights/salon.py b/tuya-control/devices/lights/salon.py new file mode 100644 index 0000000..4a5bf8a --- /dev/null +++ b/tuya-control/devices/lights/salon.py @@ -0,0 +1,92 @@ +import tinytuya +import json + +# Informations Cloud Tuya +API_REGION = "eu" +API_KEY = "fdjdjurkm34yyjp77c7d" +API_SECRET = "3e71807fb0c6406792bdf4f07f98e577" + +# Informations de l'appareil +DEVICE_ID = "bf2765002c5c1bcf1e4vcl" # ID du salon +DEVICE_NAME = "salon" +SWITCH_CODE = "switch_1" # Utiliser le code correct pour l'interrupteur 1 + +def main(): + cloud = tinytuya.Cloud( + apiRegion=API_REGION, + apiKey=API_KEY, + apiSecret=API_SECRET + ) + + # Activer le mode debug dans tinytuya + tinytuya.set_debug(True) + + # Lire l'état actuel + print(f"🔍 Récupération du statut pour l'appareil {DEVICE_ID}...") + status = cloud.getstatus(DEVICE_ID) + + # Vérifier si on a bien une réponse + if not status: + print(f"❌ Aucune réponse de l'API Cloud pour {DEVICE_NAME}") + return + + # Essayer d'afficher la réponse complète + try: + print(f"📊 Réponse brute: {status}") + print(f"📊 Type de réponse: {type(status).__name__}") + + if isinstance(status, dict): + print(f"📊 Clés disponibles: {list(status.keys())}") + except Exception as e: + print(f"⚠️ Erreur lors de l'affichage de la réponse: {e}") + + is_on = None + + # Vérifier le format de la réponse + if isinstance(status, dict) and "result" in status: + result = status["result"] + if isinstance(result, list): + for item in result: + if isinstance(item, dict) and item.get("code") == SWITCH_CODE: + is_on = item.get("value") + break + elif isinstance(result, dict) and "status" in result: + for item in result["status"]: + if item.get("code") == SWITCH_CODE: + is_on = item.get("value") + break + elif isinstance(status, list): + for item in status: + if isinstance(item, dict) and item.get("code") == SWITCH_CODE: + is_on = item.get("value") + break + + if is_on is None: + print(f"❌ Impossible de trouver le statut de l'interrupteur '{SWITCH_CODE}' pour {DEVICE_NAME}") + return + + print(f"ℹ️ État actuel de {DEVICE_NAME}: {'ALLUMÉ' if is_on else 'ÉTEINT'}") + + # Basculer l'état + new_value = not is_on + print(f"ℹ️ Nouvel état à appliquer: {'ALLUMÉ' if new_value else 'ÉTEINT'}") + + # Envoyer la commande + commands = { + "commands": [ + {"code": SWITCH_CODE, "value": new_value} + ] + } + print(f"📤 Envoi de la commande: {json.dumps(commands, indent=2)}") + response = cloud.sendcommand(DEVICE_ID, commands) + print(f"📥 Réponse reçue: {json.dumps(response, indent=2) if response else 'Aucune réponse'}") + + # Vérifier si response n'est pas None avant d'appeler get() + if response is not None and response.get("success"): + print(f"✅ {DEVICE_NAME} est maintenant {'allumé' if new_value else 'éteint'}") + else: + error_msg = response.get("msg", "Erreur inconnue") if response else "Pas de réponse" + print(f"❌ Échec pour {DEVICE_NAME}: {error_msg}") + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/tuya-control/devices/lights/windowled.py b/tuya-control/devices/lights/windowled.py new file mode 100644 index 0000000..968cd0d --- /dev/null +++ b/tuya-control/devices/lights/windowled.py @@ -0,0 +1,92 @@ +import tinytuya +import json + +# Informations Cloud Tuya +API_REGION = "eu" +API_KEY = "fdjdjurkm34yyjp77c7d" +API_SECRET = "3e71807fb0c6406792bdf4f07f98e577" + +# Informations de l'appareil +DEVICE_ID = "bf10d8832c8447c512jedz" # ID de windowled +DEVICE_NAME = "windowled" +SWITCH_CODE = "switch_led" # Utiliser le code correct pour l'interrupteur + +def main(): + cloud = tinytuya.Cloud( + apiRegion=API_REGION, + apiKey=API_KEY, + apiSecret=API_SECRET + ) + + # Activer le mode debug dans tinytuya + tinytuya.set_debug(True) + + # Lire l'état actuel + print(f"🔍 Récupération du statut pour l'appareil {DEVICE_ID}...") + status = cloud.getstatus(DEVICE_ID) + + # Vérifier si on a bien une réponse + if not status: + print(f"❌ Aucune réponse de l'API Cloud pour {DEVICE_NAME}") + return + + # Essayer d'afficher la réponse complète + try: + print(f"📊 Réponse brute: {status}") + print(f"📊 Type de réponse: {type(status).__name__}") + + if isinstance(status, dict): + print(f"📊 Clés disponibles: {list(status.keys())}") + except Exception as e: + print(f"⚠️ Erreur lors de l'affichage de la réponse: {e}") + + is_on = None + + # Vérifier le format de la réponse + if isinstance(status, dict) and "result" in status: + result = status["result"] + if isinstance(result, list): + for item in result: + if isinstance(item, dict) and item.get("code") == SWITCH_CODE: + is_on = item.get("value") + break + elif isinstance(result, dict) and "status" in result: + for item in result["status"]: + if item.get("code") == SWITCH_CODE: + is_on = item.get("value") + break + elif isinstance(status, list): + for item in status: + if isinstance(item, dict) and item.get("code") == SWITCH_CODE: + is_on = item.get("value") + break + + if is_on is None: + print(f"❌ Impossible de trouver le statut de l'interrupteur '{SWITCH_CODE}' pour {DEVICE_NAME}") + return + + print(f"ℹ️ État actuel de {DEVICE_NAME}: {'ALLUMÉ' if is_on else 'ÉTEINT'}") + + # Basculer l'état + new_value = not is_on + print(f"ℹ️ Nouvel état à appliquer: {'ALLUMÉ' if new_value else 'ÉTEINT'}") + + # Envoyer la commande + commands = { + "commands": [ + {"code": SWITCH_CODE, "value": new_value} + ] + } + print(f"📤 Envoi de la commande: {json.dumps(commands, indent=2)}") + response = cloud.sendcommand(DEVICE_ID, commands) + print(f"📥 Réponse reçue: {json.dumps(response, indent=2) if response else 'Aucune réponse'}") + + # Vérifier si response n'est pas None avant d'appeler get() + if response is not None and response.get("success"): + print(f"✅ {DEVICE_NAME} est maintenant {'allumé' if new_value else 'éteint'}") + else: + error_msg = response.get("msg", "Erreur inconnue") if response else "Pas de réponse" + print(f"❌ Échec pour {DEVICE_NAME}: {error_msg}") + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/tuya-control/devices/others/bureau_dino_toggle.py b/tuya-control/devices/others/bureau_dino_toggle.py new file mode 100644 index 0000000..4097372 --- /dev/null +++ b/tuya-control/devices/others/bureau_dino_toggle.py @@ -0,0 +1,44 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +""" +Script pour basculer l'état du bureau dino (allumé/éteint) sans affecter le saber +À utiliser avec StreamDeck +""" + +import sys +import os + +# Ajouter le répertoire parent au path pour les imports +sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))) +from common.utils import connect_device, report_for_streamdeck + +# ID et nom de l'appareil +DEVICE_ID = "820180048cce4e2aecc7" +DEVICE_NAME = "Bureau Dino" + +# Le commutateur principal est sur le DPS 1 +SWITCH_ID = "1" + +def main(): + """Fonction principale pour basculer l'état du bureau dino sans affecter le saber""" + # Connexion à l'appareil + device = connect_device(DEVICE_ID) + if not device: + report_for_streamdeck(False, DEVICE_NAME) + return + + # Obtenir l'état actuel + status = device.status() + + # Pour ce type d'appareil, le DPS 1 contrôle l'alimentation principale + current_state = status.get('dps', {}).get(SWITCH_ID, False) + + # Basculer l'état (inverse de l'état actuel) + new_state = not current_state + result = device.set_value(SWITCH_ID, new_state) + + # Rapport pour StreamDeck + report_for_streamdeck(result is not None, DEVICE_NAME, new_state) + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/tuya-control/devices/others/sirene_toggle.py b/tuya-control/devices/others/sirene_toggle.py new file mode 100644 index 0000000..baa98c3 --- /dev/null +++ b/tuya-control/devices/others/sirene_toggle.py @@ -0,0 +1,41 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +""" +Script pour basculer l'état de la sirène intelligente (activée/désactivée) +À utiliser avec StreamDeck +""" + +import sys +import os + +# Ajouter le répertoire parent au path pour les imports +sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))) +from common.utils import connect_device, report_for_streamdeck + +# ID et nom de l'appareil +DEVICE_ID = "bf4054de281cb6ada8actg" +DEVICE_NAME = "Sirène intelligente" + +def main(): + """Fonction principale pour basculer l'état de la sirène""" + # Connexion à l'appareil + device = connect_device(DEVICE_ID) + if not device: + report_for_streamdeck(False, DEVICE_NAME) + return + + # Obtenir l'état actuel + status = device.status() + + # Pour ce type d'appareil, le DPS 127 indique l'état de l'alarme + current_state = status.get('dps', {}).get('127', False) + + # Basculer l'état (inverse de l'état actuel) + new_state = not current_state + result = device.set_value('127', new_state) + + # Rapport pour StreamDeck + report_for_streamdeck(result is not None, DEVICE_NAME, new_state) + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/tuya-control/devices/plugs/Ecrangauche.py b/tuya-control/devices/plugs/Ecrangauche.py new file mode 100644 index 0000000..e459aef --- /dev/null +++ b/tuya-control/devices/plugs/Ecrangauche.py @@ -0,0 +1,37 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +""" +Script pour basculer l'état de l'écran gauche (allumé/éteint) +À utiliser avec StreamDeck +""" + +import sys +import os + +# Ajouter le répertoire parent au path pour les imports +sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))) +from common.utils import connect_device, toggle_device, report_for_streamdeck + +# ID et nom de l'appareil +DEVICE_ID = "bfc369d2ca89602058xajc" +DEVICE_NAME = "ecran gauche" + +# Le commutateur principal est sur le DPS 1 +SWITCH_ID = "1" + +def main(): + """Fonction principale pour basculer l'état de l'écran""" + # Connexion à l'appareil + device = connect_device(DEVICE_ID) + if not device: + report_for_streamdeck(False, DEVICE_NAME) + return + + # Basculer l'état et obtenir le nouvel état + new_state = toggle_device(device, SWITCH_ID) + + # Rapport pour StreamDeck + report_for_streamdeck(new_state is not None, DEVICE_NAME, new_state) + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/tuya-control/devices/plugs/bureau_toggle.py b/tuya-control/devices/plugs/bureau_toggle.py new file mode 100644 index 0000000..3a7f410 --- /dev/null +++ b/tuya-control/devices/plugs/bureau_toggle.py @@ -0,0 +1,37 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +""" +Script pour basculer l'état du PC (allumé/éteint) +À utiliser avec StreamDeck +""" + +import sys +import os + +# Ajouter le répertoire parent au path pour les imports +sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))) +from common.utils import connect_device, toggle_device, report_for_streamdeck + +# ID et nom de l'appareil +DEVICE_ID = "bfe57aa0e61a9b529bzrff" +DEVICE_NAME = "PC" + +# Commutateur principal +SWITCH_ID = "1" + +def main(): + """Fonction principale pour basculer l'état du PC""" + # Connexion à l'appareil + device = connect_device(DEVICE_ID) + if not device: + report_for_streamdeck(False, DEVICE_NAME) + return + + # Basculer l'état et obtenir le nouvel état + new_state = toggle_device(device, SWITCH_ID) + + # Rapport pour StreamDeck + report_for_streamdeck(new_state is not None, DEVICE_NAME, new_state) + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/tuya-control/devices/plugs/bureaudino.py b/tuya-control/devices/plugs/bureaudino.py new file mode 100644 index 0000000..e6cb1fc --- /dev/null +++ b/tuya-control/devices/plugs/bureaudino.py @@ -0,0 +1,37 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +""" +Script pour basculer l'état du bureau dino (allumé/éteint) +À utiliser avec StreamDeck +""" + +import sys +import os + +# Ajouter le répertoire parent au path pour les imports +sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))) +from common.utils import connect_device, toggle_device, report_for_streamdeck + +# ID et nom de l'appareil +DEVICE_ID = "820180048cce4e2aecc7" +DEVICE_NAME = "bureau dino" + +# Le commutateur principal est sur le DPS 1 +SWITCH_ID = "1" + +def main(): + """Fonction principale pour basculer l'état du bureau""" + # Connexion à l'appareil + device = connect_device(DEVICE_ID) + if not device: + report_for_streamdeck(False, DEVICE_NAME) + return + + # Basculer l'état et obtenir le nouvel état + new_state = toggle_device(device, SWITCH_ID) + + # Rapport pour StreamDeck + report_for_streamdeck(new_state is not None, DEVICE_NAME, new_state) + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/tuya-control/devices/plugs/imprimante3d.py b/tuya-control/devices/plugs/imprimante3d.py new file mode 100644 index 0000000..322ee5e --- /dev/null +++ b/tuya-control/devices/plugs/imprimante3d.py @@ -0,0 +1,37 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +""" +Script pour basculer l'état de l'imprimante 3D (allumé/éteint) +À utiliser avec StreamDeck +""" + +import sys +import os + +# Ajouter le répertoire parent au path pour les imports +sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))) +from common.utils import connect_device, toggle_device, report_for_streamdeck + +# ID et nom de l'appareil +DEVICE_ID = "bf9043f5954449c435mcec" +DEVICE_NAME = "imprimante 3d" + +# Le commutateur principal est sur le DPS 1 +SWITCH_ID = "1" + +def main(): + """Fonction principale pour basculer l'état de l'imprimante""" + # Connexion à l'appareil + device = connect_device(DEVICE_ID) + if not device: + report_for_streamdeck(False, DEVICE_NAME) + return + + # Basculer l'état et obtenir le nouvel état + new_state = toggle_device(device, SWITCH_ID) + + # Rapport pour StreamDeck + report_for_streamdeck(new_state is not None, DEVICE_NAME, new_state) + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/tuya-control/devices/plugs/prise_cafe_toggle.py b/tuya-control/devices/plugs/prise_cafe_toggle.py new file mode 100644 index 0000000..08d249a --- /dev/null +++ b/tuya-control/devices/plugs/prise_cafe_toggle.py @@ -0,0 +1,34 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +""" +Script pour basculer l'état de la prise café (allumé/éteint) +À utiliser avec StreamDeck +""" + +import sys +import os + +# Ajouter le répertoire parent au path pour les imports +sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))) +from common.utils import connect_device, toggle_device, report_for_streamdeck + +# ID et nom de l'appareil +DEVICE_ID = "bf3254180de3bdd7bfnbei" +DEVICE_NAME = "prise café" + +def main(): + """Fonction principale pour basculer l'état de la prise""" + # Connexion à l'appareil + device = connect_device(DEVICE_ID) + if not device: + report_for_streamdeck(False, DEVICE_NAME) + return + + # Basculer l'état et obtenir le nouvel état + new_state = toggle_device(device) + + # Rapport pour StreamDeck + report_for_streamdeck(new_state is not None, DEVICE_NAME, new_state) + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/tuya-control/devices/plugs/sw2.py b/tuya-control/devices/plugs/sw2.py new file mode 100644 index 0000000..2ae240c --- /dev/null +++ b/tuya-control/devices/plugs/sw2.py @@ -0,0 +1,92 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +""" +Script pour basculer l'état de SW2 (allumé/éteint) +À utiliser avec StreamDeck +""" + +import tinytuya +import json + +# Informations Cloud Tuya +API_REGION = "eu" +API_KEY = "fdjdjurkm34yyjp77c7d" +API_SECRET = "3e71807fb0c6406792bdf4f07f98e577" + +# Informations de l'appareil +DEVICE_ID = "bf06f9007abca55618iiwv" # ID de SW2 +DEVICE_NAME = "SW2" # Nom de l'appareil +SWITCH_CODE = "switch_1" # Code pour l'interrupteur + +def main(): + cloud = tinytuya.Cloud( + apiRegion=API_REGION, + apiKey=API_KEY, + apiSecret=API_SECRET + ) + + # Activer le mode debug dans tinytuya + tinytuya.set_debug(True) + + # Lire l'état actuel + print(f"🔍 Récupération du statut pour l'appareil {DEVICE_ID}...") + status = cloud.getstatus(DEVICE_ID) + + if not status: + print(f"❌ Aucune réponse de l'API Cloud pour {DEVICE_NAME}") + return + + try: + print(f"📊 Réponse brute: {status}") + except Exception as e: + print(f"⚠️ Erreur lors de l'affichage de la réponse: {e}") + + is_on = None + + # Analyse du statut + if isinstance(status, dict) and "result" in status: + result = status["result"] + if isinstance(result, list): + for item in result: + if isinstance(item, dict) and item.get("code") == SWITCH_CODE: + is_on = item.get("value") + break + elif isinstance(result, dict) and "status" in result: + for item in result["status"]: + if item.get("code") == SWITCH_CODE: + is_on = item.get("value") + break + elif isinstance(status, list): + for item in status: + if isinstance(item, dict) and item.get("code") == SWITCH_CODE: + is_on = item.get("value") + break + + if is_on is None: + print(f"❌ Impossible de trouver le statut '{SWITCH_CODE}' pour {DEVICE_NAME}") + return + + print(f"ℹ️ État actuel de {DEVICE_NAME}: {'ALLUMÉ' if is_on else 'ÉTEINT'}") + + # Basculer l'état + new_value = not is_on + print(f"ℹ️ Nouvel état à appliquer: {'ALLUMÉ' if new_value else 'ÉTEINT'}") + + # Envoyer la commande + commands = { + "commands": [ + {"code": SWITCH_CODE, "value": new_value} + ] + } + print(f"📤 Envoi de la commande: {json.dumps(commands, indent=2)}") + response = cloud.sendcommand(DEVICE_ID, commands) + print(f"📥 Réponse reçue: {json.dumps(response, indent=2) if response else 'Aucune réponse'}") + + if response is not None and response.get("success"): + print(f"✅ {DEVICE_NAME} est maintenant {'allumé' if new_value else 'éteint'}") + else: + error_msg = response.get("msg", "Erreur inconnue") if response else "Pas de réponse" + print(f"❌ Échec pour {DEVICE_NAME}: {error_msg}") + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/tuya-control/devices/shutters/volet_cuisine_toggle.py b/tuya-control/devices/shutters/volet_cuisine_toggle.py new file mode 100644 index 0000000..7e298b8 --- /dev/null +++ b/tuya-control/devices/shutters/volet_cuisine_toggle.py @@ -0,0 +1,48 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +""" +Script pour contrôler le volet de la cuisine (ouvrir/fermer/arrêter) +À utiliser avec StreamDeck +""" + +import sys +import os + +# Ajouter le répertoire parent au path pour les imports +sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))) +from common.utils import connect_device, control_shutter, report_for_streamdeck + +# ID et nom de l'appareil +DEVICE_ID = "bf81367b1f5c267af7yyht" +DEVICE_NAME = "volet cuisine" + +def main(): + """Fonction principale pour contrôler le volet""" + # Connexion à l'appareil + device = connect_device(DEVICE_ID) + if not device: + report_for_streamdeck(False, DEVICE_NAME) + return + + # Obtenir l'état actuel + status = device.status() + + # Si le volet est arrêté, l'ouvrir + # Si le volet est en mouvement, l'arrêter + current_state = status.get('dps', {}).get('1', 'stop') + + if current_state == "stop": + # Si arrêté, on ouvre + action = "up" # Utilise "forward" en interne + else: + # Si en mouvement, on arrête + action = "stop" + + # Exécuter l'action et obtenir le résultat + result = control_shutter(device, action) + + # Rapport pour StreamDeck + report_for_streamdeck(result, DEVICE_NAME, action) + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/tuya-control/devices/shutters/volet_delia_toggle.py b/tuya-control/devices/shutters/volet_delia_toggle.py new file mode 100644 index 0000000..0291cd9 --- /dev/null +++ b/tuya-control/devices/shutters/volet_delia_toggle.py @@ -0,0 +1,48 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +""" +Script pour contrôler le volet Delia (ouvrir/fermer/arrêter) +À utiliser avec StreamDeck +""" + +import sys +import os + +# Ajouter le répertoire parent au path pour les imports +sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))) +from common.utils import connect_device, control_shutter, report_for_streamdeck + +# ID et nom de l'appareil +DEVICE_ID = "bf5b5aa8312d543135xxak" +DEVICE_NAME = "volet delia" + +def main(): + """Fonction principale pour contrôler le volet""" + # Connexion à l'appareil + device = connect_device(DEVICE_ID) + if not device: + report_for_streamdeck(False, DEVICE_NAME) + return + + # Obtenir l'état actuel + status = device.status() + + # Si le volet est arrêté, l'ouvrir + # Si le volet est en mouvement, l'arrêter + current_state = status.get('dps', {}).get('1', 'stop') + + if current_state == "stop": + # Si arrêté, on ouvre + action = "up" # Utilise "forward" en interne + else: + # Si en mouvement, on arrête + action = "stop" + + # Exécuter l'action et obtenir le résultat + result = control_shutter(device, action) + + # Rapport pour StreamDeck + report_for_streamdeck(result, DEVICE_NAME, action) + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/tuya-control/devices/shutters/volet_dino_close_toggle.py b/tuya-control/devices/shutters/volet_dino_close_toggle.py new file mode 100644 index 0000000..a57d0e9 --- /dev/null +++ b/tuya-control/devices/shutters/volet_dino_close_toggle.py @@ -0,0 +1,77 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +""" +Script pour fermer le volet Dino +À utiliser avec StreamDeck +""" + +import tinytuya +import json + +# Informations Cloud Tuya +API_REGION = "eu" +API_KEY = "fdjdjurkm34yyjp77c7d" +API_SECRET = "3e71807fb0c6406792bdf4f07f98e577" + +# ID et nom de l'appareil +DEVICE_ID = "bff082745aedf9fc1aqy3e" # ID du volet Dino +DEVICE_NAME = "Volet dino" # Nom de l'appareil + +# Code des commandes du volet +SWITCH_CODE = "control" # Pour les volets Tuya, le code est souvent "control" + +def main(): + """Fonction principale pour fermer le volet via Cloud""" + # Connexion au Cloud + cloud = tinytuya.Cloud( + apiRegion=API_REGION, + apiKey=API_KEY, + apiSecret=API_SECRET + ) + + tinytuya.set_debug(True) # Pour debug si besoin + + # Lire l'état actuel du volet + print(f"🔍 Récupération du statut pour l'appareil {DEVICE_ID}...") + status = cloud.getstatus(DEVICE_ID) + + if not status: + print(f"❌ Aucune réponse de l'API Cloud pour {DEVICE_NAME}") + return + + try: + print(f"📊 Réponse brute: {json.dumps(status, indent=2)}") + except Exception as e: + print(f"⚠️ Erreur lors de l'affichage de la réponse: {e}") + + # Vérification de l'état actuel + current_state = None + if isinstance(status, dict) and "result" in status: + result = status["result"] + for item in result: + if item.get("code") == SWITCH_CODE: + current_state = item.get("value") + break + + print(f"ℹ️ État actuel du volet: {current_state}") + + # Envoyer la commande pour fermer le volet + commands = { + "commands": [ + {"code": SWITCH_CODE, "value": "close"}, # Essayez "close" pour fermer + # Vous pouvez également essayer "fermer" si cela est supporté + ] + } + + print(f"📤 Envoi de la commande: {json.dumps(commands, indent=2)}") + response = cloud.sendcommand(DEVICE_ID, commands) + print(f"📥 Réponse reçue: {json.dumps(response, indent=2) if response else 'Aucune réponse'}") + + if response is not None and response.get("success"): + print(f"✅ {DEVICE_NAME} est maintenant fermé") + else: + error_msg = response.get("msg", "Erreur inconnue") if response else "Pas de réponse" + print(f"❌ Échec pour {DEVICE_NAME}: {error_msg}") + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/tuya-control/devices/shutters/volet_dino_open_toggle.py b/tuya-control/devices/shutters/volet_dino_open_toggle.py new file mode 100644 index 0000000..319bcd7 --- /dev/null +++ b/tuya-control/devices/shutters/volet_dino_open_toggle.py @@ -0,0 +1,66 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +""" +Script pour ouvrir le volet Dino +À utiliser avec StreamDeck +""" + +import tinytuya +import json + +# Informations Cloud Tuya +API_REGION = "eu" +API_KEY = "fdjdjurkm34yyjp77c7d" +API_SECRET = "3e71807fb0c6406792bdf4f07f98e577" + +# ID et nom de l'appareil +DEVICE_ID = "bff082745aedf9fc1aqy3e" # ID du volet Dino +DEVICE_NAME = "Volet dino" # Nom de l'appareil + +# Code des commandes du volet +SWITCH_CODE = "control" # Pour les volets Tuya, le code est souvent "control" + +def main(): + """Fonction principale pour ouvrir le volet via Cloud""" + # Connexion au Cloud + cloud = tinytuya.Cloud( + apiRegion=API_REGION, + apiKey=API_KEY, + apiSecret=API_SECRET + ) + + tinytuya.set_debug(True) # Pour debug si besoin + + # Lire l'état actuel du volet + print(f"🔍 Récupération du statut pour l'appareil {DEVICE_ID}...") + status = cloud.getstatus(DEVICE_ID) + + if not status: + print(f"❌ Aucune réponse de l'API Cloud pour {DEVICE_NAME}") + return + + try: + print(f"📊 Réponse brute: {json.dumps(status, indent=2)}") + except Exception as e: + print(f"⚠️ Erreur lors de l'affichage de la réponse: {e}") + + # Envoyer la commande pour ouvrir le volet + commands = { + "commands": [ + {"code": SWITCH_CODE, "value": "open"}, # Utiliser "open" pour ouvrir + # Vous pouvez également essayer "ouvrir" si cela est supporté + ] + } + + print(f"📤 Envoi de la commande: {json.dumps(commands, indent=2)}") + response = cloud.sendcommand(DEVICE_ID, commands) + print(f"📥 Réponse reçue: {json.dumps(response, indent=2) if response else 'Aucune réponse'}") + + if response is not None and response.get("success"): + print(f"✅ {DEVICE_NAME} est maintenant ouvert") + else: + error_msg = response.get("msg", "Erreur inconnue") if response else "Pas de réponse" + print(f"❌ Échec pour {DEVICE_NAME}: {error_msg}") + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/tuya-control/devices/shutters/volet_jeanluc_toggle.py b/tuya-control/devices/shutters/volet_jeanluc_toggle.py new file mode 100644 index 0000000..f39c660 --- /dev/null +++ b/tuya-control/devices/shutters/volet_jeanluc_toggle.py @@ -0,0 +1,48 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +""" +Script pour contrôler le volet Jean Luc (ouvrir/fermer/arrêter) +À utiliser avec StreamDeck +""" + +import sys +import os + +# Ajouter le répertoire parent au path pour les imports +sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))) +from common.utils import connect_device, control_shutter, report_for_streamdeck + +# ID et nom de l'appareil +DEVICE_ID = "bf0e197f469e9f2670fb27" +DEVICE_NAME = "volet jean luc" + +def main(): + """Fonction principale pour contrôler le volet""" + # Connexion à l'appareil + device = connect_device(DEVICE_ID) + if not device: + report_for_streamdeck(False, DEVICE_NAME) + return + + # Obtenir l'état actuel + status = device.status() + + # Si le volet est arrêté, l'ouvrir + # Si le volet est en mouvement, l'arrêter + current_state = status.get('dps', {}).get('1', 'stop') + + if current_state == "stop": + # Si arrêté, on ouvre + action = "up" # Utilise "forward" en interne + else: + # Si en mouvement, on arrête + action = "stop" + + # Exécuter l'action et obtenir le résultat + result = control_shutter(device, action) + + # Rapport pour StreamDeck + report_for_streamdeck(result, DEVICE_NAME, action) + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/tuya-control/devices/shutters/volet_salon_toggle.py b/tuya-control/devices/shutters/volet_salon_toggle.py new file mode 100644 index 0000000..102b65d --- /dev/null +++ b/tuya-control/devices/shutters/volet_salon_toggle.py @@ -0,0 +1,48 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +""" +Script pour contrôler le volet du salon (ouvrir/fermer/arrêter) +À utiliser avec StreamDeck +""" + +import sys +import os + +# Ajouter le répertoire parent au path pour les imports +sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))) +from common.utils import connect_device, control_shutter, report_for_streamdeck + +# ID et nom de l'appareil +DEVICE_ID = "bfc74a089fe0a9a50d2eeg" +DEVICE_NAME = "volet salon" + +def main(): + """Fonction principale pour contrôler le volet du salon""" + # Connexion à l'appareil + device = connect_device(DEVICE_ID) + if not device: + report_for_streamdeck(False, DEVICE_NAME) + return + + # Obtenir l'état actuel + status = device.status() + + # Si le volet est arrêté, l'ouvrir + # Si le volet est en mouvement, l'arrêter + current_state = status.get('dps', {}).get('1', 'stop') + + if current_state == "stop": + # Si arrêté, on ouvre + action = "up" # Utilise "forward" en interne + else: + # Si en mouvement, on arrête + action = "stop" + + # Exécuter l'action et obtenir le résultat + result = control_shutter(device, action) + + # Rapport pour StreamDeck + report_for_streamdeck(result, DEVICE_NAME, action) + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/tuya-control/scripts/scan_devices.py b/tuya-control/scripts/scan_devices.py new file mode 100644 index 0000000..ba345d5 --- /dev/null +++ b/tuya-control/scripts/scan_devices.py @@ -0,0 +1,62 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +""" +Script pour scanner et afficher tous les appareils Tuya disponibles sur le réseau +Utile pour diagnostiquer les problèmes de connexion +""" + +import sys +import os +import json +import time + +# Ajouter le répertoire parent au path pour les imports +sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) +from common.utils import scan_for_devices + +def main(): + """Fonction principale pour scanner et afficher les appareils""" + print("Recherche des appareils Tuya sur le réseau...") + print("Veuillez patienter, cela peut prendre jusqu'à 30 secondes...") + + # Réaliser un scan du réseau + devices = scan_for_devices() + + if not devices: + print("Aucun appareil trouvé sur le réseau.") + return + + print(f"\nAppareils trouvés: {len(devices)}\n") + + # Afficher les informations détaillées pour chaque appareil + for device in devices: + print("="*50) + print(f"Nom : {device.get('name', 'Inconnu')}") + print(f"ID : {device.get('id', 'N/A')}") + print(f"IP : {device.get('ip', 'N/A')}") + print(f"Produit : {device.get('productKey', 'N/A')}") + print(f"Version : {device.get('ver', 'N/A')}") + + # Afficher l'état actuel si disponible + if 'dps' in device: + print("\nÉtat actuel:") + try: + # Formater les DPS pour une meilleure lisibilité + dps_formatted = json.dumps(device['dps'], indent=2, ensure_ascii=False) + print(dps_formatted) + except: + print(device['dps']) + + print("="*50 + "\n") + + # Sauvegarder les résultats dans un fichier snapshot + timestamp = int(time.time()) + snapshot_file = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), f"snapshot_{timestamp}.json") + + with open(snapshot_file, 'w', encoding='utf-8') as f: + json.dump({"timestamp": time.time(), "devices": devices}, f, indent=4, ensure_ascii=False) + + print(f"Résultats sauvegardés dans {snapshot_file}") + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/tuya-control/scripts/status_devices.py b/tuya-control/scripts/status_devices.py new file mode 100644 index 0000000..dc236df --- /dev/null +++ b/tuya-control/scripts/status_devices.py @@ -0,0 +1,72 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +""" +Script pour afficher le statut de tous les appareils Tuya connus +Utile pour avoir une vue d'ensemble rapide +""" + +import sys +import os +import json + +# Ajouter le répertoire parent au path pour les imports +sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) +from common.utils import connect_device, get_device_status_text + +def main(): + """Fonction principale pour afficher le statut des appareils""" + print("Récupération du statut des appareils Tuya...\n") + + # Charger la liste des appareils depuis devices.json + base_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + devices_file = os.path.join(base_dir, 'devices.json') + + try: + with open(devices_file, 'r', encoding='utf-8') as f: + devices = json.load(f) + except Exception as e: + print(f"Erreur lors du chargement du fichier devices.json: {e}") + return + + # Catégoriser les appareils + categories = { + "lights": [], # Lumières + "shutters": [], # Volets + "plugs": [], # Prises + "cameras": [], # Caméras + "others": [] # Autres appareils + } + + # Trier les appareils par catégorie + for device in devices: + device_id = device.get('id') + device_name = device.get('name', 'Appareil inconnu') + product_key = device.get('product_id', '') + + # Classifier selon le type + if product_key in ['key8u54q9dtru5jw', 'keynremrcjf97twe']: + categories["lights"].append((device_id, device_name)) + elif product_key in ['4pqpkp1rskkjtxay']: + categories["shutters"].append((device_id, device_name)) + elif product_key in ['uqehhcrmk5depvtl']: + categories["plugs"].append((device_id, device_name)) + elif product_key in ['biw8urjw2dvss3ur', 'pg7xibyidyvt5pia']: + categories["cameras"].append((device_id, device_name)) + else: + categories["others"].append((device_id, device_name)) + + # Afficher le statut par catégorie + for category, cat_devices in categories.items(): + if not cat_devices: + continue + + print(f"\n=== {category.upper()} ===") + + for device_id, device_name in cat_devices: + status_text = get_device_status_text(device_id) + print(f" - {status_text}") + + print("\nTerminé!") + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/tuya-raw.json b/tuya-raw.json new file mode 100644 index 0000000..b4629f7 --- /dev/null +++ b/tuya-raw.json @@ -0,0 +1,5727 @@ +{ + "result": [ + { + "active_time": 1734360340, + "biz_type": 0, + "category": "sp", + "create_time": 1734360340, + "icon": "smart/icon/ay1552976333775cUOyq/2ceb02325d96e4a34dfe4c5236e57116.png", + "id": "bfbdfe098b6b97536c3vpn", + "ip": "176.165.222.155", + "lat": "42.7646", + "local_key": "6L^C6sA}sOJi;y$C", + "lon": "2.8775", + "model": "", + "name": "Solar Intelligent PTZ Camera", + "online": true, + "owner_id": "189260016", + "product_id": "pg7xibyidyvt5pia", + "product_name": "Solar Intelligent PTZ Camera", + "status": [ + { + "code": "basic_flip", + "value": true + }, + { + "code": "basic_osd", + "value": true + }, + { + "code": "motion_sensitivity", + "value": "1" + }, + { + "code": "basic_wdr", + "value": false + }, + { + "code": "basic_nightvision", + "value": "0" + }, + { + "code": "sd_storge", + "value": "122060800|32768|122028032" + }, + { + "code": "sd_status", + "value": 1 + }, + { + "code": "sd_format", + "value": true + }, + { + "code": "motion_record", + "value": false + }, + { + "code": "movement_detect_pic", + "value": "eyJidWNrZXQiOiJ0eS1ldS1zdG9yYWdlMzAtcGljIiwiZmlsZXMiOltbIi8yOTA4NTctMTg5MjYwMDE2LWFvbmkxNmMwZDZlYzk3ZTM1ZTA2L2RldGVjdC8xNzM3MDMyMDc0LmpwZWc/cGFyYW09THRXTkcybHVTQ01qazZoYlBqbW9oVlpTczJRZnJMY1plNWhkNEpBUjFYOD0iLCIiXV0sInYiOiIzLjAifQ==" + }, + { + "code": "ptz_stop", + "value": true + }, + { + "code": "sd_format_state", + "value": 0 + }, + { + "code": "ptz_control", + "value": "1" + }, + { + "code": "battery_report_cap", + "value": 1 + }, + { + "code": "ptz_calibration", + "value": false + }, + { + "code": "motion_switch", + "value": false + }, + { + "code": "doorbell_active", + "value": "" + }, + { + "code": "wireless_electricity", + "value": 45 + }, + { + "code": "wireless_powermode", + "value": "0" + }, + { + "code": "wireless_lowpower", + "value": 10 + }, + { + "code": "wireless_awake", + "value": false + }, + { + "code": "record_switch", + "value": false + }, + { + "code": "record_mode", + "value": "1" + }, + { + "code": "pir_switch", + "value": "0" + }, + { + "code": "doorbell_pic", + "value": "" + }, + { + "code": "basic_device_volume", + "value": 8 + }, + { + "code": "motion_tracking", + "value": false + }, + { + "code": "device_restart", + "value": false + }, + { + "code": "humanoid_filter", + "value": false + }, + { + "code": "cruise_switch", + "value": false + }, + { + "code": "cruise_mode", + "value": "0" + }, + { + "code": "alarm_message", + "value": "" + }, + { + "code": "ipc_work_mode", + "value": "0" + }, + { + "code": "initiative_message", + "value": "" + } + ], + "sub": false, + "time_zone": "+01:00", + "uid": "eu1712934899766oTQEN", + "update_time": 1745605657, + "uuid": "aoni16c0d6ec97e35e06", + "mapping": { + "103": { + "code": "basic_flip", + "type": "Boolean", + "values": {} + }, + "104": { + "code": "basic_osd", + "type": "Boolean", + "values": {} + }, + "106": { + "code": "motion_sensitivity", + "type": "Enum", + "values": { + "range": [ + "0", + "1", + "2" + ] + } + }, + "107": { + "code": "basic_wdr", + "type": "Boolean", + "values": {} + }, + "108": { + "code": "basic_nightvision", + "type": "Enum", + "values": { + "range": [ + "0", + "1", + "2" + ] + } + }, + "109": { + "code": "sd_storge", + "type": "String", + "values": "{\"maxlen\":255}" + }, + "110": { + "code": "sd_status", + "type": "Integer", + "values": { + "min": 1, + "max": 5, + "scale": 0, + "step": 1 + } + }, + "111": { + "code": "sd_format", + "type": "Boolean", + "values": {} + }, + "113": { + "code": "motion_record", + "type": "Boolean", + "values": {} + }, + "115": { + "code": "movement_detect_pic", + "type": "Raw", + "values": {} + }, + "116": { + "code": "ptz_stop", + "type": "Boolean", + "values": {} + }, + "117": { + "code": "sd_format_state", + "type": "Integer", + "values": { + "min": -20000, + "max": 200000, + "scale": 0, + "step": 1 + } + }, + "119": { + "code": "ptz_control", + "type": "Enum", + "values": { + "range": [ + "0", + "1", + "2", + "3", + "4", + "5", + "6", + "7" + ] + } + }, + "126": { + "code": "battery_report_cap", + "type": "Integer", + "values": { + "min": 0, + "max": 15, + "scale": 0, + "step": 1 + } + }, + "132": { + "code": "ptz_calibration", + "type": "Boolean", + "values": {} + }, + "134": { + "code": "motion_switch", + "type": "Boolean", + "values": {} + }, + "136": { + "code": "doorbell_active", + "type": "String", + "values": "{\"maxlen\":255}" + }, + "145": { + "code": "wireless_electricity", + "type": "Integer", + "values": { + "unit": "%", + "min": 0, + "max": 100, + "scale": 0, + "step": 1 + } + }, + "146": { + "code": "wireless_powermode", + "type": "Enum", + "values": { + "range": [ + "0", + "1" + ] + } + }, + "147": { + "code": "wireless_lowpower", + "type": "Integer", + "values": { + "min": 10, + "max": 50, + "scale": 0, + "step": 1 + } + }, + "149": { + "code": "wireless_awake", + "type": "Boolean", + "values": {} + }, + "150": { + "code": "record_switch", + "type": "Boolean", + "values": {} + }, + "151": { + "code": "record_mode", + "type": "Enum", + "values": { + "range": [ + "1", + "2" + ] + } + }, + "152": { + "code": "pir_switch", + "type": "Enum", + "values": { + "range": [ + "0", + "1", + "2", + "3", + "4" + ] + } + }, + "154": { + "code": "doorbell_pic", + "type": "Raw", + "values": {} + }, + "160": { + "code": "basic_device_volume", + "type": "Integer", + "values": { + "unit": "", + "min": 1, + "max": 10, + "scale": 0, + "step": 1 + } + }, + "161": { + "code": "motion_tracking", + "type": "Boolean", + "values": {} + }, + "162": { + "code": "device_restart", + "type": "Boolean", + "values": {} + }, + "170": { + "code": "humanoid_filter", + "type": "Boolean", + "values": {} + }, + "174": { + "code": "cruise_switch", + "type": "Boolean", + "values": {} + }, + "175": { + "code": "cruise_mode", + "type": "Enum", + "values": { + "range": [ + "0", + "1" + ] + } + }, + "185": { + "code": "alarm_message", + "type": "String", + "values": "{}" + }, + "189": { + "code": "ipc_work_mode", + "type": "Enum", + "values": { + "range": [ + "0", + "1" + ] + } + }, + "212": { + "code": "initiative_message", + "type": "Raw", + "values": {} + } + } + }, + { + "active_time": 1718797593, + "biz_type": 0, + "category": "pir", + "create_time": 1717844000, + "icon": "smart/icon/ay1525749833414yotNt/977689dc3cf45a12a3b33f1d4cb9ff36.png", + "id": "bf9684f9ed52e74d0a9efm", + "ip": "176.165.222.155", + "lat": "42.76", + "local_key": "n@y:4!#PatodN8cK", + "lon": "2.88", + "model": "", + "name": "d\u00e9tecteur chambre d\u00e9lia", + "online": true, + "owner_id": "189260016", + "product_id": "rjzon9kyxpoeksj3", + "product_name": "Motion Sensor", + "status": [ + { + "code": "pir", + "value": "none" + }, + { + "code": "battery_state", + "value": "middle" + } + ], + "sub": false, + "time_zone": "+02:00", + "uid": "eu1712934899766oTQEN", + "update_time": 1745605039, + "uuid": "019763a208b013f0", + "mapping": { + "1": { + "code": "pir", + "type": "Enum", + "values": { + "range": [ + "pir", + "none" + ] + } + }, + "3": { + "code": "battery_state", + "type": "Enum", + "values": { + "range": [ + "low", + "middle", + "high" + ] + } + } + } + }, + { + "active_time": 1717845683, + "biz_type": 0, + "category": "pir", + "create_time": 1717845683, + "icon": "smart/icon/ay1525749833414yotNt/977689dc3cf45a12a3b33f1d4cb9ff36.png", + "id": "bf7407c4b40fdf460bwa6a", + "ip": "176.165.222.155", + "lat": "42.7646", + "local_key": "vziN+(KEthkR1)Dh", + "lon": "2.8775", + "model": "", + "name": "D\u00e9tecteur cuisine", + "online": true, + "owner_id": "189260016", + "product_id": "rjzon9kyxpoeksj3", + "product_name": "Motion Sensor", + "status": [ + { + "code": "pir", + "value": "none" + }, + { + "code": "battery_state", + "value": "middle" + } + ], + "sub": false, + "time_zone": "+02:00", + "uid": "eu1712934899766oTQEN", + "update_time": 1745605018, + "uuid": "9bd2334f02c94371", + "mapping": { + "1": { + "code": "pir", + "type": "Enum", + "values": { + "range": [ + "pir", + "none" + ] + } + }, + "3": { + "code": "battery_state", + "type": "Enum", + "values": { + "range": [ + "low", + "middle", + "high" + ] + } + } + } + }, + { + "active_time": 1715872462, + "biz_type": 0, + "category": "ywbj", + "create_time": 1715872462, + "icon": "smart/icon/ay1537847617560vAgbw/25f8dac62666b48bcf179530abb05422.jpg", + "id": "bf8fdf6eb4c85d4deci2c3", + "ip": "176.165.222.155", + "lat": "42.7600", + "local_key": "j$RUk3B2b;cg_/>l", + "lon": "2.8800", + "model": "YG400A-CBU", + "name": "Detecteur fum\u00e9e chambre", + "online": true, + "owner_id": "189260016", + "product_id": "jypukhecbhaw1c47", + "product_name": "Smoke detector", + "status": [ + { + "code": "smoke_sensor_status", + "value": "normal" + }, + { + "code": "temper_alarm", + "value": false + }, + { + "code": "battery_percentage", + "value": 46 + } + ], + "sub": false, + "time_zone": "+02:00", + "uid": "eu1712934899766oTQEN", + "update_time": 1745604289, + "uuid": "3953ead345c08d00", + "mapping": { + "1": { + "code": "smoke_sensor_status", + "type": "Enum", + "values": { + "range": [ + "alarm", + "normal" + ] + } + }, + "4": { + "code": "temper_alarm", + "type": "Boolean", + "values": {} + }, + "15": { + "code": "battery_percentage", + "type": "Integer", + "values": { + "unit": "%", + "min": 0, + "max": 100, + "scale": 0, + "step": 1 + } + } + } + }, + { + "active_time": 1715080717, + "biz_type": 0, + "category": "dj", + "create_time": 1715080717, + "icon": "smart/icon/ay1465021689173TLGxd/450969da3811ab0956e9fa94dc397504.jpg", + "id": "bf5516c52504a7a8dcof7r", + "ip": "176.165.222.155", + "lat": "42.7646", + "local_key": "|iyOE'];IEiaQ7}l", + "lon": "2.8775", + "model": "SYB09LPH", + "name": "light 2", + "online": true, + "owner_id": "189260016", + "product_id": "1uq6temf0dfdxshu", + "product_name": "", + "status": [ + { + "code": "switch_led", + "value": false + }, + { + "code": "work_mode", + "value": "white" + }, + { + "code": "bright_value_v2", + "value": 100 + }, + { + "code": "temp_value_v2", + "value": 200 + }, + { + "code": "colour_data_v2", + "value": "{\"h\":60,\"s\":1000,\"v\":1000}" + }, + { + "code": "scene_data_v2", + "value": "{\"scene_num\":8,\"scene_units\":[{\"bright\":0,\"h\":0,\"s\":1000,\"temperature\":0,\"unit_change_mode\":\"gradient\",\"unit_gradient_duration\":70,\"unit_switch_duration\":70,\"v\":1000},{\"bright\":0,\"h\":120,\"s\":1000,\"temperature\":0,\"unit_change_mode\":\"gradient\",\"unit_gradient_duration\":70,\"unit_switch_duration\":70,\"v\":1000},{\"bright\":0,\"h\":240,\"s\":1000,\"temperature\":0,\"unit_change_mode\":\"gradient\",\"unit_gradient_duration\":70,\"unit_switch_duration\":70,\"v\":1000},{\"bright\":0,\"h\":61,\"s\":1000,\"temperature\":0,\"unit_change_mode\":\"gradient\",\"unit_gradient_duration\":70,\"unit_switch_duration\":70,\"v\":1000},{\"bright\":0,\"h\":174,\"s\":1000,\"temperature\":0,\"unit_change_mode\":\"gradient\",\"unit_gradient_duration\":70,\"unit_switch_duration\":70,\"v\":1000},{\"bright\":0,\"h\":275,\"s\":1000,\"temperature\":0,\"unit_change_mode\":\"gradient\",\"unit_gradient_duration\":70,\"unit_switch_duration\":70,\"v\":1000}]}" + }, + { + "code": "countdown_1", + "value": 0 + }, + { + "code": "music_data", + "value": "" + }, + { + "code": "control_data", + "value": "" + }, + { + "code": "rhythm_mode", + "value": "AAAAAAA=" + }, + { + "code": "sleep_mode", + "value": "AAA=" + }, + { + "code": "wakeup_mode", + "value": "AAA=" + }, + { + "code": "power_memory", + "value": "AAEAAAAAAAAAZAH0" + }, + { + "code": "cycle_timing", + "value": "AAAA" + }, + { + "code": "random_timing", + "value": "AAAA" + } + ], + "sub": false, + "time_zone": "+02:00", + "uid": "eu1712934899766oTQEN", + "update_time": 1745601352, + "uuid": "ea51f80ebfc154f7", + "mapping": { + "20": { + "code": "switch_led", + "type": "Boolean", + "values": {} + }, + "21": { + "code": "work_mode", + "type": "Enum", + "values": { + "range": [ + "white", + "colour", + "scene", + "music" + ] + } + }, + "22": { + "code": "bright_value_v2", + "type": "Integer", + "values": { + "min": 10, + "max": 1000, + "scale": 0, + "step": 1 + } + }, + "23": { + "code": "temp_value_v2", + "type": "Integer", + "values": { + "min": 0, + "max": 1000, + "scale": 0, + "step": 1 + } + }, + "24": { + "code": "colour_data_v2", + "type": "Json", + "raw_values": "{\"h\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1},\"v\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}}", + "values": { + "h": { + "min": 0, + "scale": 0, + "unit": "", + "max": 360, + "step": 1 + }, + "s": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + }, + "v": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + } + } + }, + "25": { + "code": "scene_data_v2", + "type": "Json", + "raw_values": "{\"scene_num\":{\"min\":1,\"scale\":0,\"max\":8,\"step\":1},\"scene_units\": {\"unit_change_mode\":{\"range\":[\"static\",\"jump\",\"gradient\"]},\"unit_switch_duration\":{\"min\":0,\"scale\":0,\"max\":100,\"step\":1},\"unit_gradient_duration\":{\"min\":0,\"scale\":0,\"max\":100,\"step\":1},\"bright\":{\"min\":0,\"scale\":0,\"max\":1000,\"step\":1},\"temperature\":{\"min\":0,\"scale\":0,\"max\":1000,\"step\":1},\"h\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1},\"v\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}}}", + "values": { + "scene_num": { + "min": 1, + "scale": 0, + "max": 8, + "step": 1 + }, + "scene_units": { + "unit_change_mode": { + "range": [ + "static", + "jump", + "gradient" + ] + }, + "unit_switch_duration": { + "min": 0, + "scale": 0, + "max": 100, + "step": 1 + }, + "unit_gradient_duration": { + "min": 0, + "scale": 0, + "max": 100, + "step": 1 + }, + "bright": { + "min": 0, + "scale": 0, + "max": 1000, + "step": 1 + }, + "temperature": { + "min": 0, + "scale": 0, + "max": 1000, + "step": 1 + }, + "h": { + "min": 0, + "scale": 0, + "unit": "", + "max": 360, + "step": 1 + }, + "s": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + }, + "v": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + } + } + } + }, + "26": { + "code": "countdown_1", + "type": "Integer", + "values": { + "unit": "s", + "min": 0, + "max": 86400, + "scale": 0, + "step": 1 + } + }, + "27": { + "code": "music_data", + "type": "Json", + "raw_values": "{\"change_mode\":{\"range\":[\"direct\",\"gradient\"]}, \"bright\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}, \"temperature\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}, \"h\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1},\"v\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1}}", + "values": { + "change_mode": { + "range": [ + "direct", + "gradient" + ] + }, + "bright": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + }, + "temperature": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + }, + "h": { + "min": 0, + "scale": 0, + "unit": "", + "max": 360, + "step": 1 + }, + "s": { + "min": 0, + "scale": 0, + "unit": "", + "max": 255, + "step": 1 + }, + "v": { + "min": 0, + "scale": 0, + "unit": "", + "max": 255, + "step": 1 + } + } + }, + "28": { + "code": "control_data", + "type": "Json", + "raw_values": "{\"change_mode\":{\"range\":[\"direct\",\"gradient\"]}, \"bright\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}, \"temperature\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}, \"h\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1},\"v\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1}}", + "values": { + "change_mode": { + "range": [ + "direct", + "gradient" + ] + }, + "bright": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + }, + "temperature": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + }, + "h": { + "min": 0, + "scale": 0, + "unit": "", + "max": 360, + "step": 1 + }, + "s": { + "min": 0, + "scale": 0, + "unit": "", + "max": 255, + "step": 1 + }, + "v": { + "min": 0, + "scale": 0, + "unit": "", + "max": 255, + "step": 1 + } + } + }, + "30": { + "code": "rhythm_mode", + "type": "Raw", + "values": { + "maxlen": "255" + } + }, + "31": { + "code": "sleep_mode", + "type": "Raw", + "values": { + "maxlen": "255" + } + }, + "32": { + "code": "wakeup_mode", + "type": "Raw", + "values": { + "maxlen": "255" + } + }, + "33": { + "code": "power_memory", + "type": "Raw", + "values": {} + }, + "209": { + "code": "cycle_timing", + "type": "Raw", + "values": {} + }, + "210": { + "code": "random_timing", + "type": "Raw", + "values": {} + } + } + }, + { + "active_time": 1715080702, + "biz_type": 0, + "category": "dj", + "create_time": 1715080702, + "icon": "smart/icon/ay1465021689173TLGxd/450969da3811ab0956e9fa94dc397504.jpg", + "id": "bfdc2f8e4effa0d826gnxg", + "ip": "176.165.222.155", + "lat": "42.7646", + "local_key": "a_8Bhm|P1L;{wCHL", + "lon": "2.8775", + "model": "SYB09LPH", + "name": "Light 1", + "online": true, + "owner_id": "189260016", + "product_id": "1uq6temf0dfdxshu", + "product_name": "", + "status": [ + { + "code": "switch_led", + "value": false + }, + { + "code": "work_mode", + "value": "white" + }, + { + "code": "bright_value_v2", + "value": 100 + }, + { + "code": "temp_value_v2", + "value": 200 + }, + { + "code": "colour_data_v2", + "value": "{\"h\":60,\"s\":1000,\"v\":1000}" + }, + { + "code": "scene_data_v2", + "value": "{\"scene_num\":8,\"scene_units\":[{\"bright\":0,\"h\":0,\"s\":1000,\"temperature\":0,\"unit_change_mode\":\"gradient\",\"unit_gradient_duration\":70,\"unit_switch_duration\":70,\"v\":1000},{\"bright\":0,\"h\":120,\"s\":1000,\"temperature\":0,\"unit_change_mode\":\"gradient\",\"unit_gradient_duration\":70,\"unit_switch_duration\":70,\"v\":1000},{\"bright\":0,\"h\":240,\"s\":1000,\"temperature\":0,\"unit_change_mode\":\"gradient\",\"unit_gradient_duration\":70,\"unit_switch_duration\":70,\"v\":1000},{\"bright\":0,\"h\":61,\"s\":1000,\"temperature\":0,\"unit_change_mode\":\"gradient\",\"unit_gradient_duration\":70,\"unit_switch_duration\":70,\"v\":1000},{\"bright\":0,\"h\":174,\"s\":1000,\"temperature\":0,\"unit_change_mode\":\"gradient\",\"unit_gradient_duration\":70,\"unit_switch_duration\":70,\"v\":1000},{\"bright\":0,\"h\":275,\"s\":1000,\"temperature\":0,\"unit_change_mode\":\"gradient\",\"unit_gradient_duration\":70,\"unit_switch_duration\":70,\"v\":1000}]}" + }, + { + "code": "countdown_1", + "value": 0 + }, + { + "code": "music_data", + "value": "" + }, + { + "code": "control_data", + "value": "" + }, + { + "code": "rhythm_mode", + "value": "AAAAAAA=" + }, + { + "code": "sleep_mode", + "value": "AAA=" + }, + { + "code": "wakeup_mode", + "value": "AAA=" + }, + { + "code": "power_memory", + "value": "AAEAPAPoA+gAZADI" + }, + { + "code": "cycle_timing", + "value": "AAAA" + }, + { + "code": "random_timing", + "value": "AAAA" + } + ], + "sub": false, + "time_zone": "+02:00", + "uid": "eu1712934899766oTQEN", + "update_time": 1745601351, + "uuid": "ac759c73d50d90cd", + "mapping": { + "20": { + "code": "switch_led", + "type": "Boolean", + "values": {} + }, + "21": { + "code": "work_mode", + "type": "Enum", + "values": { + "range": [ + "white", + "colour", + "scene", + "music" + ] + } + }, + "22": { + "code": "bright_value_v2", + "type": "Integer", + "values": { + "min": 10, + "max": 1000, + "scale": 0, + "step": 1 + } + }, + "23": { + "code": "temp_value_v2", + "type": "Integer", + "values": { + "min": 0, + "max": 1000, + "scale": 0, + "step": 1 + } + }, + "24": { + "code": "colour_data_v2", + "type": "Json", + "raw_values": "{\"h\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1},\"v\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}}", + "values": { + "h": { + "min": 0, + "scale": 0, + "unit": "", + "max": 360, + "step": 1 + }, + "s": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + }, + "v": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + } + } + }, + "25": { + "code": "scene_data_v2", + "type": "Json", + "raw_values": "{\"scene_num\":{\"min\":1,\"scale\":0,\"max\":8,\"step\":1},\"scene_units\": {\"unit_change_mode\":{\"range\":[\"static\",\"jump\",\"gradient\"]},\"unit_switch_duration\":{\"min\":0,\"scale\":0,\"max\":100,\"step\":1},\"unit_gradient_duration\":{\"min\":0,\"scale\":0,\"max\":100,\"step\":1},\"bright\":{\"min\":0,\"scale\":0,\"max\":1000,\"step\":1},\"temperature\":{\"min\":0,\"scale\":0,\"max\":1000,\"step\":1},\"h\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1},\"v\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}}}", + "values": { + "scene_num": { + "min": 1, + "scale": 0, + "max": 8, + "step": 1 + }, + "scene_units": { + "unit_change_mode": { + "range": [ + "static", + "jump", + "gradient" + ] + }, + "unit_switch_duration": { + "min": 0, + "scale": 0, + "max": 100, + "step": 1 + }, + "unit_gradient_duration": { + "min": 0, + "scale": 0, + "max": 100, + "step": 1 + }, + "bright": { + "min": 0, + "scale": 0, + "max": 1000, + "step": 1 + }, + "temperature": { + "min": 0, + "scale": 0, + "max": 1000, + "step": 1 + }, + "h": { + "min": 0, + "scale": 0, + "unit": "", + "max": 360, + "step": 1 + }, + "s": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + }, + "v": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + } + } + } + }, + "26": { + "code": "countdown_1", + "type": "Integer", + "values": { + "unit": "s", + "min": 0, + "max": 86400, + "scale": 0, + "step": 1 + } + }, + "27": { + "code": "music_data", + "type": "Json", + "raw_values": "{\"change_mode\":{\"range\":[\"direct\",\"gradient\"]}, \"bright\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}, \"temperature\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}, \"h\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1},\"v\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1}}", + "values": { + "change_mode": { + "range": [ + "direct", + "gradient" + ] + }, + "bright": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + }, + "temperature": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + }, + "h": { + "min": 0, + "scale": 0, + "unit": "", + "max": 360, + "step": 1 + }, + "s": { + "min": 0, + "scale": 0, + "unit": "", + "max": 255, + "step": 1 + }, + "v": { + "min": 0, + "scale": 0, + "unit": "", + "max": 255, + "step": 1 + } + } + }, + "28": { + "code": "control_data", + "type": "Json", + "raw_values": "{\"change_mode\":{\"range\":[\"direct\",\"gradient\"]}, \"bright\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}, \"temperature\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}, \"h\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1},\"v\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1}}", + "values": { + "change_mode": { + "range": [ + "direct", + "gradient" + ] + }, + "bright": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + }, + "temperature": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + }, + "h": { + "min": 0, + "scale": 0, + "unit": "", + "max": 360, + "step": 1 + }, + "s": { + "min": 0, + "scale": 0, + "unit": "", + "max": 255, + "step": 1 + }, + "v": { + "min": 0, + "scale": 0, + "unit": "", + "max": 255, + "step": 1 + } + } + }, + "30": { + "code": "rhythm_mode", + "type": "Raw", + "values": { + "maxlen": "255" + } + }, + "31": { + "code": "sleep_mode", + "type": "Raw", + "values": { + "maxlen": "255" + } + }, + "32": { + "code": "wakeup_mode", + "type": "Raw", + "values": { + "maxlen": "255" + } + }, + "33": { + "code": "power_memory", + "type": "Raw", + "values": {} + }, + "209": { + "code": "cycle_timing", + "type": "Raw", + "values": {} + }, + "210": { + "code": "random_timing", + "type": "Raw", + "values": {} + } + } + }, + { + "active_time": 1715087798, + "biz_type": 0, + "category": "mcs", + "create_time": 1715087798, + "icon": "smart/icon/ay1574490117625MIxZY/fa22e30b32b420105d0d6090fdd93c39.png", + "id": "bf4bad4f995ba17c0fghjk", + "ip": "176.165.222.155", + "lat": "42.76", + "local_key": "F9s>V_Y1QV||*UNf", + "lon": "2.88", + "model": "Door Sensor", + "name": "sensor chambre", + "online": true, + "owner_id": "189260016", + "product_id": "g2uishoy2nasxgz0", + "product_name": "Contact Sensor", + "status": [ + { + "code": "doorcontact_state", + "value": false + }, + { + "code": "battery_percentage", + "value": 0 + } + ], + "sub": false, + "time_zone": "+02:00", + "uid": "eu1712934899766oTQEN", + "update_time": 1745596271, + "uuid": "2f40f87ec53f657c", + "mapping": { + "1": { + "code": "doorcontact_state", + "type": "Boolean", + "values": {} + }, + "2": { + "code": "battery_percentage", + "type": "Integer", + "values": { + "unit": "%", + "min": 0, + "max": 100, + "scale": 0, + "step": 1 + } + } + } + }, + { + "active_time": 1716819964, + "biz_type": 0, + "category": "cz", + "create_time": 1716819964, + "icon": "smart/icon/ay15107356719526e3ps/f1d0c8ad0822636028bd9117522687db.png", + "id": "bf3254180de3bdd7bfnbei", + "ip": "176.165.222.155", + "lat": "42.7646", + "local_key": "5S2Z#]@_d:0F{bV", + "lon": "2.8775", + "model": "WB02", + "name": "salon", + "online": true, + "owner_id": "189260016", + "product_id": "8a2rwbhxplktam1x", + "product_name": "WB02", + "status": [ + { + "code": "switch_1", + "value": false + }, + { + "code": "switch_2", + "value": true + }, + { + "code": "countdown_1", + "value": 0 + }, + { + "code": "countdown_2", + "value": 0 + }, + { + "code": "relay_status", + "value": "last" + }, + { + "code": "switch_backlight", + "value": true + }, + { + "code": "cycle_time", + "value": "" + }, + { + "code": "random_time", + "value": "" + }, + { + "code": "switch_inching", + "value": "" + } + ], + "sub": false, + "time_zone": "+01:00", + "uid": "eu1712934899766oTQEN", + "update_time": 1745557987, + "uuid": "e4a5299c2c6a46fe", + "mapping": { + "1": { + "code": "switch_1", + "type": "Boolean", + "values": {} + }, + "2": { + "code": "switch_2", + "type": "Boolean", + "values": {} + }, + "7": { + "code": "countdown_1", + "type": "Integer", + "values": { + "unit": "s", + "min": 0, + "max": 86400, + "scale": 0, + "step": 1 + } + }, + "8": { + "code": "countdown_2", + "type": "Integer", + "values": { + "unit": "s", + "min": 0, + "max": 86400, + "scale": 0, + "step": 1 + } + }, + "14": { + "code": "relay_status", + "type": "Enum", + "values": { + "range": [ + "power_off", + "power_on", + "last" + ] + } + }, + "16": { + "code": "switch_backlight", + "type": "Boolean", + "values": {} + }, + "17": { + "code": "cycle_time", + "type": "String", + "values": "{}" + }, + "18": { + "code": "random_time", + "type": "String", + "values": "{}" + }, + "19": { + "code": "switch_inching", + "type": "String", + "values": "{}" + } + } + }, + { + "active_time": 1730618653, + "biz_type": 0, + "category": "pc", + "create_time": 1692346600, + "icon": "smart/icon/ay1517974017716dABhC/7f72f014bbd715b7af14e1922d640de7.png", + "id": "820180048cce4e2aecc7", + "ip": "176.165.222.155", + "lat": "42.7646", + "local_key": "_rgNtA^X&Vp)A|^l", + "lon": "2.8775", + "model": "Po01-T-AR\uff08P1\uff09", + "name": "bureau dino", + "online": true, + "owner_id": "189260016", + "product_id": "tsbguim4trl6fa7g", + "product_name": "Smart Power Strip", + "status": [ + { + "code": "switch_1", + "value": true + }, + { + "code": "switch_2", + "value": true + }, + { + "code": "switch_3", + "value": true + }, + { + "code": "switch_usb1", + "value": false + }, + { + "code": "countdown_1", + "value": 0 + }, + { + "code": "countdown_2", + "value": 0 + }, + { + "code": "countdown_3", + "value": 0 + }, + { + "code": "countdown_usb1", + "value": 0 + }, + { + "code": "add_ele", + "value": 54 + }, + { + "code": "cur_current", + "value": 823 + }, + { + "code": "cur_power", + "value": 1886 + }, + { + "code": "cur_voltage", + "value": 2291 + } + ], + "sub": false, + "time_zone": "+01:00", + "uid": "eu1712934899766oTQEN", + "update_time": 1745554091, + "uuid": "820180048cce4e2aecc7", + "mapping": { + "1": { + "code": "switch_1", + "type": "Boolean", + "values": {} + }, + "2": { + "code": "switch_2", + "type": "Boolean", + "values": {} + }, + "3": { + "code": "switch_3", + "type": "Boolean", + "values": {} + }, + "7": { + "code": "switch_usb1", + "type": "Boolean", + "values": {} + }, + "9": { + "code": "countdown_1", + "type": "Integer", + "values": { + "unit": "s", + "min": 0, + "max": 86400, + "scale": 0, + "step": 1 + } + }, + "10": { + "code": "countdown_2", + "type": "Integer", + "values": { + "unit": "s", + "min": 0, + "max": 86400, + "scale": 0, + "step": 1 + } + }, + "11": { + "code": "countdown_3", + "type": "Integer", + "values": { + "unit": "s", + "min": 0, + "max": 86400, + "scale": 0, + "step": 1 + } + }, + "15": { + "code": "countdown_usb1", + "type": "Integer", + "values": { + "unit": "s", + "min": 0, + "max": 86400, + "scale": 0, + "step": 1 + } + }, + "17": { + "code": "add_ele", + "type": "Integer", + "values": { + "unit": "", + "min": 0, + "max": 50000, + "scale": 3, + "step": 100 + } + }, + "18": { + "code": "cur_current", + "type": "Integer", + "values": { + "unit": "mA", + "min": 0, + "max": 30000, + "scale": 0, + "step": 1 + } + }, + "19": { + "code": "cur_power", + "type": "Integer", + "values": { + "unit": "W", + "min": 0, + "max": 50000, + "scale": 1, + "step": 1 + } + }, + "20": { + "code": "cur_voltage", + "type": "Integer", + "values": { + "unit": "V", + "min": 0, + "max": 5000, + "scale": 1, + "step": 1 + } + } + } + }, + { + "active_time": 1715015241, + "biz_type": 0, + "category": "cz", + "create_time": 1715015241, + "icon": "smart/icon/ay1552295613286EPqcq/28ed5ba6da3ebeaccc8b38134a41259a.png", + "id": "bfe57aa0e61a9b529bzrff", + "ip": "176.165.222.155", + "lat": "42.7646", + "local_key": "|fI8f~QH~5>>m0x?", + "lon": "2.8775", + "model": "JH-PcPro+", + "name": "PC", + "online": true, + "owner_id": "189260016", + "product_id": "rtbhfbuii82scjrp", + "product_name": "PC", + "status": [ + { + "code": "switch_1", + "value": true + }, + { + "code": "switch_usb1", + "value": false + }, + { + "code": "switch_usb2", + "value": true + }, + { + "code": "relay_status", + "value": "power_off" + }, + { + "code": "child_lock", + "value": false + } + ], + "sub": false, + "time_zone": "+02:00", + "uid": "eu1712934899766oTQEN", + "update_time": 1745539845, + "uuid": "e99882b484024f72", + "mapping": { + "1": { + "code": "switch_1", + "type": "Boolean", + "values": {} + }, + "7": { + "code": "switch_usb1", + "type": "Boolean", + "values": {} + }, + "8": { + "code": "switch_usb2", + "type": "Boolean", + "values": {} + }, + "38": { + "code": "relay_status", + "type": "Enum", + "values": { + "range": [ + "power_off", + "power_on" + ] + } + }, + "40": { + "code": "child_lock", + "type": "Boolean", + "values": {} + } + } + }, + { + "active_time": 1743947524, + "biz_type": 0, + "category": "clkg", + "create_time": 1718807218, + "icon": "smart/icon/bay1611024616021eetm/09b246c4d0b2becae91a09c7a47508b2.png", + "id": "bf0e197f469e9f2670fb27", + "ip": "176.165.222.155", + "lat": "42.7646", + "local_key": "j$doVJIPumHd2PUf", + "lon": "2.8775", + "model": "qcsc400wv3", + "name": "volet jean luc", + "online": true, + "owner_id": "189260016", + "product_id": "4pqpkp1rskkjtxay", + "product_name": "Curtain switch", + "status": [ + { + "code": "control", + "value": "stop" + }, + { + "code": "control_back_mode", + "value": "back" + }, + { + "code": "tr_timecon", + "value": 60 + } + ], + "sub": false, + "time_zone": "+02:00", + "uid": "eu1712934899766oTQEN", + "update_time": 1745538396, + "uuid": "7b42b4575e8aa241", + "mapping": { + "1": { + "code": "control", + "type": "Enum", + "values": { + "range": [ + "open", + "stop", + "close" + ] + } + }, + "8": { + "code": "control_back_mode", + "type": "Enum", + "values": { + "range": [ + "forward", + "back" + ] + } + }, + "10": { + "code": "tr_timecon", + "type": "Integer", + "values": { + "unit": "s", + "min": 1, + "max": 120, + "scale": 0, + "step": 1 + } + } + } + }, + { + "active_time": 1718795603, + "biz_type": 0, + "category": "sgbj", + "create_time": 1718795019, + "icon": "smart/icon/ay1537847617560vAgbw/6abc8af6079bf64231455aff9bae44f0.jpg", + "id": "bf4054de281cb6ada8actg", + "ip": "176.165.222.155", + "lat": "42.7646", + "local_key": "HokvwP_PM{r#SIHb", + "lon": "2.8775", + "model": "H1-SOS", + "name": "Sir\u00e8ne intelligente ", + "online": true, + "owner_id": "189260016", + "product_id": "d7bwplp3edtnkxxh", + "product_name": "Smart Siren", + "sub": false, + "time_zone": "+02:00", + "uid": "eu1712934899766oTQEN", + "update_time": 1745522847, + "uuid": "284e0c9f111b8ddc", + "mapping": {} + }, + { + "active_time": 1737471135, + "biz_type": 0, + "category": "sp", + "create_time": 1737471135, + "icon": "smart/icon/bay1608959728923ed4V/8e541d49da2047d72b0fb73811efca62.png", + "id": "bf584a5db6d2208dcf2bol", + "ip": "176.165.222.155", + "lat": "42.7646", + "local_key": "mAF-Jj#O.#0@Lk?[", + "lon": "2.8775", + "model": "SQW", + "name": "Cam-Dino", + "online": true, + "owner_id": "189260016", + "product_id": "biw8urjw2dvss3ur", + "product_name": "Smart Camera", + "status": [ + { + "code": "basic_indicator", + "value": true + }, + { + "code": "basic_flip", + "value": false + }, + { + "code": "basic_osd", + "value": true + }, + { + "code": "basic_private", + "value": false + }, + { + "code": "motion_sensitivity", + "value": "1" + }, + { + "code": "basic_nightvision", + "value": "0" + }, + { + "code": "sd_storge", + "value": "61038592|48714752|12323840" + }, + { + "code": "sd_status", + "value": 1 + }, + { + "code": "sd_format", + "value": false + }, + { + "code": "movement_detect_pic", + "value": "$" + }, + { + "code": "ptz_stop", + "value": true + }, + { + "code": "sd_format_state", + "value": 0 + }, + { + "code": "ptz_control", + "value": "3" + }, + { + "code": "ipc_auto_siren", + "value": false + }, + { + "code": "ptz_calibration", + "value": false + }, + { + "code": "motion_switch", + "value": false + }, + { + "code": "decibel_switch", + "value": false + }, + { + "code": "decibel_sensitivity", + "value": "0" + }, + { + "code": "decibel_upload", + "value": "" + }, + { + "code": "record_switch", + "value": true + }, + { + "code": "record_mode", + "value": "2" + }, + { + "code": "siren_switch", + "value": false + }, + { + "code": "basic_device_volume", + "value": 10 + }, + { + "code": "motion_tracking", + "value": false + }, + { + "code": "device_restart", + "value": false + }, + { + "code": "motion_area_switch", + "value": false + }, + { + "code": "motion_area", + "value": "" + }, + { + "code": "humanoid_filter", + "value": false + }, + { + "code": "cruise_switch", + "value": false + }, + { + "code": "cruise_mode", + "value": "0" + }, + { + "code": "cruise_time_mode", + "value": "0" + }, + { + "code": "cruise_time", + "value": "" + }, + { + "code": "alarm_message", + "value": "" + }, + { + "code": "basic_anti_flicker", + "value": "0" + }, + { + "code": "ipc_siren_duration", + "value": 20 + }, + { + "code": "ipc_siren_volume", + "value": 50 + }, + { + "code": "ipc_preset_set", + "value": "1" + }, + { + "code": "initiative_message", + "value": "eyJ2IjoiNC4wIiwiZmlsZXMiOlt7ImRhdGEiOiI4MzE3ZDUwMGJhOTg0NGNlNTY4ZmJlNGVhN2IwNTc4YTE2NmRhNTFjM2E3OGZhODY5MzNjZWU0OTU4YjcxMmUzZjcwZmE2NjJhMTU4NjVmMzdhYjA3YjEyYjY2NTcwOTc5YTQyZTdjYTc2NjE0M2YwNmMxYjYyZDc0M2M3YzkxNTI4MjEzNzhmYjY3NzBhODYwOWQzNmJiNTZmZjI4ZmIzZTNlY2E3YmQ4MDQyZWI3YjExNzM2OTIwNWQxZjRkNzU1OTgyOTI5N2UzY2IwYzg2NTU5NTJiZjI0OTNkYjk4NyIsImtleUlkIjoiZGVmYXVsdCIsIml2IjoiMDBiYTk1ZWViNGUzN2NiYTE2ZTM5MDBlZDYzNjYxMDcifV0sImNtZCI6ImlwY19tb3Rpb24iLCJ0eXBlIjoiaW1hZ2UifQ==" + } + ], + "sub": false, + "time_zone": "+01:00", + "uid": "eu1712934899766oTQEN", + "update_time": 1745522837, + "uuid": "aoni6b7bc592421a1379", + "mapping": { + "101": { + "code": "basic_indicator", + "type": "Boolean", + "values": {} + }, + "103": { + "code": "basic_flip", + "type": "Boolean", + "values": {} + }, + "104": { + "code": "basic_osd", + "type": "Boolean", + "values": {} + }, + "105": { + "code": "basic_private", + "type": "Boolean", + "values": {} + }, + "106": { + "code": "motion_sensitivity", + "type": "Enum", + "values": { + "range": [ + "0", + "1", + "2" + ] + } + }, + "108": { + "code": "basic_nightvision", + "type": "Enum", + "values": { + "range": [ + "0", + "1", + "2" + ] + } + }, + "109": { + "code": "sd_storge", + "type": "String", + "values": "{\"maxlen\":255}" + }, + "110": { + "code": "sd_status", + "type": "Integer", + "values": { + "min": 1, + "max": 5, + "scale": 0, + "step": 1 + } + }, + "111": { + "code": "sd_format", + "type": "Boolean", + "values": {} + }, + "115": { + "code": "movement_detect_pic", + "type": "Raw", + "values": {} + }, + "116": { + "code": "ptz_stop", + "type": "Boolean", + "values": {} + }, + "117": { + "code": "sd_format_state", + "type": "Integer", + "values": { + "min": -20000, + "max": 200000, + "scale": 0, + "step": 1 + } + }, + "119": { + "code": "ptz_control", + "type": "Enum", + "values": { + "range": [ + "0", + "1", + "2", + "3", + "4", + "5", + "6", + "7" + ] + } + }, + "120": { + "code": "ipc_auto_siren", + "type": "Boolean", + "values": {} + }, + "132": { + "code": "ptz_calibration", + "type": "Boolean", + "values": {} + }, + "134": { + "code": "motion_switch", + "type": "Boolean", + "values": {} + }, + "139": { + "code": "decibel_switch", + "type": "Boolean", + "values": {} + }, + "140": { + "code": "decibel_sensitivity", + "type": "Enum", + "values": { + "range": [ + "0", + "1" + ] + } + }, + "141": { + "code": "decibel_upload", + "type": "String", + "values": "{\"maxlen\":255}" + }, + "150": { + "code": "record_switch", + "type": "Boolean", + "values": {} + }, + "151": { + "code": "record_mode", + "type": "Enum", + "values": { + "range": [ + "1", + "2" + ] + } + }, + "159": { + "code": "siren_switch", + "type": "Boolean", + "values": {} + }, + "160": { + "code": "basic_device_volume", + "type": "Integer", + "values": { + "unit": "", + "min": 1, + "max": 10, + "scale": 0, + "step": 1 + } + }, + "161": { + "code": "motion_tracking", + "type": "Boolean", + "values": {} + }, + "162": { + "code": "device_restart", + "type": "Boolean", + "values": {} + }, + "168": { + "code": "motion_area_switch", + "type": "Boolean", + "values": {} + }, + "169": { + "code": "motion_area", + "type": "String", + "values": "{\"maxlen\":255}" + }, + "170": { + "code": "humanoid_filter", + "type": "Boolean", + "values": {} + }, + "174": { + "code": "cruise_switch", + "type": "Boolean", + "values": {} + }, + "175": { + "code": "cruise_mode", + "type": "Enum", + "values": { + "range": [ + "0", + "1" + ] + } + }, + "176": { + "code": "cruise_time_mode", + "type": "Enum", + "values": { + "range": [ + "0", + "1" + ] + } + }, + "177": { + "code": "cruise_time", + "type": "String", + "values": "{}" + }, + "185": { + "code": "alarm_message", + "type": "String", + "values": "{}" + }, + "188": { + "code": "basic_anti_flicker", + "type": "Enum", + "values": { + "range": [ + "0", + "1", + "2" + ] + } + }, + "194": { + "code": "ipc_siren_duration", + "type": "Integer", + "values": { + "unit": "s", + "min": 10, + "max": 600, + "scale": 0, + "step": 10 + } + }, + "195": { + "code": "ipc_siren_volume", + "type": "Integer", + "values": { + "unit": "%", + "min": 0, + "max": 100, + "scale": 0, + "step": 1 + } + }, + "199": { + "code": "ipc_preset_set", + "type": "Enum", + "values": { + "range": [ + "1", + "2", + "3", + "4" + ] + } + }, + "212": { + "code": "initiative_message", + "type": "Raw", + "values": {} + }, + "190": { + "code": "ipc_preset_action", + "type": "Enum", + "values": { + "range": [ + "1", + "2", + "3", + "4", + "5", + "6" + ] + } + } + } + }, + { + "active_time": 1736873764, + "biz_type": 0, + "category": "dd", + "create_time": 1735855462, + "icon": "smart/icon/ay1521618643672lvY0O/49c7fcde813e7e9d6c1539e4facc5500.png", + "id": "bfd5eb950aecda95d3mgpq", + "ip": "176.165.222.155", + "lat": "42.7646", + "local_key": "R=_N.r9`clUY!JKA", + "lon": "2.8775", + "model": "", + "name": "bambulight", + "online": true, + "owner_id": "189260016", + "product_id": "pkm8wzcxbefg6vv6", + "product_name": "C\u5355\u8272\u706f\u5e26", + "status": [ + { + "code": "switch_led", + "value": false + }, + { + "code": "work_mode", + "value": "white" + }, + { + "code": "bright_value", + "value": 1000 + }, + { + "code": "scene_data", + "value": "{\"scene_num\":1,\"scene_units\":[{\"bright\":200,\"h\":0,\"s\":0,\"temperature\":1000,\"unit_change_mode\":\"static\",\"unit_gradient_duration\":13,\"unit_switch_duration\":14,\"v\":0}]}" + }, + { + "code": "countdown", + "value": 0 + } + ], + "sub": false, + "time_zone": "+01:00", + "uid": "eu1712934899766oTQEN", + "update_time": 1745522824, + "uuid": "71be6e7cdc78dcde", + "mapping": { + "20": { + "code": "switch_led", + "type": "Boolean", + "values": {} + }, + "21": { + "code": "work_mode", + "type": "Enum", + "values": { + "range": [ + "white", + "colour", + "scene", + "music" + ] + } + }, + "22": { + "code": "bright_value", + "type": "Integer", + "values": { + "min": 10, + "max": 1000, + "scale": 0, + "step": 1 + } + }, + "25": { + "code": "scene_data", + "type": "Json", + "raw_values": "{\"scene_num\":{\"min\":1,\"scale\":0,\"max\":8,\"step\":1},\"scene_units\": {\"unit_change_mode\":{\"range\":[\"static\",\"jump\",\"gradient\"]},\"unit_switch_duration\":{\"min\":0,\"scale\":0,\"max\":100,\"step\":1},\"unit_gradient_duration\":{\"min\":0,\"scale\":0,\"max\":100,\"step\":1},\"bright\":{\"min\":0,\"scale\":0,\"max\":1000,\"step\":1},\"temperature\":{\"min\":0,\"scale\":0,\"max\":1000,\"step\":1},\"h\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1},\"v\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}}}", + "values": { + "scene_num": { + "min": 1, + "scale": 0, + "max": 8, + "step": 1 + }, + "scene_units": { + "unit_change_mode": { + "range": [ + "static", + "jump", + "gradient" + ] + }, + "unit_switch_duration": { + "min": 0, + "scale": 0, + "max": 100, + "step": 1 + }, + "unit_gradient_duration": { + "min": 0, + "scale": 0, + "max": 100, + "step": 1 + }, + "bright": { + "min": 0, + "scale": 0, + "max": 1000, + "step": 1 + }, + "temperature": { + "min": 0, + "scale": 0, + "max": 1000, + "step": 1 + }, + "h": { + "min": 0, + "scale": 0, + "unit": "", + "max": 360, + "step": 1 + }, + "s": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + }, + "v": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + } + } + } + }, + "26": { + "code": "countdown", + "type": "Integer", + "values": { + "min": 0, + "max": 86400, + "scale": 0, + "step": 1 + } + }, + "28": { + "code": "control_data", + "type": "Json", + "raw_values": "{\"change_mode\":{\"range\":[\"direct\",\"gradient\"]}, \"bright\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}, \"temperature\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}, \"h\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1},\"v\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1}}", + "values": { + "change_mode": { + "range": [ + "direct", + "gradient" + ] + }, + "bright": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + }, + "temperature": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + }, + "h": { + "min": 0, + "scale": 0, + "unit": "", + "max": 360, + "step": 1 + }, + "s": { + "min": 0, + "scale": 0, + "unit": "", + "max": 255, + "step": 1 + }, + "v": { + "min": 0, + "scale": 0, + "unit": "", + "max": 255, + "step": 1 + } + } + } + } + }, + { + "active_time": 1736329715, + "biz_type": 0, + "category": "dd", + "create_time": 1736329715, + "icon": "smart/icon/ay1521618643672lvY0O/49c7fcde813e7e9d6c1539e4facc5500.png", + "id": "bfadb5f27d0fe9a778ixwc", + "ip": "176.165.222.155", + "lat": "42.7646", + "local_key": "dOo5*OR3ixjP?OxO", + "lon": "2.8775", + "model": "", + "name": "ringlight", + "online": true, + "owner_id": "189260016", + "product_id": "pkm8wzcxbefg6vv6", + "product_name": "C\u5355\u8272\u706f\u5e26", + "status": [ + { + "code": "switch_led", + "value": true + }, + { + "code": "work_mode", + "value": "white" + }, + { + "code": "bright_value", + "value": 1000 + }, + { + "code": "scene_data", + "value": "{\"scene_num\":1,\"scene_units\":[{\"bright\":200,\"h\":0,\"s\":0,\"temperature\":1000,\"unit_change_mode\":\"static\",\"unit_gradient_duration\":13,\"unit_switch_duration\":14,\"v\":0}]}" + }, + { + "code": "countdown", + "value": 0 + } + ], + "sub": false, + "time_zone": "+01:00", + "uid": "eu1712934899766oTQEN", + "update_time": 1745522818, + "uuid": "3c52e36d800e6c9c", + "mapping": { + "20": { + "code": "switch_led", + "type": "Boolean", + "values": {} + }, + "21": { + "code": "work_mode", + "type": "Enum", + "values": { + "range": [ + "white", + "colour", + "scene", + "music" + ] + } + }, + "22": { + "code": "bright_value", + "type": "Integer", + "values": { + "min": 10, + "max": 1000, + "scale": 0, + "step": 1 + } + }, + "25": { + "code": "scene_data", + "type": "Json", + "raw_values": "{\"scene_num\":{\"min\":1,\"scale\":0,\"max\":8,\"step\":1},\"scene_units\": {\"unit_change_mode\":{\"range\":[\"static\",\"jump\",\"gradient\"]},\"unit_switch_duration\":{\"min\":0,\"scale\":0,\"max\":100,\"step\":1},\"unit_gradient_duration\":{\"min\":0,\"scale\":0,\"max\":100,\"step\":1},\"bright\":{\"min\":0,\"scale\":0,\"max\":1000,\"step\":1},\"temperature\":{\"min\":0,\"scale\":0,\"max\":1000,\"step\":1},\"h\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1},\"v\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}}}", + "values": { + "scene_num": { + "min": 1, + "scale": 0, + "max": 8, + "step": 1 + }, + "scene_units": { + "unit_change_mode": { + "range": [ + "static", + "jump", + "gradient" + ] + }, + "unit_switch_duration": { + "min": 0, + "scale": 0, + "max": 100, + "step": 1 + }, + "unit_gradient_duration": { + "min": 0, + "scale": 0, + "max": 100, + "step": 1 + }, + "bright": { + "min": 0, + "scale": 0, + "max": 1000, + "step": 1 + }, + "temperature": { + "min": 0, + "scale": 0, + "max": 1000, + "step": 1 + }, + "h": { + "min": 0, + "scale": 0, + "unit": "", + "max": 360, + "step": 1 + }, + "s": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + }, + "v": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + } + } + } + }, + "26": { + "code": "countdown", + "type": "Integer", + "values": { + "min": 0, + "max": 86400, + "scale": 0, + "step": 1 + } + }, + "28": { + "code": "control_data", + "type": "Json", + "raw_values": "{\"change_mode\":{\"range\":[\"direct\",\"gradient\"]}, \"bright\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}, \"temperature\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}, \"h\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1},\"v\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1}}", + "values": { + "change_mode": { + "range": [ + "direct", + "gradient" + ] + }, + "bright": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + }, + "temperature": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + }, + "h": { + "min": 0, + "scale": 0, + "unit": "", + "max": 360, + "step": 1 + }, + "s": { + "min": 0, + "scale": 0, + "unit": "", + "max": 255, + "step": 1 + }, + "v": { + "min": 0, + "scale": 0, + "unit": "", + "max": 255, + "step": 1 + } + } + } + } + }, + { + "active_time": 1738314779, + "biz_type": 0, + "category": "dd", + "create_time": 1738314779, + "icon": "smart/icon/ay1521618643672lvY0O/49c7fcde813e7e9d6c1539e4facc5500.png", + "id": "bff3ca58c60d8b18d4x3dn", + "ip": "176.165.222.155", + "lat": "42.7646", + "local_key": "Nt6*~S4<2x9;?Q+-", + "lon": "2.8775", + "model": "", + "name": "chinalight", + "online": true, + "owner_id": "189260016", + "product_id": "pkm8wzcxbefg6vv6", + "product_name": "C\u5355\u8272\u706f\u5e26", + "status": [ + { + "code": "switch_led", + "value": false + }, + { + "code": "work_mode", + "value": "white" + }, + { + "code": "bright_value", + "value": 1000 + }, + { + "code": "scene_data", + "value": "{\"scene_num\":1,\"scene_units\":[{\"bright\":200,\"h\":0,\"s\":0,\"temperature\":1000,\"unit_change_mode\":\"static\",\"unit_gradient_duration\":13,\"unit_switch_duration\":14,\"v\":0}]}" + }, + { + "code": "countdown", + "value": 0 + } + ], + "sub": false, + "time_zone": "+01:00", + "uid": "eu1712934899766oTQEN", + "update_time": 1745522815, + "uuid": "f95b88cfd4065f4d", + "mapping": { + "20": { + "code": "switch_led", + "type": "Boolean", + "values": {} + }, + "21": { + "code": "work_mode", + "type": "Enum", + "values": { + "range": [ + "white", + "colour", + "scene", + "music" + ] + } + }, + "22": { + "code": "bright_value", + "type": "Integer", + "values": { + "min": 10, + "max": 1000, + "scale": 0, + "step": 1 + } + }, + "25": { + "code": "scene_data", + "type": "Json", + "raw_values": "{\"scene_num\":{\"min\":1,\"scale\":0,\"max\":8,\"step\":1},\"scene_units\": {\"unit_change_mode\":{\"range\":[\"static\",\"jump\",\"gradient\"]},\"unit_switch_duration\":{\"min\":0,\"scale\":0,\"max\":100,\"step\":1},\"unit_gradient_duration\":{\"min\":0,\"scale\":0,\"max\":100,\"step\":1},\"bright\":{\"min\":0,\"scale\":0,\"max\":1000,\"step\":1},\"temperature\":{\"min\":0,\"scale\":0,\"max\":1000,\"step\":1},\"h\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1},\"v\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}}}", + "values": { + "scene_num": { + "min": 1, + "scale": 0, + "max": 8, + "step": 1 + }, + "scene_units": { + "unit_change_mode": { + "range": [ + "static", + "jump", + "gradient" + ] + }, + "unit_switch_duration": { + "min": 0, + "scale": 0, + "max": 100, + "step": 1 + }, + "unit_gradient_duration": { + "min": 0, + "scale": 0, + "max": 100, + "step": 1 + }, + "bright": { + "min": 0, + "scale": 0, + "max": 1000, + "step": 1 + }, + "temperature": { + "min": 0, + "scale": 0, + "max": 1000, + "step": 1 + }, + "h": { + "min": 0, + "scale": 0, + "unit": "", + "max": 360, + "step": 1 + }, + "s": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + }, + "v": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + } + } + } + }, + "26": { + "code": "countdown", + "type": "Integer", + "values": { + "min": 0, + "max": 86400, + "scale": 0, + "step": 1 + } + }, + "28": { + "code": "control_data", + "type": "Json", + "raw_values": "{\"change_mode\":{\"range\":[\"direct\",\"gradient\"]}, \"bright\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}, \"temperature\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}, \"h\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1},\"v\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1}}", + "values": { + "change_mode": { + "range": [ + "direct", + "gradient" + ] + }, + "bright": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + }, + "temperature": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + }, + "h": { + "min": 0, + "scale": 0, + "unit": "", + "max": 360, + "step": 1 + }, + "s": { + "min": 0, + "scale": 0, + "unit": "", + "max": 255, + "step": 1 + }, + "v": { + "min": 0, + "scale": 0, + "unit": "", + "max": 255, + "step": 1 + } + } + } + } + }, + { + "active_time": 1720549900, + "biz_type": 0, + "category": "dd", + "create_time": 1714046046, + "icon": "smart/icon/bay1620612456877DitN/1aae025ef332c2e5bd1ad8abd4831443.png", + "id": "bfca435612874e22ecfqa0", + "ip": "176.165.222.155", + "lat": "42.7646", + "local_key": "Nei5]1k?GzT)c]ZM", + "lon": "2.8775", + "model": "", + "name": "Light tv", + "online": true, + "owner_id": "189260016", + "product_id": "gaobbrxqiblcng2p", + "product_name": "TV Sync Backlights", + "sub": false, + "time_zone": "+02:00", + "uid": "eu1712934899766oTQEN", + "update_time": 1745522815, + "uuid": "c07c8571f5eb0d33", + "mapping": {} + }, + { + "active_time": 1738163616, + "biz_type": 0, + "category": "dd", + "create_time": 1738163616, + "icon": "smart/solution/142006/b9dd72a8410f8faa_cover.png", + "id": "bf10d8832c8447c512jedz", + "ip": "176.165.222.155", + "lat": "42.7646", + "local_key": "e#Z$#dvgmRo}nS8^", + "lon": "2.8775", + "model": "", + "name": "windowled", + "online": true, + "owner_id": "189260016", + "product_id": "7jb4fq2ddmkpjiwd", + "product_name": "YH-RGB2", + "status": [ + { + "code": "switch_led", + "value": false + }, + { + "code": "work_mode", + "value": "colour" + }, + { + "code": "colour_data", + "value": "{\"h\":180,\"s\":1000,\"v\":1000}" + }, + { + "code": "scene_data", + "value": "{\"scene_num\":27,\"scene_units\":[{\"bright\":0,\"h\":10,\"s\":900,\"temperature\":0,\"unit_change_mode\":\"gradient\",\"unit_gradient_duration\":70,\"unit_switch_duration\":70,\"v\":1000},{\"bright\":0,\"h\":0,\"s\":1000,\"temperature\":0,\"unit_change_mode\":\"gradient\",\"unit_gradient_duration\":70,\"unit_switch_duration\":70,\"v\":1000}]}" + }, + { + "code": "countdown", + "value": 0 + } + ], + "sub": false, + "time_zone": "+01:00", + "uid": "eu1712934899766oTQEN", + "update_time": 1745508337, + "uuid": "60c8aec31f22286a", + "mapping": { + "20": { + "code": "switch_led", + "type": "Boolean", + "values": {} + }, + "21": { + "code": "work_mode", + "type": "Enum", + "values": { + "range": [ + "white", + "colour", + "scene", + "music" + ] + } + }, + "24": { + "code": "colour_data", + "type": "Json", + "raw_values": "{\"h\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1},\"v\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}}", + "values": { + "h": { + "min": 0, + "scale": 0, + "unit": "", + "max": 360, + "step": 1 + }, + "s": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + }, + "v": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + } + } + }, + "25": { + "code": "scene_data", + "type": "Json", + "raw_values": "{\"scene_num\":{\"min\":1,\"scale\":0,\"max\":8,\"step\":1},\"scene_units\": {\"unit_change_mode\":{\"range\":[\"static\",\"jump\",\"gradient\"]},\"unit_switch_duration\":{\"min\":0,\"scale\":0,\"max\":100,\"step\":1},\"unit_gradient_duration\":{\"min\":0,\"scale\":0,\"max\":100,\"step\":1},\"bright\":{\"min\":0,\"scale\":0,\"max\":1000,\"step\":1},\"temperature\":{\"min\":0,\"scale\":0,\"max\":1000,\"step\":1},\"h\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1},\"v\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}}}", + "values": { + "scene_num": { + "min": 1, + "scale": 0, + "max": 8, + "step": 1 + }, + "scene_units": { + "unit_change_mode": { + "range": [ + "static", + "jump", + "gradient" + ] + }, + "unit_switch_duration": { + "min": 0, + "scale": 0, + "max": 100, + "step": 1 + }, + "unit_gradient_duration": { + "min": 0, + "scale": 0, + "max": 100, + "step": 1 + }, + "bright": { + "min": 0, + "scale": 0, + "max": 1000, + "step": 1 + }, + "temperature": { + "min": 0, + "scale": 0, + "max": 1000, + "step": 1 + }, + "h": { + "min": 0, + "scale": 0, + "unit": "", + "max": 360, + "step": 1 + }, + "s": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + }, + "v": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + } + } + } + }, + "26": { + "code": "countdown", + "type": "Integer", + "values": { + "min": 0, + "max": 86400, + "scale": 0, + "step": 1 + } + }, + "28": { + "code": "control_data", + "type": "Json", + "raw_values": "{\"change_mode\":{\"range\":[\"direct\",\"gradient\"]}, \"bright\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}, \"temperature\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}, \"h\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1},\"v\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1}}", + "values": { + "change_mode": { + "range": [ + "direct", + "gradient" + ] + }, + "bright": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + }, + "temperature": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + }, + "h": { + "min": 0, + "scale": 0, + "unit": "", + "max": 360, + "step": 1 + }, + "s": { + "min": 0, + "scale": 0, + "unit": "", + "max": 255, + "step": 1 + }, + "v": { + "min": 0, + "scale": 0, + "unit": "", + "max": 255, + "step": 1 + } + } + } + } + }, + { + "active_time": 1716705771, + "biz_type": 0, + "category": "cz", + "create_time": 1716705771, + "icon": "smart/icon/ay15107356719526e3ps/98e0287ec5398acf336febfd46948dd1.png", + "id": "bf9043f5954449c435mcec", + "ip": "176.165.222.155", + "lat": "42.7646", + "local_key": "t0o#ih7L!$;+6R(2", + "lon": "2.8775", + "model": "", + "name": "imprimante 3d", + "online": true, + "owner_id": "189260016", + "product_id": "ddms3xyc8sfctabe", + "product_name": "Smart Plug +", + "status": [ + { + "code": "switch_1", + "value": true + }, + { + "code": "countdown_1", + "value": 0 + }, + { + "code": "add_ele", + "value": 49 + }, + { + "code": "cur_current", + "value": 307 + }, + { + "code": "cur_power", + "value": 352 + }, + { + "code": "cur_voltage", + "value": 2341 + }, + { + "code": "relay_status", + "value": "last" + }, + { + "code": "overcharge_switch", + "value": true + }, + { + "code": "child_lock", + "value": false + }, + { + "code": "cycle_time", + "value": "" + }, + { + "code": "random_time", + "value": "" + }, + { + "code": "switch_inching", + "value": "" + } + ], + "sub": false, + "time_zone": "+02:00", + "uid": "eu1712934899766oTQEN", + "update_time": 1745508330, + "uuid": "781ee18e0fb21b16", + "mapping": { + "1": { + "code": "switch_1", + "type": "Boolean", + "values": {} + }, + "9": { + "code": "countdown_1", + "type": "Integer", + "values": { + "unit": "s", + "min": 0, + "max": 86400, + "scale": 0, + "step": 1 + } + }, + "17": { + "code": "add_ele", + "type": "Integer", + "values": { + "min": 0, + "max": 50000, + "scale": 3, + "step": 100 + } + }, + "18": { + "code": "cur_current", + "type": "Integer", + "values": { + "unit": "mA", + "min": 0, + "max": 30000, + "scale": 0, + "step": 1 + } + }, + "19": { + "code": "cur_power", + "type": "Integer", + "values": { + "unit": "W", + "min": 0, + "max": 80000, + "scale": 1, + "step": 1 + } + }, + "20": { + "code": "cur_voltage", + "type": "Integer", + "values": { + "unit": "V", + "min": 0, + "max": 5000, + "scale": 1, + "step": 1 + } + }, + "38": { + "code": "relay_status", + "type": "Enum", + "values": { + "range": [ + "power_off", + "power_on", + "last" + ] + } + }, + "39": { + "code": "overcharge_switch", + "type": "Boolean", + "values": {} + }, + "41": { + "code": "child_lock", + "type": "Boolean", + "values": {} + }, + "42": { + "code": "cycle_time", + "type": "String", + "values": "{}" + }, + "43": { + "code": "random_time", + "type": "String", + "values": "{}" + }, + "44": { + "code": "switch_inching", + "type": "String", + "values": "{}" + } + } + }, + { + "active_time": 1718804593, + "biz_type": 0, + "category": "clkg", + "create_time": 1718804593, + "icon": "smart/icon/bay1611024616021eetm/09b246c4d0b2becae91a09c7a47508b2.png", + "id": "bf81367b1f5c267af7yyht", + "ip": "176.165.222.155", + "lat": "42.7646", + "local_key": "9l{9^IYi}CT63k.b", + "lon": "2.8775", + "model": "qcsc400wv3", + "name": "volet cuisine", + "online": true, + "owner_id": "189260016", + "product_id": "4pqpkp1rskkjtxay", + "product_name": "Curtain switch", + "status": [ + { + "code": "control", + "value": "stop" + }, + { + "code": "control_back_mode", + "value": "forward" + }, + { + "code": "tr_timecon", + "value": 60 + } + ], + "sub": false, + "time_zone": "+02:00", + "uid": "eu1712934899766oTQEN", + "update_time": 1745460080, + "uuid": "89a27ed28f171442", + "mapping": { + "1": { + "code": "control", + "type": "Enum", + "values": { + "range": [ + "open", + "stop", + "close" + ] + } + }, + "8": { + "code": "control_back_mode", + "type": "Enum", + "values": { + "range": [ + "forward", + "back" + ] + } + }, + "10": { + "code": "tr_timecon", + "type": "Integer", + "values": { + "unit": "s", + "min": 1, + "max": 120, + "scale": 0, + "step": 1 + } + } + } + }, + { + "active_time": 1743867776, + "biz_type": 0, + "category": "clkg", + "create_time": 1734030135, + "icon": "smart/icon/bay1611024616021eetm/09b246c4d0b2becae91a09c7a47508b2.png", + "id": "bff082745aedf9fc1aqy3e", + "ip": "176.165.222.155", + "lat": "42.7646", + "local_key": "VXg'ZP9IOI|:N)r:", + "lon": "2.8775", + "model": "qcsc400wv3", + "name": "Volet dino", + "online": true, + "owner_id": "189260016", + "product_id": "4pqpkp1rskkjtxay", + "product_name": "Curtain switch", + "status": [ + { + "code": "control", + "value": "stop" + }, + { + "code": "control_back_mode", + "value": "forward" + }, + { + "code": "tr_timecon", + "value": 60 + } + ], + "sub": false, + "time_zone": "+02:00", + "uid": "eu1712934899766oTQEN", + "update_time": 1745433286, + "uuid": "197acbff0fa71bc7", + "mapping": { + "1": { + "code": "control", + "type": "Enum", + "values": { + "range": [ + "open", + "stop", + "close" + ] + } + }, + "8": { + "code": "control_back_mode", + "type": "Enum", + "values": { + "range": [ + "forward", + "back" + ] + } + }, + "10": { + "code": "tr_timecon", + "type": "Integer", + "values": { + "unit": "s", + "min": 1, + "max": 120, + "scale": 0, + "step": 1 + } + } + } + }, + { + "active_time": 1715027088, + "biz_type": 0, + "category": "cz", + "create_time": 1715027088, + "icon": "smart/icon/ay15107356719526e3ps/98e0287ec5398acf336febfd46948dd1.png", + "id": "bfc369d2ca89602058xajc", + "ip": "176.165.222.155", + "lat": "42.7646", + "local_key": "+/l==gSiCON6aPp~@", + "lon": "2.8775", + "model": "", + "name": "Bureau", + "online": true, + "owner_id": "189260016", + "product_id": "ddms3xyc8sfctabe", + "product_name": "Smart Plug +", + "status": [ + { + "code": "switch_1", + "value": true + }, + { + "code": "countdown_1", + "value": 0 + }, + { + "code": "add_ele", + "value": 27 + }, + { + "code": "cur_current", + "value": 428 + }, + { + "code": "cur_power", + "value": 556 + }, + { + "code": "cur_voltage", + "value": 2277 + }, + { + "code": "relay_status", + "value": "last" + }, + { + "code": "overcharge_switch", + "value": false + }, + { + "code": "child_lock", + "value": false + }, + { + "code": "cycle_time", + "value": "" + }, + { + "code": "random_time", + "value": "" + }, + { + "code": "switch_inching", + "value": "" + } + ], + "sub": false, + "time_zone": "+02:00", + "uid": "eu1712934899766oTQEN", + "update_time": 1745433207, + "uuid": "f8fedb18f483de45", + "mapping": { + "1": { + "code": "switch_1", + "type": "Boolean", + "values": {} + }, + "9": { + "code": "countdown_1", + "type": "Integer", + "values": { + "unit": "s", + "min": 0, + "max": 86400, + "scale": 0, + "step": 1 + } + }, + "17": { + "code": "add_ele", + "type": "Integer", + "values": { + "min": 0, + "max": 50000, + "scale": 3, + "step": 100 + } + }, + "18": { + "code": "cur_current", + "type": "Integer", + "values": { + "unit": "mA", + "min": 0, + "max": 30000, + "scale": 0, + "step": 1 + } + }, + "19": { + "code": "cur_power", + "type": "Integer", + "values": { + "unit": "W", + "min": 0, + "max": 80000, + "scale": 1, + "step": 1 + } + }, + "20": { + "code": "cur_voltage", + "type": "Integer", + "values": { + "unit": "V", + "min": 0, + "max": 5000, + "scale": 1, + "step": 1 + } + }, + "38": { + "code": "relay_status", + "type": "Enum", + "values": { + "range": [ + "power_off", + "power_on", + "last" + ] + } + }, + "39": { + "code": "overcharge_switch", + "type": "Boolean", + "values": {} + }, + "41": { + "code": "child_lock", + "type": "Boolean", + "values": {} + }, + "42": { + "code": "cycle_time", + "type": "String", + "values": "{}" + }, + "43": { + "code": "random_time", + "type": "String", + "values": "{}" + }, + "44": { + "code": "switch_inching", + "type": "String", + "values": "{}" + } + } + }, + { + "active_time": 1736874381, + "biz_type": 0, + "category": "tdq", + "create_time": 1730973372, + "icon": "smart/icon/bay1677130922441Tlce/e20919d47fc7e35c12cfdaa2648baae4.png", + "id": "bf06f9007abca55618iiwv", + "ip": "176.165.222.155", + "lat": "42.7646", + "local_key": "fkkV`gX-@(}H.0U=", + "lon": "2.8775", + "model": "", + "name": "SW2", + "online": true, + "owner_id": "189260016", + "product_id": "m4jtkjc43ltrilru", + "product_name": "T34-Smart Plug+", + "status": [ + { + "code": "switch_1", + "value": false + }, + { + "code": "countdown_1", + "value": 0 + }, + { + "code": "add_ele", + "value": 1 + }, + { + "code": "cur_current", + "value": 0 + }, + { + "code": "cur_power", + "value": 0 + }, + { + "code": "cur_voltage", + "value": 2333 + }, + { + "code": "test_bit", + "value": 1 + }, + { + "code": "fault", + "value": 0 + }, + { + "code": "relay_status", + "value": "2" + }, + { + "code": "random_time", + "value": "" + }, + { + "code": "cycle_time", + "value": "" + }, + { + "code": "switch_inching", + "value": "AAAC" + } + ], + "sub": false, + "time_zone": "+01:00", + "uid": "eu1712934899766oTQEN", + "update_time": 1745433199, + "uuid": "08bf13f7dd1cfa49", + "mapping": { + "1": { + "code": "switch_1", + "type": "Boolean", + "values": {} + }, + "9": { + "code": "countdown_1", + "type": "Integer", + "values": { + "unit": "s", + "min": 0, + "max": 86400, + "scale": 0, + "step": 1 + } + }, + "20": { + "code": "add_ele", + "type": "Integer", + "values": { + "unit": "kW\u00b7h", + "min": 0, + "max": 50000, + "scale": 3, + "step": 100 + } + }, + "21": { + "code": "cur_current", + "type": "Integer", + "values": { + "unit": "mA", + "min": 0, + "max": 30000, + "scale": 0, + "step": 1 + } + }, + "22": { + "code": "cur_power", + "type": "Integer", + "values": { + "unit": "W", + "min": 0, + "max": 50000, + "scale": 1, + "step": 1 + } + }, + "23": { + "code": "cur_voltage", + "type": "Integer", + "values": { + "unit": "V", + "min": 0, + "max": 5000, + "scale": 1, + "step": 1 + } + }, + "24": { + "code": "test_bit", + "type": "Integer", + "values": { + "min": 0, + "max": 5, + "scale": 0, + "step": 1 + } + }, + "29": { + "code": "fault", + "type": "Bitmap", + "values": { + "label": [ + "ov_cr", + "ov_vol", + "ov_pwr", + "ls_cr", + "ls_vol", + "ls_pow" + ] + } + }, + "38": { + "code": "relay_status", + "type": "Enum", + "values": { + "range": [ + "0", + "1", + "2" + ] + } + }, + "42": { + "code": "random_time", + "type": "String", + "values": "{\"maxlen\":255}" + }, + "43": { + "code": "cycle_time", + "type": "String", + "values": "{\"maxlen\":255}" + }, + "44": { + "code": "switch_inching", + "type": "String", + "values": "{\"maxlen\":255}" + } + } + }, + { + "active_time": 1733163749, + "biz_type": 0, + "category": "dd", + "create_time": 1733163749, + "icon": "smart/icon/ay1521618643672lvY0O/49c7fcde813e7e9d6c1539e4facc5500.png", + "id": "bf94bdd65e67c4a7d7mv3l", + "ip": "176.165.222.155", + "lat": "42.7646", + "local_key": "Q|cJm'{Y2;27nuPG", + "lon": "2.8775", + "model": "", + "name": "SW2 light", + "online": false, + "owner_id": "189260016", + "product_id": "pkm8wzcxbefg6vv6", + "product_name": "C\u5355\u8272\u706f\u5e26", + "status": [ + { + "code": "switch_led", + "value": false + }, + { + "code": "work_mode", + "value": "white" + }, + { + "code": "bright_value", + "value": 1000 + }, + { + "code": "scene_data", + "value": "{\"scene_num\":1,\"scene_units\":[{\"bright\":200,\"h\":0,\"s\":0,\"temperature\":1000,\"unit_change_mode\":\"static\",\"unit_gradient_duration\":13,\"unit_switch_duration\":14,\"v\":0}]}" + }, + { + "code": "countdown", + "value": 0 + } + ], + "sub": false, + "time_zone": "+01:00", + "uid": "eu1712934899766oTQEN", + "update_time": 1744782915, + "uuid": "482605c32295c7f5", + "mapping": { + "20": { + "code": "switch_led", + "type": "Boolean", + "values": {} + }, + "21": { + "code": "work_mode", + "type": "Enum", + "values": { + "range": [ + "white", + "colour", + "scene", + "music" + ] + } + }, + "22": { + "code": "bright_value", + "type": "Integer", + "values": { + "min": 10, + "max": 1000, + "scale": 0, + "step": 1 + } + }, + "25": { + "code": "scene_data", + "type": "Json", + "raw_values": "{\"scene_num\":{\"min\":1,\"scale\":0,\"max\":8,\"step\":1},\"scene_units\": {\"unit_change_mode\":{\"range\":[\"static\",\"jump\",\"gradient\"]},\"unit_switch_duration\":{\"min\":0,\"scale\":0,\"max\":100,\"step\":1},\"unit_gradient_duration\":{\"min\":0,\"scale\":0,\"max\":100,\"step\":1},\"bright\":{\"min\":0,\"scale\":0,\"max\":1000,\"step\":1},\"temperature\":{\"min\":0,\"scale\":0,\"max\":1000,\"step\":1},\"h\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1},\"v\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}}}", + "values": { + "scene_num": { + "min": 1, + "scale": 0, + "max": 8, + "step": 1 + }, + "scene_units": { + "unit_change_mode": { + "range": [ + "static", + "jump", + "gradient" + ] + }, + "unit_switch_duration": { + "min": 0, + "scale": 0, + "max": 100, + "step": 1 + }, + "unit_gradient_duration": { + "min": 0, + "scale": 0, + "max": 100, + "step": 1 + }, + "bright": { + "min": 0, + "scale": 0, + "max": 1000, + "step": 1 + }, + "temperature": { + "min": 0, + "scale": 0, + "max": 1000, + "step": 1 + }, + "h": { + "min": 0, + "scale": 0, + "unit": "", + "max": 360, + "step": 1 + }, + "s": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + }, + "v": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + } + } + } + }, + "26": { + "code": "countdown", + "type": "Integer", + "values": { + "min": 0, + "max": 86400, + "scale": 0, + "step": 1 + } + }, + "28": { + "code": "control_data", + "type": "Json", + "raw_values": "{\"change_mode\":{\"range\":[\"direct\",\"gradient\"]}, \"bright\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}, \"temperature\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}, \"h\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1},\"v\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1}}", + "values": { + "change_mode": { + "range": [ + "direct", + "gradient" + ] + }, + "bright": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + }, + "temperature": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + }, + "h": { + "min": 0, + "scale": 0, + "unit": "", + "max": 360, + "step": 1 + }, + "s": { + "min": 0, + "scale": 0, + "unit": "", + "max": 255, + "step": 1 + }, + "v": { + "min": 0, + "scale": 0, + "unit": "", + "max": 255, + "step": 1 + } + } + } + } + }, + { + "active_time": 1717844338, + "biz_type": 0, + "category": "pir", + "create_time": 1717844338, + "icon": "smart/icon/ay1525749833414yotNt/977689dc3cf45a12a3b33f1d4cb9ff36.png", + "id": "bfabc589c6b76ea7f3ukkb", + "ip": "176.165.222.155", + "lat": "42.7547", + "local_key": "ccm}UFMjiQ;T608<", + "lon": "2.8896", + "model": "", + "name": "D\u00e9tecteur bureau jean luc", + "online": false, + "owner_id": "189260016", + "product_id": "rjzon9kyxpoeksj3", + "product_name": "Motion Sensor", + "status": [ + { + "code": "pir", + "value": "none" + }, + { + "code": "battery_state", + "value": "low" + } + ], + "sub": false, + "time_zone": "+02:00", + "uid": "eu1712934899766oTQEN", + "update_time": 1744303925, + "uuid": "b60390c7c591ba60", + "mapping": { + "1": { + "code": "pir", + "type": "Enum", + "values": { + "range": [ + "pir", + "none" + ] + } + }, + "3": { + "code": "battery_state", + "type": "Enum", + "values": { + "range": [ + "low", + "middle", + "high" + ] + } + } + } + }, + { + "active_time": 1717845436, + "biz_type": 0, + "category": "pir", + "create_time": 1717845436, + "icon": "smart/icon/ay1525749833414yotNt/977689dc3cf45a12a3b33f1d4cb9ff36.png", + "id": "bf69fec5a1a684d238owvx", + "ip": "176.165.222.155", + "lat": "42.76", + "local_key": "eZGu63iM^pjT$ngL", + "lon": "2.88", + "model": "", + "name": "D\u00e9tecteur salon", + "online": false, + "owner_id": "189260016", + "product_id": "rjzon9kyxpoeksj3", + "product_name": "Motion Sensor", + "status": [ + { + "code": "pir", + "value": "pir" + }, + { + "code": "battery_state", + "value": "low" + } + ], + "sub": false, + "time_zone": "+02:00", + "uid": "eu1712934899766oTQEN", + "update_time": 1744298259, + "uuid": "574dda4ae343b136", + "mapping": { + "1": { + "code": "pir", + "type": "Enum", + "values": { + "range": [ + "pir", + "none" + ] + } + }, + "3": { + "code": "battery_state", + "type": "Enum", + "values": { + "range": [ + "low", + "middle", + "high" + ] + } + } + } + }, + { + "active_time": 1716819182, + "biz_type": 0, + "category": "wsdcg", + "create_time": 1716819182, + "icon": "smart/icon/ay1574490117625MIxZY/f36a9d707612825b36fa56c607965fca.png", + "id": "bfada85ab6fee70349uhqc", + "ip": "176.165.222.155", + "lat": "42.76", + "local_key": "KbrKX|)Oy)eA_t>B", + "lon": "2.88", + "model": "TH08", + "name": "Temperature & Humidity Sensor", + "online": false, + "owner_id": "189260016", + "product_id": "43ykthb7hebzsuaf", + "product_name": "Temperature & Humidity Sensor", + "status": [ + { + "code": "va_temperature", + "value": 205 + }, + { + "code": "va_humidity", + "value": 47 + }, + { + "code": "battery_percentage", + "value": 0 + }, + { + "code": "temp_unit_convert", + "value": "c" + }, + { + "code": "maxtemp_set", + "value": 600 + }, + { + "code": "minitemp_set", + "value": -200 + }, + { + "code": "maxhum_set", + "value": 100 + }, + { + "code": "minihum_set", + "value": 0 + }, + { + "code": "temp_alarm", + "value": "cancel" + }, + { + "code": "hum_alarm", + "value": "cancel" + }, + { + "code": "temp_sensitivity", + "value": 3 + }, + { + "code": "hum_sensitivity", + "value": 3 + } + ], + "sub": false, + "time_zone": "+02:00", + "uid": "eu1712934899766oTQEN", + "update_time": 1738772703, + "uuid": "bdcf0249b328be57", + "mapping": { + "1": { + "code": "va_temperature", + "type": "Integer", + "values": { + "unit": "\u00b0C", + "min": -200, + "max": 600, + "scale": 1, + "step": 1 + } + }, + "2": { + "code": "va_humidity", + "type": "Integer", + "values": { + "unit": "%", + "min": 0, + "max": 100, + "scale": 0, + "step": 1 + } + }, + "4": { + "code": "battery_percentage", + "type": "Integer", + "values": { + "unit": "%", + "min": 0, + "max": 100, + "scale": 0, + "step": 1 + } + }, + "9": { + "code": "temp_unit_convert", + "type": "Enum", + "values": { + "range": [ + "c", + "f" + ] + } + }, + "10": { + "code": "maxtemp_set", + "type": "Integer", + "values": { + "unit": "\u00b0C", + "min": -200, + "max": 600, + "scale": 1, + "step": 1 + } + }, + "11": { + "code": "minitemp_set", + "type": "Integer", + "values": { + "unit": "\u00b0C", + "min": -200, + "max": 600, + "scale": 1, + "step": 1 + } + }, + "12": { + "code": "maxhum_set", + "type": "Integer", + "values": { + "unit": "%", + "min": 0, + "max": 100, + "scale": 0, + "step": 1 + } + }, + "13": { + "code": "minihum_set", + "type": "Integer", + "values": { + "unit": "%", + "min": 0, + "max": 100, + "scale": 0, + "step": 1 + } + }, + "14": { + "code": "temp_alarm", + "type": "Enum", + "values": { + "range": [ + "loweralarm", + "upperalarm", + "cancel" + ] + } + }, + "15": { + "code": "hum_alarm", + "type": "Enum", + "values": { + "range": [ + "loweralarm", + "upperalarm", + "cancel" + ] + } + }, + "19": { + "code": "temp_sensitivity", + "type": "Integer", + "values": { + "unit": "\u00b0C", + "min": 3, + "max": 20, + "scale": 1, + "step": 1 + } + }, + "20": { + "code": "hum_sensitivity", + "type": "Integer", + "values": { + "unit": "%", + "min": 3, + "max": 20, + "scale": 0, + "step": 1 + } + } + } + }, + { + "active_time": 1716060549, + "biz_type": 0, + "category": "dd", + "create_time": 1716060549, + "icon": "smart/program_category_icon/dd.png", + "id": "bf6c6b8d6dd0d74a1fnv9u", + "ip": "176.165.222.155", + "lat": "42.7646", + "local_key": "|'u(iF:-4Q~5dj6f", + "lon": "2.8775", + "model": "", + "name": "led chambre", + "online": false, + "owner_id": "189260016", + "product_id": "htvilqbp8xfctgke", + "product_name": "Smart Led Strip", + "status": [ + { + "code": "switch_led", + "value": true + }, + { + "code": "work_mode", + "value": "music" + }, + { + "code": "colour_data", + "value": "{\"h\":60,\"s\":1000,\"v\":1000}" + }, + { + "code": "scene_data", + "value": "{\"scene_num\":36,\"scene_units\":[{\"bright\":0,\"h\":0,\"s\":1000,\"temperature\":0,\"unit_change_mode\":\"gradient\",\"unit_gradient_duration\":80,\"unit_switch_duration\":80,\"v\":1000},{\"bright\":0,\"h\":240,\"s\":1000,\"temperature\":0,\"unit_change_mode\":\"gradient\",\"unit_gradient_duration\":70,\"unit_switch_duration\":70,\"v\":1000}]}" + }, + { + "code": "countdown", + "value": 0 + } + ], + "sub": false, + "time_zone": "+02:00", + "uid": "eu1712934899766oTQEN", + "update_time": 1738163756, + "uuid": "d05e1caed370504b", + "mapping": { + "20": { + "code": "switch_led", + "type": "Boolean", + "values": {} + }, + "21": { + "code": "work_mode", + "type": "Enum", + "values": { + "range": [ + "white", + "colour", + "scene", + "music" + ] + } + }, + "24": { + "code": "colour_data", + "type": "Json", + "raw_values": "{\"h\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1},\"v\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}}", + "values": { + "h": { + "min": 0, + "scale": 0, + "unit": "", + "max": 360, + "step": 1 + }, + "s": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + }, + "v": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + } + } + }, + "25": { + "code": "scene_data", + "type": "Json", + "raw_values": "{\"scene_num\":{\"min\":1,\"scale\":0,\"max\":8,\"step\":1},\"scene_units\": {\"unit_change_mode\":{\"range\":[\"static\",\"jump\",\"gradient\"]},\"unit_switch_duration\":{\"min\":0,\"scale\":0,\"max\":100,\"step\":1},\"unit_gradient_duration\":{\"min\":0,\"scale\":0,\"max\":100,\"step\":1},\"bright\":{\"min\":0,\"scale\":0,\"max\":1000,\"step\":1},\"temperature\":{\"min\":0,\"scale\":0,\"max\":1000,\"step\":1},\"h\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1},\"v\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}}}", + "values": { + "scene_num": { + "min": 1, + "scale": 0, + "max": 8, + "step": 1 + }, + "scene_units": { + "unit_change_mode": { + "range": [ + "static", + "jump", + "gradient" + ] + }, + "unit_switch_duration": { + "min": 0, + "scale": 0, + "max": 100, + "step": 1 + }, + "unit_gradient_duration": { + "min": 0, + "scale": 0, + "max": 100, + "step": 1 + }, + "bright": { + "min": 0, + "scale": 0, + "max": 1000, + "step": 1 + }, + "temperature": { + "min": 0, + "scale": 0, + "max": 1000, + "step": 1 + }, + "h": { + "min": 0, + "scale": 0, + "unit": "", + "max": 360, + "step": 1 + }, + "s": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + }, + "v": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + } + } + } + }, + "26": { + "code": "countdown", + "type": "Integer", + "values": { + "min": 0, + "max": 86400, + "scale": 0, + "step": 1 + } + }, + "27": { + "code": "music_data", + "type": "Json", + "raw_values": "{\"change_mode\":{\"range\":[\"direct\",\"gradient\"]}, \"bright\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}, \"temperature\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}, \"h\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1},\"v\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1}}", + "values": { + "change_mode": { + "range": [ + "direct", + "gradient" + ] + }, + "bright": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + }, + "temperature": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + }, + "h": { + "min": 0, + "scale": 0, + "unit": "", + "max": 360, + "step": 1 + }, + "s": { + "min": 0, + "scale": 0, + "unit": "", + "max": 255, + "step": 1 + }, + "v": { + "min": 0, + "scale": 0, + "unit": "", + "max": 255, + "step": 1 + } + } + }, + "28": { + "code": "control_data", + "type": "Json", + "raw_values": "{\"change_mode\":{\"range\":[\"direct\",\"gradient\"]}, \"bright\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}, \"temperature\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}, \"h\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1},\"v\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1}}", + "values": { + "change_mode": { + "range": [ + "direct", + "gradient" + ] + }, + "bright": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + }, + "temperature": { + "min": 0, + "scale": 0, + "unit": "", + "max": 1000, + "step": 1 + }, + "h": { + "min": 0, + "scale": 0, + "unit": "", + "max": 360, + "step": 1 + }, + "s": { + "min": 0, + "scale": 0, + "unit": "", + "max": 255, + "step": 1 + }, + "v": { + "min": 0, + "scale": 0, + "unit": "", + "max": 255, + "step": 1 + } + } + } + } + }, + { + "active_time": 1719072324, + "biz_type": 0, + "category": "tdq", + "create_time": 1719072324, + "icon": "smart/icon/bay1669863773544vjP7/c21e4d0df44fb5e03b78aa6391f67e19.png", + "id": "bf05a9e59025d05c0ccsew", + "ip": "176.165.222.155", + "lat": "42.76", + "local_key": "K;J1v3PLhh-7(9{#", + "lon": "2.88", + "model": "", + "name": "spa", + "online": false, + "owner_id": "189260016", + "product_id": "9htyiowaf5rtdhrv", + "product_name": "1-433", + "status": [ + { + "code": "switch_1", + "value": false + }, + { + "code": "countdown_1", + "value": 0 + }, + { + "code": "relay_status", + "value": "2" + }, + { + "code": "random_time", + "value": "" + }, + { + "code": "cycle_time", + "value": "" + }, + { + "code": "switch_inching", + "value": "AAAC" + }, + { + "code": "switch_type", + "value": "button" + }, + { + "code": "remote_add", + "value": "" + }, + { + "code": "remote_list", + "value": "AA==" + } + ], + "sub": false, + "time_zone": "+02:00", + "uid": "eu1712934899766oTQEN", + "update_time": 1732894043, + "uuid": "fc0501283a938468", + "mapping": { + "1": { + "code": "switch_1", + "type": "Boolean", + "values": {} + }, + "9": { + "code": "countdown_1", + "type": "Integer", + "values": { + "unit": "s", + "min": 0, + "max": 86400, + "scale": 0, + "step": 1 + } + }, + "38": { + "code": "relay_status", + "type": "Enum", + "values": { + "range": [ + "0", + "1", + "2" + ] + } + }, + "42": { + "code": "random_time", + "type": "String", + "values": "{\"maxlen\":255}" + }, + "43": { + "code": "cycle_time", + "type": "String", + "values": "{\"maxlen\":255}" + }, + "44": { + "code": "switch_inching", + "type": "String", + "values": "{\"maxlen\":255}" + }, + "47": { + "code": "switch_type", + "type": "Enum", + "values": { + "range": [ + "flip", + "sync", + "button" + ] + } + }, + "49": { + "code": "remote_add", + "type": "Raw", + "values": {} + }, + "50": { + "code": "remote_list", + "type": "Raw", + "values": {} + } + } + }, + { + "active_time": 1717844777, + "biz_type": 0, + "category": "mcs", + "create_time": 1717844777, + "icon": "smart/icon/ay1574490117625MIxZY/fa22e30b32b420105d0d6090fdd93c39.png", + "id": "bfdce72165f5206a4elrrf", + "ip": "176.165.222.155", + "lat": "42.76", + "local_key": "ZHr<|SN!)s5)Yo[9", + "lon": "2.88", + "model": "Door Sensor", + "name": "Capteur porte garage", + "online": false, + "owner_id": "189260016", + "product_id": "g2uishoy2nasxgz0", + "product_name": "Contact Sensor", + "status": [ + { + "code": "doorcontact_state", + "value": true + }, + { + "code": "battery_percentage", + "value": 100 + } + ], + "sub": false, + "time_zone": "+02:00", + "uid": "eu1712934899766oTQEN", + "update_time": 1721762490, + "uuid": "1ef4672efcd20da1", + "mapping": { + "1": { + "code": "doorcontact_state", + "type": "Boolean", + "values": {} + }, + "2": { + "code": "battery_percentage", + "type": "Integer", + "values": { + "unit": "%", + "min": 0, + "max": 100, + "scale": 0, + "step": 1 + } + } + } + }, + { + "active_time": 1715776345, + "biz_type": 0, + "category": "cz", + "create_time": 1715776345, + "icon": "smart/icon/ay15609465299162YKk0/70f4532fde246db2e3f6cc3173f6c732.png", + "id": "bffa5d4e1ba85ea64dm09r", + "ip": "176.165.222.155", + "lat": "42.7645", + "local_key": "0{C{XEr_f>+wQq5g", + "lon": "2.8775", + "model": "KR2201WB3", + "name": "lumi\u00e8re cuisine", + "online": false, + "owner_id": "189260016", + "product_id": "cs4ooidd4toa2yon", + "product_name": "QIACHIP Smart Switch ", + "status": [ + { + "code": "switch_1", + "value": true + }, + { + "code": "countdown_1", + "value": 0 + }, + { + "code": "relay_status", + "value": "last" + }, + { + "code": "child_lock", + "value": false + }, + { + "code": "cycle_time", + "value": "" + }, + { + "code": "random_time", + "value": "" + }, + { + "code": "switch_inching", + "value": "" + } + ], + "sub": false, + "time_zone": "+02:00", + "uid": "eu1712934899766oTQEN", + "update_time": 1719423462, + "uuid": "56a48840b68b4009", + "mapping": { + "1": { + "code": "switch_1", + "type": "Boolean", + "values": {} + }, + "9": { + "code": "countdown_1", + "type": "Integer", + "values": { + "unit": "s", + "min": 0, + "max": 86400, + "scale": 0, + "step": 1 + } + }, + "38": { + "code": "relay_status", + "type": "Enum", + "values": { + "range": [ + "power_off", + "power_on", + "last" + ] + } + }, + "41": { + "code": "child_lock", + "type": "Boolean", + "values": {} + }, + "42": { + "code": "cycle_time", + "type": "String", + "values": "{}" + }, + "43": { + "code": "random_time", + "type": "String", + "values": "{}" + }, + "44": { + "code": "switch_inching", + "type": "String", + "values": "{}" + } + } + }, + { + "active_time": 1717845214, + "biz_type": 0, + "category": "mcs", + "create_time": 1717845214, + "icon": "smart/icon/ay1574490117625MIxZY/fa22e30b32b420105d0d6090fdd93c39.png", + "id": "bfbb6b0de6a38d203brz09", + "ip": "176.165.222.155", + "lat": "42.76", + "local_key": "'<9=TIE^M=wvSD.{", + "lon": "2.88", + "model": "Door Sensor", + "name": "capteur porte garage 2", + "online": false, + "owner_id": "189260016", + "product_id": "g2uishoy2nasxgz0", + "product_name": "Contact Sensor", + "status": [ + { + "code": "doorcontact_state", + "value": true + }, + { + "code": "battery_percentage", + "value": 100 + } + ], + "sub": false, + "time_zone": "+02:00", + "uid": "eu1712934899766oTQEN", + "update_time": 1718883531, + "uuid": "857a104aaa398798", + "mapping": { + "1": { + "code": "doorcontact_state", + "type": "Boolean", + "values": {} + }, + "2": { + "code": "battery_percentage", + "type": "Integer", + "values": { + "unit": "%", + "min": 0, + "max": 100, + "scale": 0, + "step": 1 + } + } + } + }, + { + "active_time": 1717843104, + "biz_type": 0, + "category": "szjqr", + "create_time": 1717843104, + "icon": "smart/icon/bay1618467175599MrKr/9b0ac1affcafaa8cff9fad2e3ef5abae.png", + "id": "bfb7dbulpek8mg43", + "ip": "", + "lat": "42.76", + "local_key": "rSC|I}UjaYb60eLM", + "lon": "2.88", + "model": "CBTB3002", + "name": "lave vaisselle", + "online": false, + "owner_id": "189260016", + "product_id": "xhf790if", + "product_name": "CUBETOUCH II", + "status": [ + { + "code": "switch", + "value": false + }, + { + "code": "mode", + "value": "click" + }, + { + "code": "click_sustain_time", + "value": 2 + }, + { + "code": "arm_down_percent", + "value": 0 + }, + { + "code": "arm_up_percent", + "value": 100 + }, + { + "code": "charge_status", + "value": "none" + }, + { + "code": "battery_percentage", + "value": 10 + } + ], + "sub": false, + "time_zone": "+02:00", + "uid": "eu1712934899766oTQEN", + "update_time": 1717843118, + "uuid": "9adfc604f5b871a9", + "mapping": { + "1": { + "code": "switch", + "type": "Boolean", + "values": {} + }, + "2": { + "code": "mode", + "type": "Enum", + "values": { + "range": [ + "click" + ] + } + }, + "3": { + "code": "click_sustain_time", + "type": "Integer", + "values": { + "unit": "s", + "min": 0, + "max": 10, + "scale": 0, + "step": 1 + } + }, + "5": { + "code": "arm_down_percent", + "type": "Integer", + "values": { + "unit": "%", + "min": 0, + "max": 100, + "scale": 0, + "step": 1 + } + }, + "6": { + "code": "arm_up_percent", + "type": "Integer", + "values": { + "unit": "%", + "min": 0, + "max": 100, + "scale": 0, + "step": 1 + } + }, + "7": { + "code": "charge_status", + "type": "Enum", + "values": { + "range": [ + "none", + "charging", + "charge_done" + ] + } + }, + "8": { + "code": "battery_percentage", + "type": "Integer", + "values": { + "unit": "%", + "min": 0, + "max": 100, + "scale": 0, + "step": 1 + } + } + } + } + ], + "success": true, + "t": 1745608488155, + "tid": "8dec7df3220911f0bfcc7a9b25a12206", + "file": { + "name": "tuya-raw.json", + "description": "Full raw list of Tuya devices.", + "account": "fdjdjurkm34yyjp77c7d", + "date": "2025-04-25T21:14:46.685364", + "tinytuya": "1.16.1" + } +} \ No newline at end of file