Добрый день! Подключили термостат через zigbee к Wb. Значения с данного термостата видны в HomeAssistants (используется mqtt брокер Wb), однако в самом Wb его параметры не отображаются, кроме параметра “защита от ребенка”.
Подскажите пожалуйста, что нужно сделать, чтобы иметь доступ к параметрам термостата на сомом Wb.
Добрый день.
Покажите пожалуйста payloads, которые создает zigbee2mqtt при получении данных с термостата.
Данные из zigbee2mqtt (установлен в WB)
{
"current_heating_setpoint": 13,
"deadzone_temperature": 1,
"heat": "OFF",
"last_seen": 1681212067071,
"linkquality": 23,
"local_temperature": 20.5,
"local_temperature_calibration": -4,
"max_temperature_limit": 40,
"preset": "hold",
"preset_mode": "hold",
"program": [
{
"weekdays_p1": "6h:0m 20°C"
},
{
"weekdays_p2": "11h:30m 21°C"
},
{
"weekdays_p3": "13h:30m 22°C"
},
{
"weekdays_p4": "17h:30m 23°C"
},
{
"saturday_p1": "6h:0m 24°C"
},
{
"saturday_p2": "12h:0m 23°C"
},
{
"saturday_p3": "14h:30m 22°C"
},
{
"saturday_p4": "17h:30m 21°C"
},
{
"sunday_p1": "6h:0m 19°C"
},
{
"sunday_p2": "12h:30m 20°C"
},
{
"sunday_p3": "14h:30m 21°C"
},
{
"sunday_p4": "18h:30m 20°C"
}
],
"running_state": "idle",
"sensor": "IN",
"system_mode": "heat",
"child_lock": null
}
Данные из HomeAssistants (mqtt info)
big_badroom_thermostat_child_lock (lock.big_badroom_thermostat_child_lock)
MQTT discovery data:
Topic: homeassistant/lock/0x2c1165fffe99e2b6/child_lock/config
Payload
availability:
- topic: zigbee2mqtt/bridge/state
command_topic: zigbee2mqtt/big_badroom_thermostat/set/child_lock
device:
identifiers:
- zigbee2mqtt_0x2c1165fffe99e2b6
manufacturer: Moes
model: Moes BHT series Thermostat (BHT-002-GCLZB)
name: big_badroom_thermostat
json_attributes_topic: zigbee2mqtt/big_badroom_thermostat
name: big_badroom_thermostat_child_lock
payload_lock: LOCK
payload_unlock: UNLOCK
state_locked: LOCK
state_topic: zigbee2mqtt/big_badroom_thermostat
state_unlocked: UNLOCK
unique_id: 0x2c1165fffe99e2b6_child_lock_zigbee2mqtt
value_template: '{{ value_json.child_lock }}'
platform: mqtt
big_badroom_thermostat_deadzone_temperature (number.big_badroom_thermostat_deadzone_temperature)
MQTT discovery data:
Topic: homeassistant/number/0x2c1165fffe99e2b6/deadzone_temperature/config
Payload
availability:
- topic: zigbee2mqtt/bridge/state
command_topic: zigbee2mqtt/big_badroom_thermostat/set/deadzone_temperature
device:
identifiers:
- zigbee2mqtt_0x2c1165fffe99e2b6
manufacturer: Moes
model: Moes BHT series Thermostat (BHT-002-GCLZB)
name: big_badroom_thermostat
entity_category: config
icon: mdi:thermometer
json_attributes_topic: zigbee2mqtt/big_badroom_thermostat
max: 5
min: 0
name: big_badroom_thermostat_deadzone_temperature
state_topic: zigbee2mqtt/big_badroom_thermostat
unique_id: 0x2c1165fffe99e2b6_deadzone_temperature_zigbee2mqtt
unit_of_measurement: °C
value_template: '{{ value_json.deadzone_temperature }}'
platform: mqtt
big_badroom_thermostat_max_temperature_limit (number.big_badroom_thermostat_max_temperature_limit)
MQTT discovery data:
Topic: homeassistant/number/0x2c1165fffe99e2b6/max_temperature_limit/config
Payload
availability:
- topic: zigbee2mqtt/bridge/state
command_topic: zigbee2mqtt/big_badroom_thermostat/set/max_temperature_limit
device:
identifiers:
- zigbee2mqtt_0x2c1165fffe99e2b6
manufacturer: Moes
model: Moes BHT series Thermostat (BHT-002-GCLZB)
name: big_badroom_thermostat
entity_category: config
icon: mdi:thermometer
json_attributes_topic: zigbee2mqtt/big_badroom_thermostat
max: 35
min: 0
name: big_badroom_thermostat_max_temperature_limit
state_topic: zigbee2mqtt/big_badroom_thermostat
unique_id: 0x2c1165fffe99e2b6_max_temperature_limit_zigbee2mqtt
unit_of_measurement: °C
value_template: '{{ value_json.max_temperature_limit }}'
platform: mqtt
big_badroom_thermostat_local_temperature_calibration (number.big_badroom_thermostat_local_temperature_calibration)
MQTT discovery data:
Topic: homeassistant/number/0x2c1165fffe99e2b6/local_temperature_calibration/config
Payload
availability:
- topic: zigbee2mqtt/bridge/state
command_topic: zigbee2mqtt/big_badroom_thermostat/set/local_temperature_calibration
device:
identifiers:
- zigbee2mqtt_0x2c1165fffe99e2b6
manufacturer: Moes
model: Moes BHT series Thermostat (BHT-002-GCLZB)
name: big_badroom_thermostat
entity_category: config
icon: mdi:math-compass
json_attributes_topic: zigbee2mqtt/big_badroom_thermostat
max: 30
min: -30
name: big_badroom_thermostat_local_temperature_calibration
state_topic: zigbee2mqtt/big_badroom_thermostat
unique_id: 0x2c1165fffe99e2b6_local_temperature_calibration_zigbee2mqtt
unit_of_measurement: °C
value_template: '{{ value_json.local_temperature_calibration }}'
platform: mqtt
big_badroom_thermostat (climate.big_badroom_thermostat)
MQTT discovery data:
Topic: homeassistant/climate/0x2c1165fffe99e2b6/climate/config
Payload
action_template: >-
{% set values =
{None:None,‘idle’:‘off’,‘heat’:‘heating’,‘cool’:‘cooling’,‘fan_only’:‘fan’}
%}{{ values[value_json.running_state] }}
action_topic: zigbee2mqtt/big_badroom_thermostat
availability:
- topic: zigbee2mqtt/bridge/state
current_temperature_template: ‘{{ value_json.local_temperature }}’
current_temperature_topic: zigbee2mqtt/big_badroom_thermostat
device:
identifiers:- zigbee2mqtt_0x2c1165fffe99e2b6
manufacturer: Moes
model: Moes BHT series Thermostat (BHT-002-GCLZB)
name: big_badroom_thermostat
hold_command_topic: zigbee2mqtt/big_badroom_thermostat/set/preset
hold_modes:
- zigbee2mqtt_0x2c1165fffe99e2b6
- hold
- program
hold_state_template: ‘{{ value_json.preset }}’
hold_state_topic: zigbee2mqtt/big_badroom_thermostat
json_attributes_topic: zigbee2mqtt/big_badroom_thermostat
max_temp: ‘30’
min_temp: ‘5’
mode_command_topic: zigbee2mqtt/big_badroom_thermostat/set/system_mode
mode_state_template: ‘{{ value_json.system_mode }}’
mode_state_topic: zigbee2mqtt/big_badroom_thermostat
modes: - ‘off’
- heat
name: big_badroom_thermostat
temp_step: 1
temperature_command_topic: zigbee2mqtt/big_badroom_thermostat/set/current_heating_setpoint
temperature_state_template: ‘{{ value_json.current_heating_setpoint }}’
temperature_state_topic: zigbee2mqtt/big_badroom_thermostat
temperature_unit: C
unique_id: 0x2c1165fffe99e2b6_climate_zigbee2mqtt
platform: mqtt
Добрый день! Прошу прощения за назойливость, но могли бы пояснить ту ли информацию я Вам прислала и нужно ли еще что-то?
Добрый день.
Сделал стенд, воспроизвожу:
mosquitto_pub -t zigbee2mqtt/0x00124b002454cd17 -m '{"current_heating_setpoint": 13,"deadzone_temperature": 1, "heat": "OFF", "last_seen": 1681212067071,"linkquality": 23,"local_temperature": 20.5, "local_temperature_calibration": -4, "max_temperature_limit": 40,"preset": "hold", "preset_mode": "hold","program": [{"weekdays_p1": "6h:0m 20°C"}, {"weekdays_p2": "11h:30m 21°C"},{"weekdays_p3": "13h:30m 22°C"},{"weekdays_p4": "17h:30m 23°C"},{"saturday_p1": "6h:0m 24°C"},{"saturday_p2": "12h:0m 23°C"},{"saturday_p3": "14h:30m 22°C"},{"saturday_p4": "17h:30m 21°C"},{ "sunday_p1": "6h:0m 19°C"},{"sunday_p2": "12h:30m 20°C"},{"sunday_p3": "14h:30m 21°C"},{"sunday_p4": "18h:30m 20°C"}],"running_state": "idle","sensor": "IN", "system_mode": "heat","child_lock": "null"
Получаю:
Какая у вас версия wb-zigbee2mqtt пакета стоит?
Ну и кажется нашел подозрительное место. Поменяйте строчку 155 файла /usr/share/wb-rules-system/rules/wb-zigbee2mqtt.js
на
if (v!=null){dev[ctrlName][k] = v;}
1.25.2commit: [e8528512]
Спасибо сейчас попробую
У вас 138 строчка, dev[ctrlName][k] = v;
Все поправила и сохранила! пока ничего не появилось… Может нужно что-то перезапустить?
Перезапустить wb-rules, но вобще после сохранения файла должен сам перезапуститься.
Покажите несколько payloads от устройства для проверки, но строкой, именно так как они пишутся в топик.
Обновили wb
Теперь изменяемая строка 155
topic:
homeassistant/climate/0x2c1165fffe99e2b6
value:
{"action_template":"{% set values = {None:None,'idle':'off','heat':'heating','cool':'cooling','fan_only':'fan'} %}{{ values[value_json.running_state] }}","action_topic":"zigbee2mqtt/big_badroom_thermostat","availability":[{"topic":"zigbee2mqtt/bridge/state"}],"current_temperature_template":"{{ value_json.local_temperature }}","current_temperature_topic":"zigbee2mqtt/big_badroom_thermostat","device":{"identifiers":["zigbee2mqtt_0x2c1165fffe99e2b6"],"manufacturer":"Moes","model":"Moes BHT series Thermostat (BHT-002-GCLZB)","name":"big_badroom_thermostat"},"json_attributes_topic":"zigbee2mqtt/big_badroom_thermostat","max_temp":"35","min_temp":"5","mode_command_topic":"zigbee2mqtt/big_badroom_thermostat/set/system_mode","mode_state_template":"{{ value_json.system_mode }}","mode_state_topic":"zigbee2mqtt/big_badroom_thermostat","modes":["off","heat"],"name":"big_badroom_thermostat","preset_mode_command_topic":"zigbee2mqtt/big_badroom_thermostat/set/preset","preset_mode_state_topic":"zigbee2mqtt/big_badroom_thermostat","preset_mode_value_template":"{{ value_json.preset }}","preset_modes":["hold","program"],"temp_step":1,"temperature_command_topic":"zigbee2mqtt/big_badroom_thermostat/set/current_heating_setpoint","temperature_state_template":"{{ value_json.current_heating_setpoint }}","temperature_state_topic":"zigbee2mqtt/big_badroom_thermostat","temperature_unit":"C","unique_id":"0x2c1165fffe99e2b6_climate_zigbee2mqtt"}
topic:
homeassistant/select/0x2c1165fffe99e2b6/sensor/config
value:
{"availability":[{"topic":"zigbee2mqtt/bridge/state"}],"command_topic":"zigbee2mqtt/big_badroom_thermostat/set/sensor","device":{"identifiers":["zigbee2mqtt_0x2c1165fffe99e2b6"],"manufacturer":"Moes","model":"Moes BHT series Thermostat (BHT-002-GCLZB)","name":"big_badroom_thermostat"},"json_attributes_topic":"zigbee2mqtt/big_badroom_thermostat","name":"big_badroom_thermostat_sensor","options":["IN","AL","OU"],"state_topic":"zigbee2mqtt/big_badroom_thermostat","unique_id":"0x2c1165fffe99e2b6_sensor_zigbee2mqtt","value_template":"{{ value_json.sensor }}"}
Для достоверного воспроизведения нужна строка публикуемая в топик zigbee2mqtt/ИмяУстройства
, топики HA не очень помогают.
topic:
zigbee2mqtt/big_badroom_thermostat
value:
{"child_lock":null,"current_heating_setpoint":23,"deadzone_temperature":1,"heat":"OFF","last_seen":1683137402604,"linkquality":0,"local_temperature":22.5,"local_temperature_calibration":-4,"max_temperature_limit":40,"min_temperature_limit":null,"preset":"hold","preset_mode":"hold","program":[{"weekdays_p1":"6h:0m 20°C"},{"weekdays_p2":"11h:30m 21°C"},{"weekdays_p3":"13h:30m 22°C"},{"weekdays_p4":"17h:30m 23°C"},{"saturday_p1":"6h:0m 24°C"},{"saturday_p2":"12h:0m 23°C"},{"saturday_p3":"14h:30m 22°C"},{"saturday_p4":"17h:30m 21°C"},{"sunday_p1":"6h:0m 19°C"},{"sunday_p2":"12h:30m 20°C"},{"sunday_p3":"14h:30m 21°C"},{"sunday_p4":"18h:30m 20°C"}],"running_state":"idle","sensor":"IN","system_mode":"heat"}
Благодарю.
Итак, делаю публикацию в тестовое устройство:
mosquitto_pub -t zigbee2mqtt/0x00124b002454cd17 -m '{"child_lock":null,"current_heating_setpoint":23,"deadzone_temperature":1,"heat":"OFF","last_seen":1683137402604,"linkquality":0,"local_temperature":22.5,"local_temperature_calibration":-4,"max_temperature_limit":40,"min_temperature_limit":null,"preset":"hold","preset_mode":"hold","program":[{"weekdays_p1":"6h:0m 20°C"},{"weekdays_p2":"11h:30m 21°C"},{"weekdays_p3":"13h:30m 22°C"},{"weekdays_p4":"17h:30m 23°C"},{"saturday_p1":"6h:0m 24°C"},{"saturday_p2":"12h:0m 23°C"},{"saturday_p3":"14h:30m 22°C"},{"saturday_p4":"17h:30m 21°C"},{"sunday_p1":"6h:0m 19°C"},{"sunday_p2":"12h:30m 20°C"},{"sunday_p3":"14h:30m 21°C"},{"sunday_p4":"18h:30m 20°C"}],"running_state":"idle","sensor":"IN","system_mode":"heat"}'
Да, воспроизводится.
Дело, как и предполагал в том что передаваемое значение null
без кавычек.
попробую исправить.
Вставьте в скрипт wb-zigbee2mqtt.js перед строчкой dev[ctrlName][k] = v.toString();
строку
if (v==null){v="";};
Багу описал, думаю через некоторое время будет фикс.
Спасибо Вам большое за помощь! все работает