Closed mxsob closed 1 year ago
Пришлите полную JSON этого терморегулятора, постараюсь добавить
нужно выцепить из результаты из API SST ? у меня тоже ОКЕ стоят .
Да, вот здесь я описывал как это сделать, если будут вопросы пишите в телеграм https://github.com/sergeylysov/sst_cloud/issues/2#issuecomment-1111997255
Вот JSON от OKE-20 (OK Electro)
[{"id":234221,"configuration":"AlRBUgClVAADFQEDUwAGAQECFhYAQwBUAaQWAf4QBHQWBLAQAaQWAf4QBHQWBLAQAaQWAf4QBHQWBLAQAaQWAf4QBHQWBLAQAaQWAf4QBHQWBLAQAeAWAhwQBLAWBQoQAeAWAhwQBLAWBQoQSQAFTzExMjFNABEzMDpBRTpBNDoxRjpBMjo0NEEAAQBaAAEBTAADAq0dRAAKMTY3ODgyODA0N1cAAQRIAAEA930=","parsed_configuration":"{\"chart\": [[\"monday\", [{\"init_time\": \"07:00:00\", \"temperature\": 22}, {\"init_time\": \"08:30:00\", \"temperature\": 16}, {\"init_time\": \"19:00:00\", \"temperature\": 22}, {\"init_time\": \"20:00:00\", \"temperature\": 16}]], [\"tuesday\", [{\"init_time\": \"07:00:00\", \"temperature\": 22}, {\"init_time\": \"08:30:00\", \"temperature\": 16}, {\"init_time\": \"19:00:00\", \"temperature\": 22}, {\"init_time\": \"20:00:00\", \"temperature\": 16}]], [\"wednesday\", [{\"init_time\": \"07:00:00\", \"temperature\": 22}, {\"init_time\": \"08:30:00\", \"temperature\": 16}, {\"init_time\": \"19:00:00\", \"temperature\": 22}, {\"init_time\": \"20:00:00\", \"temperature\": 16}]], [\"thursday\", [{\"init_time\": \"07:00:00\", \"temperature\": 22}, {\"init_time\": \"08:30:00\", \"temperature\": 16}, {\"init_time\": \"19:00:00\", \"temperature\": 22}, {\"init_time\": \"20:00:00\", \"temperature\": 16}]], [\"friday\", [{\"init_time\": \"07:00:00\", \"temperature\": 22}, {\"init_time\": \"08:30:00\", \"temperature\": 16}, {\"init_time\": \"19:00:00\", \"temperature\": 22}, {\"init_time\": \"20:00:00\", \"temperature\": 16}]], [\"saturday\", [{\"init_time\": \"08:00:00\", \"temperature\": 22}, {\"init_time\": \"09:00:00\", \"temperature\": 16}, {\"init_time\": \"20:00:00\", \"temperature\": 22}, {\"init_time\": \"21:30:00\", \"temperature\": 16}]], [\"sunday\", [{\"init_time\": \"08:00:00\", \"temperature\": 22}, {\"init_time\": \"09:00:00\", \"temperature\": 16}, {\"init_time\": \"20:00:00\", \"temperature\": 22}, {\"init_time\": \"21:30:00\", \"temperature\": 16}]]], \"detector\": 1, \"settings\": {\"mode\": \"chart\", \"status\": \"on\", \"light_mode\": 2, \"temperature_love\": 22, \"temperature_manual\": 22, \"temperature_correction_air\": 0}, \"device_id\": \"O1121\", \"mac_address\": \"30:AE:A4:1F:A2:44\", \"relay_status\": \"off\", \"signal_level\": 4, \"access_status\": \"available\", \"current_temperature\": {\"event\": 3, \"day_of_week\": 1, \"temperature_floor\": 21}}","timeout":180,"time_setting":{"id":127496,"workday_time_range":[["07:00:00","08:30:00"],["19:00:00","20:00:00"]],"vacation_time_range":[["08:00:00","09:00:00"],["20:00:00","21:30:00"]],"device":234221},"group":null,"active_network":22337,"specific_settings":{},"created_at":"2022-10-02T08:29:09.642866Z","updated_at":"2023-03-14T16:07:29.272581Z","name":"Столовая","type":5,"previous_mode":null,"is_active":true,"is_connected":true,"mac_address":"30:AE:A4:1F:A2:44","power":100,"power_relay_time":"41129","chart_temperature_comfort":22,"chart_temperature_economical":16,"wireless_sensors_names":[],"line_names":["line-1","line-2","line-3","line-4"],"lines_enabled":[true,true,true,true],"house":8839},{"id":78762,"configuration":"AlRBUgClVAADFgECUwAGAQECFg8AQwBUAaQWAf4SBM4WBSgSAaQWAf4SBM4WBSgSAaQWAf4SBM4WBSgSAaQWAf4SBM4WBSgSAaQWAf4SBM4WBSgSAcIWAhwSBLAWBSgSAcIWAhwSBLAWBSgSSQAFTzExMjFNABEzMDpBRTpBNDozRjo5Qzo3Q0EAAQBaAAEBTAADDM8uRAAKMTY3ODgyNTgxMFcAAQRIAAEA0co=","parsed_configuration":"{\"chart\": [[\"monday\", [{\"init_time\": \"07:00:00\", \"temperature\": 22}, {\"init_time\": \"08:30:00\", \"temperature\": 18}, {\"init_time\": \"20:30:00\", \"temperature\": 22}, {\"init_time\": \"22:00:00\", \"temperature\": 18}]], [\"tuesday\", [{\"init_time\": \"07:00:00\", \"temperature\": 22}, {\"init_time\": \"08:30:00\", \"temperature\": 18}, {\"init_time\": \"20:30:00\", \"temperature\": 22}, {\"init_time\": \"22:00:00\", \"temperature\": 18}]], [\"wednesday\", [{\"init_time\": \"07:00:00\", \"temperature\": 22}, {\"init_time\": \"08:30:00\", \"temperature\": 18}, {\"init_time\": \"20:30:00\", \"temperature\": 22}, {\"init_time\": \"22:00:00\", \"temperature\": 18}]], [\"thursday\", [{\"init_time\": \"07:00:00\", \"temperature\": 22}, {\"init_time\": \"08:30:00\", \"temperature\": 18}, {\"init_time\": \"20:30:00\", \"temperature\": 22}, {\"init_time\": \"22:00:00\", \"temperature\": 18}]], [\"friday\", [{\"init_time\": \"07:00:00\", \"temperature\": 22}, {\"init_time\": \"08:30:00\", \"temperature\": 18}, {\"init_time\": \"20:30:00\", \"temperature\": 22}, {\"init_time\": \"22:00:00\", \"temperature\": 18}]], [\"saturday\", [{\"init_time\": \"07:30:00\", \"temperature\": 22}, {\"init_time\": \"09:00:00\", \"temperature\": 18}, {\"init_time\": \"20:00:00\", \"temperature\": 22}, {\"init_time\": \"22:00:00\", \"temperature\": 18}]], [\"sunday\", [{\"init_time\": \"07:30:00\", \"temperature\": 22}, {\"init_time\": \"09:00:00\", \"temperature\": 18}, {\"init_time\": \"20:00:00\", \"temperature\": 22}, {\"init_time\": \"22:00:00\", \"temperature\": 18}]]], \"detector\": 1, \"settings\": {\"mode\": \"chart\", \"status\": \"on\", \"light_mode\": 2, \"temperature_love\": 15, \"temperature_manual\": 22, \"temperature_correction_air\": 0}, \"device_id\": \"O1121\", \"mac_address\": \"30:AE:A4:3F:9C:7C\", \"relay_status\": \"off\", \"signal_level\": 4, \"access_status\": \"available\", \"current_temperature\": {\"event\": 2, \"day_of_week\": 1, \"temperature_floor\": 22}}","timeout":180,"time_setting":{"id":37127,"workday_time_range":[["07:00:00","08:30:00"],["20:30:00","22:00:00"]],"vacation_time_range":[["07:30:00","09:00:00"],["20:00:00","22:00:00"]],"device":78762},"group":null,"active_network":22337,"specific_settings":{},"created_at":"2019-11-22T18:12:41.279232Z","updated_at":"2023-03-14T16:01:46.851465Z","name":"Ванная","type":5,"previous_mode":"chart","is_active":true,"is_connected":true,"mac_address":"30:AE:A4:3F:9C:7C","power":100,"power_relay_time":"196786","chart_temperature_comfort":22,"chart_temperature_economical":18,"wireless_sensors_names":[],"line_names":["line-1","line-2","line-3","line-4"],"lines_enabled":[true,true,true,true],"house":8839}]
Ну и вот вроде есть описание всего запроса: `HTTP 200 OK Allow: GET, POST, OPTIONS Content-Type: application/json Vary: Accept
{ "name": "Device List", "description": "", "renders": [ "application/json", "text/html" ], "parses": [ "application/json", "application/x-www-form-urlencoded", "multipart/form-data" ], "actions": { "POST": { "id": { "type": "integer", "required": false, "read_only": true, "label": "ID" }, "configuration": { "type": "field", "required": false, "read_only": false, "label": "Configuration" }, "parsed_configuration": { "type": "field", "required": false, "read_only": true, "label": "Parsed configuration" }, "timeout": { "type": "field", "required": false, "read_only": true, "label": "Timeout" }, "time_setting": { "type": "nested object", "required": false, "read_only": false, "label": "Time setting", "children": { "id": { "type": "integer", "required": false, "read_only": true, "label": "ID" }, "workday_time_range": { "type": "list", "required": false, "read_only": false, "label": "Workday time range", "child": { "type": "list", "required": false, "read_only": false, "label": "Workday time range", "child": { "type": "time", "required": false, "read_only": false, "label": "Workday time range" } } }, "vacation_time_range": { "type": "list", "required": false, "read_only": false, "label": "Vacation time range", "child": { "type": "list", "required": false, "read_only": false, "label": "Vacation time range", "child": { "type": "time", "required": false, "read_only": false, "label": "Vacation time range" } } }, "device": { "type": "field", "required": false, "read_only": true, "label": "Device" } } }, "group": { "type": "field", "required": false, "read_only": false, "label": "Group" }, "active_network": { "type": "field", "required": false, "read_only": false, "label": "Active network" }, "specific_settings": { "type": "field", "required": false, "read_only": false, "label": "Specific settings" }, "created_at": { "type": "datetime", "required": false, "read_only": true, "label": "Created at" }, "updated_at": { "type": "datetime", "required": false, "read_only": true, "label": "Updated at" }, "name": { "type": "string", "required": false, "read_only": false, "label": "Name", "max_length": 128 }, "type": { "type": "choice", "required": false, "read_only": false, "label": "Тип устройства", "choices": [ { "value": 0, "display_name": "mcs300" }, { "value": 1, "display_name": "mcs350" }, { "value": 2, "display_name": "Neptun" }, { "value": 3, "display_name": "Equation" }, { "value": 4, "display_name": "Equation ProW+WiFi" }, { "value": 5, "display_name": "OK Electro" }, { "value": 6, "display_name": "EcoSmart 25" }, { "value": 7, "display_name": "Neptun Smart" } ] }, "previous_mode": { "type": "string", "required": false, "read_only": false, "label": "Previous mode", "max_length": 10 }, "is_active": { "type": "boolean", "required": false, "read_only": true, "label": "Устройство активированно" }, "is_connected": { "type": "boolean", "required": false, "read_only": false, "label": "Is connected" }, "mac_address": { "type": "string", "required": false, "read_only": false, "label": "Mac address", "max_length": 20 }, "power": { "type": "integer", "required": false, "read_only": false, "label": "Power", "min_value": 0, "max_value": 2147483647 }, "power_relay_time": { "type": "string", "required": false, "read_only": true, "label": "Power relay time" }, "chart_temperature_comfort": { "type": "integer", "required": false, "read_only": false, "label": "Chart temperature comfort", "min_value": -2147483648, "max_value": 2147483647 }, "chart_temperature_economical": { "type": "integer", "required": false, "read_only": false, "label": "Chart temperature economical", "min_value": -2147483648, "max_value": 2147483647 }, "wireless_sensors_names": { "type": "list", "required": false, "read_only": false, "label": "Wireless sensors names", "child": { "type": "string", "required": false, "read_only": false, "label": "Wireless sensors names", "max_length": 64 } }, "line_names": { "type": "list", "required": false, "read_only": false, "label": "Line names", "child": { "type": "string", "required": false, "read_only": false, "label": "Line names", "max_length": 64 } }, "lines_enabled": { "type": "list", "required": false, "read_only": false, "label": "Lines enabled", "child": { "type": "boolean", "required": false, "read_only": false, "label": "Lines enabled" } }, "house": { "type": "field", "required": false, "read_only": true, "label": "Домовладения" } } } }`
Опубликовал v0.1.20 проверьте пожалуйста
Спасибо! У меня выдает ошибку при загрузке конфигурации HA 2023.3.4 HACS 1.31.0
2023-03-15 14:01:58.316 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry **@gmail.com for sst_cloud Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 383, in async_setup result = await component.async_setup_entry(hass, self) File "/config/custom_components/sst_cloud/init.py", line 16, in async_setup_entry await hass.async_add_executor_job( File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) File "/config/custom_components/sst_cloud/sst.py", line 47, in pull_data self.devices.append(ThermostatEcosmart25(json_device, self)) File "/config/custom_components/sst_cloud/sst.py", line 170, in init super().init(moduleDescription,sst) File "/config/custom_components/sst_cloud/sst.py", line 61, in init self._current_temperature_air = self.config["current_temperature"]["temperature_air"] KeyError: 'temperature_air'
Добавлена поддержка в v0.1.22
Отлично все работает. Спасибо. Только вопрос? интеграция только объекты создает. устройства не добавляет? или через HACS это нельзя сделать?
Вроде должно быть устройство терморегулятор
Отлично все работает. Спасибо. Только вопрос? интеграция только объекты создает. устройства не добавляет? или через HACS это нельзя сделать?
Появляется устройство с моделью "Thermostat Equation", через HACS.
Да, похоже такое и создает, просто по функционалу они одинаковые, поэтому сделал на основе Thermostat Equation, по возможности постараюсь поменять название позже.
Ну название то не критично можно переименовать, а вот удобно было бы иметь отдельно датчик температуры. И там еще расход энергии кажется есть.
Заведите отдельный issue, чтобы было мне напоминание, а лучше 2, на датчик температуры и на расход энергии, по возможности сделаю
Можно ли добавить поддержку терморегулятора OKE-20? type=5