Есть устройство, состояние которого публикуются в mqtt python клиентом.
Если подписаться на события устройства, то сообщения приходят:
Summary
aqualx@wb ~ $ mosquitto_sub -t ‘/devices/bedroom/controls/#’ -v
/devices/bedroom/controls/temperature 23.9
/devices/bedroom/controls/temperature/meta/type temperature
/devices/bedroom/controls/humidity 35.7
/devices/bedroom/controls/humidity/meta/type rel_humidity
/devices/bedroom/controls/battery 96
/devices/bedroom/controls/battery/meta/type value
/devices/bedroom/controls/battery/meta/units %
/devices/bedroom/controls/timestamp 2019-02-11 23:52:11
/devices/bedroom/controls/timestamp/meta/type text
/devices/bedroom/controls/humidity 35.7
/devices/bedroom/controls/temperature 23.8
/devices/bedroom/controls/battery 96
/devices/bedroom/controls/timestamp 2019-02-11 23:56:55
/devices/bedroom/controls/humidity 35.8
/devices/bedroom/controls/temperature 23.9
/devices/bedroom/controls/battery 96
/devices/bedroom/controls/timestamp 2019-02-12 00:02:15
/devices/bedroom/controls/humidity 35.9
/devices/bedroom/controls/temperature 23.9
/devices/bedroom/controls/battery 96
/devices/bedroom/controls/timestamp 2019-02-12 00:07:07
Но если подписаться в правиле, то сообщения от устройства никогда не приходят. От w1 датчиков сообщения обрабатываются нормально. Вот пример правила:
Summary
defineRule(‘thermostat.displayTemperature’, {
whenChanged: [
TEMP.bathroom_floor,
TEMP.bathroom_mi,
TEMP.kids_room,
TEMP.kids_room_mi,
TEMP.kids_room_floor,
TEMP.bedroom,
TEMP.bedroom_mi,
TEMP.server_room,
TEMP.kitchen_living_room_floor,
TEMP.kitchen,
TEMP.kitchen_mi,
TEMP.kitchen_floor,
TEMP.corridor,
TEMP.kitchen_living_room_ac,
TEMP.living_room_ac,
TEMP.bedroom_ac
],
then: function(newValue, devName, cellName) {
log( ‘thermostat.displayTemperature: {}/{} = {}’.format( devName, cellName, newValue ) );
}
});
global.proto.TEMP = {
‘bathroom_floor’: ‘wb-w1/28-800000038967’,
‘bathroom_mi’: ‘bathroom/temperature’,
‘kids_room’: ‘wb-w1/28-800000016d97’,
‘kids_room_mi’: ‘kidsroom/temperature’,
‘kids_room_floor’: ‘wb-w1/28-8000000387f1’,
‘kids_room_ac’: ‘wb-mir_v2_4/int_temp’,
‘bedroom’: ‘wb-w1/28-800000037ded’,
‘bedroom_ac’: ‘wb-mir_v2_3/int_temp’,
‘bedroom_mi’: ‘bedroom/temperature’,
‘server_room’: ‘wb-w1/28-800000036f5f’,
‘living_room_ac’: ‘wb-mir_v2_2/int_temp’,
‘kitchen_living_room_floor’: ‘wb-w1/28-80000003826d’,
‘kitchen_living_room_ac’: ‘wb-mir_v2_1/int_temp’,
‘kitchen’: ‘wb-w1/28-8000000174c7’,
‘kitchen_mi’: ‘kitchen/temperature’,
‘kitchen_floor’: ‘wb-w1/28-8000000173fb’,
‘corridor’: ‘wb-w1/28-800000037c9d’,
};
Пробовал менять топик устройства на /devices/bedroom/controls/temperature и… тоже не работает