Беда. Кодировку нужно менять?
Сохраните в формате txt, если можете.
Вот ваш файл в правильном формате. Но в нем есть ошибки - прогоните его через любой JSON валидатор, пока не пройдет - работать не будет.
Gree1.txt (15,8 КБ)
не понимаю, почему расширение меняется на txt - поменяйте на json
Gree.Vilidate.pages (160,4 КБ)
Провёл через валидацию, закинул в указанную папку (при загрузке изменил расширение page на json) и сделал service wb-mqtt-serial restart. Всё равно не появляется в выборе устройств.
Gree5 (1).json (1,7 КБ)
этот шаблон появился в выборе устройств. Но, когда его выбираешь в вэб интерфейсе просто белый экран появляется , убирается обновлением страницы.
Теперь надо смотреть логи, искать ошибки.
Ошибка при добавлении устройства: Server error: File: /etc/wb-mqtt-serial.conf.d/templates/deepGreeValidSerial_1.json error: Validation failed.
Error 1
context: [device][channels][1][reg_type]
desc: Failed to match against any enum values.
Error 2
context: [device][channels][1]
desc: Failed to validate against schema associated with property name ‘reg_type’.
Error 3
context: [device][channels][1]
desc: Failed to validate against child schema #0.
Error 4
context: [device][channels][1]
desc: Failed to validate against child schema #0.
Error 5
context: [device][channels][1]
desc: Missing required property ‘consists_of’.
Error 6
context: [device][channels][1]
desc: Failed to validate against child schema #1.
Error 7
context: [device][channels][1][reg_type]
desc: Failed to match against any enum values.
Error 8
context: [device][channels][1]
desc: Failed to validate against schema associated with property name ‘reg_type’.
Error 9
context: [device][channels][1]
desc: Failed to validate against child schema #0.
Error 10
context: [device][channels][1]
desc: Failed to validate against child schema #2.
Error 11
context: [device][channels][1][reg_type]
desc: Failed to match against any enum values.
Error 12
context: [device][channels][1]
desc: Failed to validate against schema associated with property name ‘reg_type’.
Error 13
context: [device][channels][1]
desc: Failed to validate against child schema #0.
Error 14
context: [device][channels][1]
desc: Failed to validate against child schema #3.
Error 15
context: [device][channels][1]
desc: Failed to validate against any child schemas allowed by oneOf constraint.
Error 16
context: [device][channels][1]
desc: Failed to validate against child schema #0.
Error 17
context: [device][channels][1]
desc: Failed to validate against child schema #0.
Error 18
context: [device][channels][1]
desc: Missing required property ‘device_type’.
Error 19
context: [device][channels][1]
desc: Failed to validate against child schema #1.
Error 20
context: [device][channels][1]
desc: Failed to validate against any child schemas allowed by oneOf constraint.
Error 21
context: [device][channels]
desc: Failed to validate item #1 in array.
Error 22
context: [device][channels][2][reg_type]
desc: Failed to match against any enum values.
Error 23
context: [device][channels][2]
desc: Failed to validate against schema associated with property name ‘reg_type’.
Error 24
context: [device][channels][2]
desc: Failed to validate against child schema #0.
Error 25
context: [device][channels][2]
desc: Failed to validate against child schema #0.
Error 26
context: [device][channels][2]
desc: Missing required property ‘consists_of’.
Error 27
context: [device][channels][2]
desc: Failed to validate against child schema #1.
Error 28
context: [device][channels][2][reg_type]
desc: Failed to match against any enum values.
Error 29
context: [device][channels][2]
desc: Failed to validate against schema associated with property name ‘reg_type’.
Error 30
context: [device][channels][2]
desc: Failed to validate against child schema #0.
Error 31
context: [device][channels][2]
desc: Failed to validate against child schema #2.
Error 32
context: [device][channels][2][reg_type]
desc: Failed to match against any enum values.
Error 33
context: [device][channels][2]
desc: Failed to validate against schema associated with property name ‘reg_type’.
Error 34
context: [device][channels][2]
desc: Failed to validate against child schema #0.
Error 35
context: [device][channels][2]
desc: Failed to validate against child schema #3.
Error 36
context: [device][channels][2]
desc: Failed to validate against any child schemas allowed by oneOf constraint.
Error 37
context: [device][channels][2]
desc: Failed to validate against child schema #0.
Error 38
context: [device][channels][2]
desc: Failed to validate against child schema #0.
Error 39
context: [device][channels][2]
desc: Missing required property ‘device_type’.
Error 40
context: [device][channels][2]
desc: Failed to validate against child schema #1.
Error 41
context: [device][channels][2]
desc: Failed to validate against any child schemas allowed by oneOf constraint.
Error 42
context: [device][channels]
desc: Failed to validate item #2 in array.
Error 43
context: [device][channels][3][reg_type]
desc: Failed to match against any enum values.
Error 44
context: [device][channels][3]
desc: Failed to validate against schema associated with property name ‘reg_type’.
Error 45
context: [device][channels][3]
desc: Failed to validate against child schema #0.
Error 46
context: [device][channels][3]
desc: Failed to validate against child schema #0.
Error 47
context: [device][channels][3]
desc: Missing required property ‘consists_of’.
Error 48
context: [device][channels][3]
desc: Failed to validate against child schema #1.
Error 49
context: [device][channels][3][reg_type]
desc: Failed to match against any enum values.
Error 50
context: [device][channels][3]
desc: Failed to validate against schema associated with property name ‘reg_type’.
Error 51
context: [device][channels][3]
desc: Failed to validate against child schema #0.
Error 52
context: [device][channels][3]
desc: Failed to validate against child schema #2.
Error 53
context: [device][channels][3][reg_type]
desc: Failed to match against any enum values.
Error 54
context: [device][channels][3]
desc: Failed to validate against schema associated with property name ‘reg_type’.
Error 55
context: [device][channels][3]
desc: Failed to validate against child schema #0.
Error 56
context: [device][channels][3]
desc: Failed to validate against child schema #3.
Error 57
context: [device][channels][3]
desc: Failed to validate against any child schemas allowed by oneOf constraint.
Error 58
context: [device][channels][3]
desc: Failed to validate against child schema #0.
Error 59
context: [device][channels][3]
desc: Failed to validate against child schema #0.
Error 60
context: [device][channels][3]
desc: Missing required property ‘device_type’.
Error 61
context: [device][channels][3]
desc: Failed to validate against child schema #1.
Error 62
context: [device][channels][3]
desc: Failed to validate against any child schemas allowed by oneOf constraint.
Error 63
context: [device][channels]
desc: Failed to validate item #3 in array.
Error 64
context: [device][channels][5][reg_type]
desc: Failed to match against any enum values.
Error 65
context: [device][channels][5]
desc: Failed to validate against schema associated with property name ‘reg_type’.
Error 66
context: [device][channels][5]
desc: Failed to validate against child schema #0.
Error 67
context: [device][channels][5]
desc: Failed to validate against child schema #0.
Error 68
context: [device][channels][5]
desc: Missing required property ‘consists_of’.
Error 69
context: [device][channels][5]
desc: Failed to validate against child schema #1.
Error 70
context: [device][channels][5][reg_type]
desc: Failed to match against any enum values.
Error 71
context: [device][channels][5]
desc: Failed to validate against schema associated with property name ‘reg_type’.
Error 72
context: [device][channels][5]
desc: Failed to validate against child schema #0.
Error 73
context: [device][channels][5]
desc: Failed to validate against child schema #2.
Error 74
context: [device][channels][5][reg_type]
desc: Failed to match against any enum values.
Error 75
context: [device][channels][5]
desc: Failed to validate against schema associated with property name ‘reg_type’.
Error 76
context: [device][channels][5]
desc: Failed to validate against child schema #0.
Error 77
context: [device][channels][5]
desc: Failed to validate against child schema #3.
Error 78
context: [device][channels][5]
desc: Failed to validate against any child schemas allowed by oneOf constraint.
Error 79
context: [device][channels][5]
desc: Failed to validate against child schema #0.
Error 80
context: [device][channels][5]
desc: Failed to validate against child schema #0.
Error 81
context: [device][channels][5]
desc: Missing required property ‘device_type’.
Error 82
context: [device][channels][5]
desc: Failed to validate against child schema #1.
Error 83
context: [device][channels][5]
desc: Failed to validate against any child schemas allowed by oneOf constraint.
Error 84
context: [device][channels]
desc: Failed to validate item #5 in array.
Error 85
context: [device]
desc: Failed to validate against schema associated with property name ‘channels’.
Error 86
context: [device]
desc: Failed to validate against child schema #2.
Error 87
context: [device]
desc: Failed to validate against child schema #0.
Error 88
context: [device]
desc: Failed to validate against any child schemas allowed by oneOf constraint.
Error 89
context:
desc: Failed to validate against schema associated with property name ‘device’.
. Детальную информацию можно посмотреть в системном журнале wb-mqtt-serial
deepGreeValidSerial_1.json (3,8 КБ)
шаблон проходит валидацию, но контроллер не хочет его подгружать.
“Валидация” говорит о том что json не имеет ошибок в структуре.
Теперь - проверьте что объекты, описанные в шаблоне соответствуют документации сервиса.
Для примера
{
"title": "Gree GMV",
"device_type": "GreeGMV_1x6",
"group": "g-air-conditioning",
"device": {
"name": "Gree GMV System",
"id": "Gree GMV System",
"response_timeout_ms": 500,
"guard_interval_us": 5000,
"channels": [
{
"name": "Serial",
"enabled": false,
"reg_type": "holding",
"address": 101,
"type": "text",
"format": "u32",
"readonly": true
}
]
}
}
работает
да, работает. Сейчас с температурой не могу разобраться. Не получается с моего шаблона задать температуру.
01-08-2025 16:16:20.321 WARNING: [register handler] failed to write: <</dev/ttyMOD2 9600 8 N 1> modbus:9:holding: 104>: Serial protocol error: request timed out
01-08-2025 16:16:19.734 WARNING: [register handler] failed to write: <</dev/ttyMOD2 9600 8 N 1> modbus:9:holding: 104>: Serial protocol error: request timed out
01-08-2025 16:16:19.148 WARNING: [register handler] failed to write: <</dev/ttyMOD2 9600 8 N 1> modbus:9:holding: 104>: Serial protocol error: request timed out
01-08-2025 16:16:18.561 WARNING: [register handler] failed to write: <</dev/ttyMOD2 9600 8 N 1> modbus:9:holding: 104>: Serial protocol error: request timed out
01-08-2025 16:16:17.974 WARNING: [register handler] failed to write: <</dev/ttyMOD2 9600 8 N 1> modbus:9:holding: 104>: Serial protocol error: request timed out
01-08-2025 16:16:17.388 WARNING: [register handler] failed to write: <</dev/ttyMOD2 9600 8 N 1> modbus:9:holding: 104>: Serial protocol error: request timed out
01-08-2025 16:16:16.802 WARNING: [register handler] failed to write: <</dev/ttyMOD2 9600 8 N 1> modbus:9:holding: 104>: Serial protocol error: request timed out
01-08-2025 16:16:16.216 WARNING: [register handler] failed to write: <</dev/ttyMOD2 9600 8 N 1> modbus:9:holding: 104>: Serial protocol error: request timed out
01-08-2025 16:16:15.629 WARNING: [register handler] failed to write: <</dev/ttyMOD2 9600 8 N 1> modbus:9:holding: 104>: Serial protocol error: request timed out
01-08-2025 16:16:15.043 WARNING: [register handler] failed to write: <</dev/ttyMOD2 9600 8 N 1> modbus:9:holding: 104>: Serial protocol error: request timed out
01-08-2025 16:16:14.457 WARNING: [register handler] failed to write: <</dev/ttyMOD2 9600 8 N 1> modbus:9:holding: 104>: Serial protocol error: request timed out
01-08-2025 16:16:13.870 WARNING: [register handler] failed to write: <</dev/ttyMOD2 9600 8 N 1> modbus:9:holding: 104>: Serial protocol error: request timed out
01-08-2025 16:16:13.285 WARNING: [register handler] failed to write: <</dev/ttyMOD2 9600 8 N 1> modbus:9:holding: 104>: Serial protocol error: request timed out
01-08-2025 16:16:12.694 WARNING: [register handler] failed to write: <</dev/ttyMOD2 9600 8 N 1> modbus:9:holding: 104>: Serial protocol error: request timed out
01-08-2025 16:15:23.213 WARNING: [serial client] <192.168.30.52:23> Register read rate limit is exceeded
Работает ли запись в регистр с помощью modbus_client?
Я вижу фото какой-то документации.
Повторюсь: Раболтале ли запись непосредственно в регистр?
Не было времени проверить , долго разбираться как через modbus poll записать в регистр.
deepGreeValidSerial.json (6,0 КБ)
С этим шаблоном работает.
В моём шаблоне осуществляется управление работой двух внутренних блоков кондициониравния- включение/выключение, выбор режима работы, уставка температуры и скорости вращения вентилятора, индикация температуры в помещении. То есть сейчас два внутренних блока кондиционеров прописаны в шаблоне как одно устройство. Как сделать два разных устройства?
Имеется modbus-gateway ( с модбас адресом 9 -это прописано в шаблоне), к нему подключен наружный блок кондиционера, к наружнему блоку по CAN шине подключены внутренние блоки кондиционеров (6 штук).
Насколько вижу регистры смещены на 24.
Достаточно, в общем, сделать как для WBIO устройств. Использовать один шаблон для циклично повторяющихся регистров и описать их “сдвиг” через stride.
Для примера.
То есть в шаблоне указать базовые регистры первого устройства (за вычетом значения stride) и stride 25.
Соответственно для первого устройства адрес будет 9:1 например.
И адреса регистров базовый+ stride * 1
Для второго: 9:2. И адреса базовый+ stride * 2