2018-11-16 12:23:11 -07:00
|
|
|
const zigbeeShepherdConverters = require('zigbee-shepherd-converters');
|
|
|
|
const settings = require('../util/settings');
|
|
|
|
const logger = require('../util/logger');
|
2018-12-07 15:17:29 -07:00
|
|
|
const zigbee2mqttVersion = require('../../package.json').version;
|
2018-04-25 11:54:41 -07:00
|
|
|
|
|
|
|
const configurations = {
|
2018-04-23 09:29:35 -07:00
|
|
|
// Binary sensor
|
|
|
|
'binary_sensor_occupancy': {
|
|
|
|
type: 'binary_sensor',
|
|
|
|
object_id: 'occupancy',
|
|
|
|
discovery_payload: {
|
2018-04-23 12:44:06 -07:00
|
|
|
payload_on: true,
|
|
|
|
payload_off: false,
|
2018-04-23 09:29:35 -07:00
|
|
|
value_template: '{{ value_json.occupancy }}',
|
|
|
|
device_class: 'motion',
|
2018-05-17 08:20:46 -07:00
|
|
|
},
|
2018-04-23 09:29:35 -07:00
|
|
|
},
|
2018-10-31 09:10:28 -07:00
|
|
|
'binary_sensor_presence': {
|
|
|
|
type: 'binary_sensor',
|
|
|
|
object_id: 'presence',
|
|
|
|
discovery_payload: {
|
|
|
|
payload_on: true,
|
|
|
|
payload_off: false,
|
|
|
|
value_template: '{{ value_json.presence }}',
|
|
|
|
device_class: 'presence',
|
|
|
|
},
|
|
|
|
},
|
2018-04-23 12:44:06 -07:00
|
|
|
'binary_sensor_contact': {
|
2018-04-23 09:29:35 -07:00
|
|
|
type: 'binary_sensor',
|
2018-04-23 12:44:06 -07:00
|
|
|
object_id: 'contact',
|
2018-04-23 09:29:35 -07:00
|
|
|
discovery_payload: {
|
2018-04-23 12:44:06 -07:00
|
|
|
payload_on: false,
|
|
|
|
payload_off: true,
|
|
|
|
value_template: '{{ value_json.contact }}',
|
2018-04-23 09:29:35 -07:00
|
|
|
device_class: 'door',
|
2018-05-17 08:20:46 -07:00
|
|
|
},
|
2018-04-23 09:29:35 -07:00
|
|
|
},
|
|
|
|
'binary_sensor_water_leak': {
|
|
|
|
type: 'binary_sensor',
|
|
|
|
object_id: 'water_leak',
|
|
|
|
discovery_payload: {
|
|
|
|
payload_on: true,
|
|
|
|
payload_off: false,
|
|
|
|
value_template: '{{ value_json.water_leak }}',
|
|
|
|
device_class: 'moisture',
|
2018-05-17 08:20:46 -07:00
|
|
|
},
|
2018-04-23 09:29:35 -07:00
|
|
|
},
|
2018-05-16 11:15:50 -07:00
|
|
|
'binary_sensor_smoke': {
|
|
|
|
type: 'binary_sensor',
|
|
|
|
object_id: 'smoke',
|
|
|
|
discovery_payload: {
|
|
|
|
payload_on: true,
|
|
|
|
payload_off: false,
|
|
|
|
value_template: '{{ value_json.smoke }}',
|
|
|
|
device_class: 'smoke',
|
2018-05-17 08:20:46 -07:00
|
|
|
},
|
2018-05-16 11:15:50 -07:00
|
|
|
},
|
2018-08-30 09:06:52 -07:00
|
|
|
'binary_sensor_gas': {
|
|
|
|
type: 'binary_sensor',
|
|
|
|
object_id: 'gas',
|
|
|
|
discovery_payload: {
|
|
|
|
payload_on: true,
|
|
|
|
payload_off: false,
|
|
|
|
value_template: '{{ value_json.gas }}',
|
|
|
|
device_class: 'gas',
|
|
|
|
},
|
|
|
|
},
|
2019-03-13 11:41:58 -07:00
|
|
|
'binary_sensor_carbon_monoxide': {
|
|
|
|
type: 'binary_sensor',
|
|
|
|
object_id: 'carbon_monoxide',
|
|
|
|
discovery_payload: {
|
|
|
|
payload_on: true,
|
|
|
|
payload_off: false,
|
|
|
|
value_template: '{{ value_json.carbon_monoxide }}',
|
|
|
|
device_class: 'safety',
|
|
|
|
},
|
|
|
|
},
|
2018-05-17 09:03:54 -07:00
|
|
|
'binary_sensor_router': {
|
|
|
|
type: 'binary_sensor',
|
|
|
|
object_id: 'router',
|
|
|
|
discovery_payload: {
|
|
|
|
payload_on: true,
|
|
|
|
payload_off: false,
|
|
|
|
value_template: '{{ value_json.state }}',
|
|
|
|
device_class: 'connectivity',
|
|
|
|
},
|
|
|
|
},
|
2019-02-26 12:59:33 -07:00
|
|
|
'binary_sensor_battery_low': {
|
|
|
|
type: 'binary_sensor',
|
|
|
|
object_id: 'battery_low',
|
|
|
|
discovery_payload: {
|
|
|
|
payload_on: true,
|
|
|
|
payload_off: false,
|
|
|
|
value_template: '{{ value_json.battery_low}}',
|
|
|
|
device_class: 'battery',
|
|
|
|
},
|
|
|
|
},
|
2019-07-08 12:42:07 -07:00
|
|
|
'binary_sensor_lock': {
|
|
|
|
type: 'binary_sensor',
|
|
|
|
object_id: 'lock',
|
|
|
|
discovery_payload: {
|
|
|
|
payload_on: 'UNLOCK',
|
|
|
|
payload_off: 'LOCK',
|
|
|
|
value_template: '{{ value_json.state}}',
|
|
|
|
device_class: 'lock',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
'binary_sensor_lock_reverse': {
|
|
|
|
type: 'binary_sensor',
|
|
|
|
object_id: 'lock_reverse',
|
|
|
|
discovery_payload: {
|
|
|
|
payload_on: 'UNLOCK',
|
|
|
|
payload_off: 'LOCK',
|
|
|
|
value_template: '{{ value_json.reverse}}',
|
|
|
|
device_class: 'lock',
|
|
|
|
},
|
|
|
|
},
|
2018-04-23 09:29:35 -07:00
|
|
|
|
|
|
|
// Sensor
|
|
|
|
'sensor_illuminance': {
|
|
|
|
type: 'sensor',
|
|
|
|
object_id: 'illuminance',
|
|
|
|
discovery_payload: {
|
|
|
|
unit_of_measurement: 'lx',
|
2018-10-24 12:10:42 -07:00
|
|
|
device_class: 'illuminance',
|
2018-04-23 09:29:35 -07:00
|
|
|
value_template: '{{ value_json.illuminance }}',
|
2018-05-17 08:20:46 -07:00
|
|
|
},
|
2018-04-23 09:29:35 -07:00
|
|
|
},
|
|
|
|
'sensor_humidity': {
|
|
|
|
type: 'sensor',
|
|
|
|
object_id: 'humidity',
|
|
|
|
discovery_payload: {
|
|
|
|
unit_of_measurement: '%',
|
2018-10-24 12:10:42 -07:00
|
|
|
device_class: 'humidity',
|
2018-04-23 09:29:35 -07:00
|
|
|
value_template: '{{ value_json.humidity }}',
|
2018-05-17 08:20:46 -07:00
|
|
|
},
|
2018-04-23 09:29:35 -07:00
|
|
|
},
|
|
|
|
'sensor_temperature': {
|
|
|
|
type: 'sensor',
|
|
|
|
object_id: 'temperature',
|
|
|
|
discovery_payload: {
|
|
|
|
unit_of_measurement: '°C',
|
2018-10-24 12:10:42 -07:00
|
|
|
device_class: 'temperature',
|
2018-04-23 09:29:35 -07:00
|
|
|
value_template: '{{ value_json.temperature }}',
|
2018-05-17 08:20:46 -07:00
|
|
|
},
|
2018-04-23 09:29:35 -07:00
|
|
|
},
|
|
|
|
'sensor_pressure': {
|
|
|
|
type: 'sensor',
|
|
|
|
object_id: 'pressure',
|
|
|
|
discovery_payload: {
|
2018-10-24 12:10:42 -07:00
|
|
|
unit_of_measurement: 'hPa',
|
|
|
|
device_class: 'pressure',
|
2018-04-23 09:29:35 -07:00
|
|
|
value_template: '{{ value_json.pressure }}',
|
2018-05-17 08:20:46 -07:00
|
|
|
},
|
2018-04-23 09:29:35 -07:00
|
|
|
},
|
2018-05-08 11:13:01 -07:00
|
|
|
'sensor_click': {
|
2018-04-23 09:29:35 -07:00
|
|
|
type: 'sensor',
|
2018-05-08 11:13:01 -07:00
|
|
|
object_id: 'click',
|
2018-04-23 09:29:35 -07:00
|
|
|
discovery_payload: {
|
|
|
|
icon: 'mdi:toggle-switch',
|
|
|
|
value_template: '{{ value_json.click }}',
|
2018-05-17 08:20:46 -07:00
|
|
|
},
|
2018-04-23 09:29:35 -07:00
|
|
|
},
|
2018-04-23 13:36:30 -07:00
|
|
|
'sensor_power': {
|
|
|
|
type: 'sensor',
|
|
|
|
object_id: 'power',
|
|
|
|
discovery_payload: {
|
2019-07-11 10:36:50 -07:00
|
|
|
unit_of_measurement: 'W',
|
|
|
|
icon: 'mdi:factory',
|
2018-04-23 13:36:30 -07:00
|
|
|
value_template: '{{ value_json.power }}',
|
2018-05-17 08:20:46 -07:00
|
|
|
},
|
2018-04-23 13:36:30 -07:00
|
|
|
},
|
2019-07-11 10:36:50 -07:00
|
|
|
'sensor_current': {
|
|
|
|
type: 'sensor',
|
|
|
|
object_id: 'current',
|
|
|
|
discovery_payload: {
|
|
|
|
unit_of_measurement: 'A',
|
|
|
|
icon: 'mdi:power-plug',
|
|
|
|
value_template: '{{ value_json.current }}',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
'sensor_voltage': {
|
|
|
|
type: 'sensor',
|
|
|
|
object_id: 'voltage',
|
|
|
|
discovery_payload: {
|
|
|
|
unit_of_measurement: 'V',
|
|
|
|
icon: 'mdi:flash',
|
|
|
|
value_template: '{{ value_json.voltage }}',
|
|
|
|
},
|
|
|
|
},
|
2018-05-08 11:20:57 -07:00
|
|
|
'sensor_action': {
|
|
|
|
type: 'sensor',
|
|
|
|
object_id: 'action',
|
|
|
|
discovery_payload: {
|
2018-07-10 09:43:31 -07:00
|
|
|
icon: 'mdi:gesture-double-tap',
|
2018-05-08 11:20:57 -07:00
|
|
|
value_template: '{{ value_json.action }}',
|
2018-05-17 08:20:46 -07:00
|
|
|
},
|
2018-05-08 11:20:57 -07:00
|
|
|
},
|
2018-06-08 11:34:34 -07:00
|
|
|
'sensor_brightness': {
|
|
|
|
type: 'sensor',
|
|
|
|
object_id: 'brightness',
|
|
|
|
discovery_payload: {
|
|
|
|
unit_of_measurement: 'brightness',
|
|
|
|
icon: 'mdi:brightness-5',
|
|
|
|
value_template: '{{ value_json.brightness }}',
|
|
|
|
},
|
|
|
|
},
|
2018-09-18 13:24:17 -07:00
|
|
|
'sensor_lock': {
|
|
|
|
type: 'sensor',
|
|
|
|
object_id: 'lock',
|
|
|
|
discovery_payload: {
|
|
|
|
icon: 'mdi:lock',
|
|
|
|
value_template: '{{ value_json.inserted }}',
|
|
|
|
},
|
|
|
|
},
|
2018-11-19 12:43:23 -07:00
|
|
|
'sensor_battery': {
|
|
|
|
type: 'sensor',
|
|
|
|
object_id: 'battery',
|
|
|
|
discovery_payload: {
|
2019-01-06 07:35:30 -07:00
|
|
|
unit_of_measurement: '%',
|
2018-11-19 12:43:23 -07:00
|
|
|
device_class: 'battery',
|
|
|
|
value_template: '{{ value_json.battery }}',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
'sensor_linkquality': {
|
|
|
|
type: 'sensor',
|
|
|
|
object_id: 'linkquality',
|
|
|
|
discovery_payload: {
|
2019-01-21 10:51:53 -07:00
|
|
|
unit_of_measurement: '-',
|
2018-11-19 12:43:23 -07:00
|
|
|
value_template: '{{ value_json.linkquality }}',
|
|
|
|
},
|
|
|
|
},
|
2018-12-27 14:23:57 -07:00
|
|
|
'sensor_gas_density': {
|
|
|
|
type: 'sensor',
|
|
|
|
object_id: 'gas_density',
|
|
|
|
discovery_payload: {
|
|
|
|
value_template: '{{ value_json.gas_density }}',
|
|
|
|
icon: 'mdi:google-circles-communities',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
'sensor_cover': {
|
|
|
|
type: 'sensor',
|
|
|
|
object_id: 'cover',
|
|
|
|
discovery_payload: {
|
|
|
|
value_template: '{{ value_json.position }}',
|
|
|
|
icon: 'mdi:view-array',
|
|
|
|
},
|
|
|
|
},
|
2018-04-23 09:29:35 -07:00
|
|
|
|
|
|
|
// Light
|
2018-11-16 12:23:11 -07:00
|
|
|
'light_brightness_colortemp_colorxy': {
|
2018-04-23 09:29:35 -07:00
|
|
|
type: 'light',
|
|
|
|
object_id: 'light',
|
|
|
|
discovery_payload: {
|
|
|
|
brightness: true,
|
|
|
|
color_temp: true,
|
|
|
|
xy: true,
|
2018-12-13 13:18:13 -07:00
|
|
|
schema: 'json',
|
2018-05-17 08:20:46 -07:00
|
|
|
command_topic: true,
|
|
|
|
},
|
2018-04-23 09:29:35 -07:00
|
|
|
},
|
2018-11-16 12:23:11 -07:00
|
|
|
'light_brightness_colorxy': {
|
2018-06-01 13:05:49 -07:00
|
|
|
type: 'light',
|
|
|
|
object_id: 'light',
|
|
|
|
discovery_payload: {
|
|
|
|
brightness: true,
|
|
|
|
xy: true,
|
2018-12-13 13:18:13 -07:00
|
|
|
schema: 'json',
|
2018-06-01 13:05:49 -07:00
|
|
|
command_topic: true,
|
|
|
|
},
|
|
|
|
},
|
2018-04-23 09:29:35 -07:00
|
|
|
'light_brightness_colortemp': {
|
|
|
|
type: 'light',
|
|
|
|
object_id: 'light',
|
|
|
|
discovery_payload: {
|
|
|
|
brightness: true,
|
|
|
|
color_temp: true,
|
2018-12-13 13:18:13 -07:00
|
|
|
schema: 'json',
|
2018-05-17 08:20:46 -07:00
|
|
|
command_topic: true,
|
|
|
|
},
|
2018-04-23 09:29:35 -07:00
|
|
|
},
|
2018-05-06 09:08:10 -07:00
|
|
|
'light_brightness': {
|
|
|
|
type: 'light',
|
|
|
|
object_id: 'light',
|
|
|
|
discovery_payload: {
|
|
|
|
brightness: true,
|
2018-12-13 13:18:13 -07:00
|
|
|
schema: 'json',
|
2018-05-17 08:20:46 -07:00
|
|
|
command_topic: true,
|
|
|
|
},
|
2018-05-06 09:08:10 -07:00
|
|
|
},
|
2018-04-23 13:36:30 -07:00
|
|
|
|
|
|
|
// Switch
|
|
|
|
'switch': {
|
|
|
|
type: 'switch',
|
|
|
|
object_id: 'switch',
|
|
|
|
discovery_payload: {
|
2018-04-24 10:03:09 -07:00
|
|
|
payload_off: 'OFF',
|
|
|
|
payload_on: 'ON',
|
2018-04-23 13:36:30 -07:00
|
|
|
value_template: '{{ value_json.state }}',
|
2018-05-17 08:20:46 -07:00
|
|
|
command_topic: true,
|
|
|
|
},
|
2018-04-24 10:30:56 -07:00
|
|
|
},
|
2018-12-27 14:23:57 -07:00
|
|
|
|
|
|
|
// Cover
|
|
|
|
'cover': {
|
|
|
|
type: 'cover',
|
|
|
|
object_id: 'cover',
|
|
|
|
discovery_payload: {
|
|
|
|
command_topic: true,
|
|
|
|
optimistic: true,
|
|
|
|
},
|
|
|
|
},
|
2019-02-25 09:56:47 -07:00
|
|
|
'cover_position': {
|
2019-02-23 08:02:45 -07:00
|
|
|
type: 'cover',
|
|
|
|
object_id: 'cover',
|
|
|
|
discovery_payload: {
|
|
|
|
command_topic: true,
|
|
|
|
position_topic: true,
|
|
|
|
set_position_topic: true,
|
|
|
|
set_position_template: '{ "position": {{ position }} }',
|
|
|
|
value_template: '{{ value_json.position }}',
|
|
|
|
state_topic: false,
|
|
|
|
},
|
|
|
|
},
|
2019-08-08 11:26:50 -07:00
|
|
|
'cover_position_tilt': {
|
|
|
|
type: 'cover',
|
|
|
|
object_id: 'cover',
|
|
|
|
discovery_payload: {
|
|
|
|
state_topic: false,
|
|
|
|
command_topic: true,
|
|
|
|
set_position_topic: true,
|
|
|
|
set_position_template: '{ "position": {{ position }} }',
|
|
|
|
tilt_command_topic: true,
|
|
|
|
position_topic: true,
|
|
|
|
value_template: '{{ value_json.position }}',
|
|
|
|
tilt_status_topic: true,
|
|
|
|
tilt_status_template: '{{ value_json.tilt }}',
|
|
|
|
},
|
|
|
|
},
|
2019-02-11 11:59:50 -07:00
|
|
|
|
|
|
|
// Lock
|
|
|
|
'lock': {
|
|
|
|
type: 'lock',
|
|
|
|
object_id: 'lock',
|
|
|
|
discovery_payload: {
|
|
|
|
command_topic: true,
|
|
|
|
value_template: '{{ value_json.state }}',
|
|
|
|
},
|
|
|
|
},
|
2019-04-16 07:31:05 -07:00
|
|
|
|
|
|
|
// Thermostat/HVAC
|
|
|
|
'thermostat': {
|
|
|
|
type: 'climate',
|
|
|
|
object_id: 'climate',
|
|
|
|
discovery_payload: {
|
2019-06-07 14:55:20 -07:00
|
|
|
state_topic: false,
|
2019-04-16 07:31:05 -07:00
|
|
|
min_temp: 7,
|
|
|
|
max_temp: 30,
|
|
|
|
modes: ['off', 'auto', 'heat'],
|
|
|
|
mode_state_topic: true,
|
|
|
|
mode_state_template: '{{ value_json.system_mode }}',
|
|
|
|
mode_command_topic: true,
|
|
|
|
current_temperature_topic: true,
|
|
|
|
current_temperature_template: '{{ value_json.local_temperature }}',
|
|
|
|
temperature_state_topic: true,
|
|
|
|
temperature_state_template: '{{ value_json.occupied_heating_setpoint }}',
|
|
|
|
temperature_command_topic: true,
|
|
|
|
},
|
|
|
|
},
|
2019-04-24 11:59:06 -07:00
|
|
|
|
|
|
|
// Fan
|
|
|
|
'fan': {
|
|
|
|
type: 'fan',
|
|
|
|
object_id: 'fan',
|
|
|
|
discovery_payload: {
|
|
|
|
state_topic: true,
|
|
|
|
state_value_template: '{{ value_json.fan_state }}',
|
|
|
|
command_topic: true,
|
|
|
|
command_topic_postfix: 'fan_state',
|
|
|
|
speed_state_topic: true,
|
|
|
|
speed_command_topic: true,
|
|
|
|
speed_value_template: '{{ value_json.fan_mode }}',
|
|
|
|
speeds: ['off', 'low', 'medium', 'high', 'on', 'auto', 'smart'],
|
|
|
|
},
|
|
|
|
},
|
2018-08-04 11:05:34 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
const switchWithPostfix = (postfix) => {
|
|
|
|
return {
|
2018-04-29 05:09:49 -07:00
|
|
|
type: 'switch',
|
2018-08-04 11:05:34 -07:00
|
|
|
object_id: `switch_${postfix}`,
|
2018-04-29 05:09:49 -07:00
|
|
|
discovery_payload: {
|
|
|
|
payload_off: 'OFF',
|
|
|
|
payload_on: 'ON',
|
2018-08-04 11:05:34 -07:00
|
|
|
value_template: `{{ value_json.state_${postfix} }}`,
|
2018-04-29 05:09:49 -07:00
|
|
|
command_topic: true,
|
2018-08-04 11:05:34 -07:00
|
|
|
command_topic_prefix: postfix,
|
2018-05-17 08:20:46 -07:00
|
|
|
},
|
2018-08-04 11:05:34 -07:00
|
|
|
};
|
2018-04-23 09:29:35 -07:00
|
|
|
};
|
|
|
|
|
2018-05-16 10:40:05 -07:00
|
|
|
// Map homeassitant configurations to devices.
|
|
|
|
const mapping = {
|
2019-01-06 07:42:25 -07:00
|
|
|
'WXKG01LM': [configurations.sensor_click, configurations.sensor_battery],
|
|
|
|
'WXKG11LM': [configurations.sensor_click, configurations.sensor_battery],
|
2019-08-08 11:14:50 -07:00
|
|
|
'WXKG12LM': [configurations.sensor_click, configurations.sensor_battery, configurations.sensor_action],
|
2019-06-16 04:13:03 -07:00
|
|
|
// BREAKING_IMPROVEMENT: only use sensor_click for WXKG03LM (action hold -> click hold)
|
|
|
|
'WXKG03LM': [configurations.sensor_click, configurations.sensor_battery, configurations.sensor_action],
|
2019-01-06 07:42:25 -07:00
|
|
|
'WXKG02LM': [configurations.sensor_click, configurations.sensor_battery],
|
2019-06-13 13:01:39 -07:00
|
|
|
'QBKG04LM': [configurations.switch, configurations.sensor_click, configurations.sensor_action],
|
2019-07-24 12:44:04 -07:00
|
|
|
'QBKG03LM': [
|
|
|
|
switchWithPostfix('left'), switchWithPostfix('right'), configurations.sensor_click,
|
|
|
|
configurations.sensor_temperature,
|
|
|
|
],
|
2019-01-06 07:42:25 -07:00
|
|
|
'WSDCGQ01LM': [configurations.sensor_temperature, configurations.sensor_humidity, configurations.sensor_battery],
|
|
|
|
'WSDCGQ11LM': [
|
|
|
|
configurations.sensor_temperature, configurations.sensor_humidity, configurations.sensor_pressure,
|
|
|
|
configurations.sensor_battery,
|
|
|
|
],
|
2018-11-19 12:43:23 -07:00
|
|
|
'RTCGQ01LM': [configurations.binary_sensor_occupancy, configurations.sensor_battery],
|
2018-11-19 12:49:25 -07:00
|
|
|
'RTCGQ11LM': [
|
|
|
|
configurations.binary_sensor_occupancy, configurations.sensor_illuminance,
|
|
|
|
configurations.sensor_battery,
|
|
|
|
],
|
2018-11-19 12:43:23 -07:00
|
|
|
'MCCGQ01LM': [configurations.binary_sensor_contact, configurations.sensor_battery],
|
|
|
|
'MCCGQ11LM': [configurations.binary_sensor_contact, configurations.sensor_battery],
|
|
|
|
'SJCGQ11LM': [configurations.binary_sensor_water_leak, configurations.sensor_battery],
|
2019-01-06 07:42:25 -07:00
|
|
|
'MFKZQ01LM': [configurations.sensor_action, configurations.sensor_battery],
|
2018-05-16 10:40:05 -07:00
|
|
|
'ZNCZ02LM': [configurations.switch, configurations.sensor_power],
|
|
|
|
'QBCZ11LM': [configurations.switch, configurations.sensor_power],
|
|
|
|
'LED1545G12': [configurations.light_brightness_colortemp],
|
|
|
|
'LED1623G12': [configurations.light_brightness],
|
2018-05-21 02:11:24 -07:00
|
|
|
'LED1622G12': [configurations.light_brightness],
|
2018-05-16 10:40:05 -07:00
|
|
|
'LED1537R6': [configurations.light_brightness_colortemp],
|
|
|
|
'LED1650R5': [configurations.light_brightness],
|
|
|
|
'LED1536G5': [configurations.light_brightness_colortemp],
|
2018-11-16 12:23:11 -07:00
|
|
|
'7299760PH': [configurations.light_brightness_colorxy],
|
|
|
|
'7146060PH': [configurations.light_brightness_colortemp_colorxy],
|
2019-05-02 10:59:23 -07:00
|
|
|
'046677476816': [configurations.light_brightness],
|
2018-05-16 10:52:44 -07:00
|
|
|
'F7C033': [configurations.light_brightness],
|
2018-11-19 12:43:23 -07:00
|
|
|
'JTYJ-GD-01LM/BW': [configurations.binary_sensor_smoke, configurations.sensor_battery],
|
2018-05-21 04:21:18 -07:00
|
|
|
'PLUG EDP RE:DY': [configurations.switch, configurations.sensor_power],
|
2019-05-12 12:05:07 -07:00
|
|
|
'SWITCH EDP RE:DY': [configurations.switch],
|
2019-02-20 12:10:38 -07:00
|
|
|
'CC2530.ROUTER': [configurations.binary_sensor_router],
|
2018-05-26 02:00:56 -07:00
|
|
|
'AA70155': [configurations.light_brightness_colortemp],
|
2018-11-16 12:23:11 -07:00
|
|
|
'4058075816718': [configurations.light_brightness_colortemp_colorxy],
|
|
|
|
'AA69697': [configurations.light_brightness_colortemp_colorxy],
|
2018-05-27 08:16:01 -07:00
|
|
|
'HALIGHTDIMWWE27': [configurations.light_brightness],
|
2019-01-06 06:37:38 -07:00
|
|
|
'HALIGHTDIMWWB22': [configurations.light_brightness],
|
2018-05-28 11:01:28 -07:00
|
|
|
'AB3257001NJ': [configurations.switch],
|
2018-05-31 10:21:31 -07:00
|
|
|
'8718696449691': [configurations.light_brightness],
|
2018-11-16 12:23:11 -07:00
|
|
|
'RB 185 C': [configurations.light_brightness_colortemp_colorxy],
|
2018-12-13 13:13:18 -07:00
|
|
|
'BY 185 C': [configurations.light_brightness_colortemp_colorxy],
|
2018-11-16 12:23:11 -07:00
|
|
|
'9290012573A': [configurations.light_brightness_colortemp_colorxy],
|
|
|
|
'LED1624G9': [configurations.light_brightness_colorxy],
|
2018-06-05 11:27:36 -07:00
|
|
|
'73742': [configurations.light_brightness_colortemp],
|
|
|
|
'73740': [configurations.light_brightness_colortemp],
|
2019-02-12 11:33:45 -07:00
|
|
|
'73739': [configurations.light_brightness_colortemp_colorxy],
|
2018-06-05 11:27:36 -07:00
|
|
|
'22670': [configurations.light_brightness],
|
2019-03-06 14:09:51 -07:00
|
|
|
'ICTC-G-1': [configurations.sensor_brightness, configurations.sensor_battery, configurations.sensor_action],
|
2018-06-13 11:23:26 -07:00
|
|
|
'ICPSHC24-30EU-IL-1': [configurations.light_brightness],
|
2018-06-12 12:02:24 -07:00
|
|
|
'45852GE': [configurations.light_brightness],
|
|
|
|
'E11-G13': [configurations.light_brightness],
|
2018-06-13 11:23:26 -07:00
|
|
|
'LED1649C5': [configurations.light_brightness],
|
2018-06-15 16:43:51 -07:00
|
|
|
'ICPSHC24-10EU-IL-1': [configurations.light_brightness],
|
2018-06-16 13:17:01 -07:00
|
|
|
'LED1546G12': [configurations.light_brightness_colortemp],
|
|
|
|
'L1527': [configurations.light_brightness_colortemp],
|
|
|
|
'L1529': [configurations.light_brightness_colortemp],
|
|
|
|
'L1528': [configurations.light_brightness_colortemp],
|
2019-01-05 08:11:44 -07:00
|
|
|
'L1531': [configurations.light_brightness_colortemp],
|
2018-06-16 13:17:01 -07:00
|
|
|
'RB 165': [configurations.light_brightness],
|
|
|
|
'RB 175 W': [configurations.light_brightness],
|
|
|
|
'RS 125': [configurations.light_brightness],
|
2019-02-10 06:40:54 -07:00
|
|
|
'RS 225': [configurations.light_brightness],
|
2018-06-16 13:17:01 -07:00
|
|
|
'RB 145': [configurations.light_brightness],
|
2019-05-29 10:33:15 -07:00
|
|
|
'RB 245': [configurations.light_brightness],
|
2018-06-16 13:17:01 -07:00
|
|
|
'PL 110': [configurations.light_brightness],
|
|
|
|
'ST 110': [configurations.light_brightness],
|
|
|
|
'UC 110': [configurations.light_brightness],
|
|
|
|
'DL 110 N': [configurations.light_brightness],
|
|
|
|
'DL 110 W': [configurations.light_brightness],
|
|
|
|
'SL 110 N': [configurations.light_brightness],
|
|
|
|
'SL 110 M': [configurations.light_brightness],
|
|
|
|
'SL 110 W': [configurations.light_brightness],
|
2018-06-17 08:15:43 -07:00
|
|
|
'AA68199': [configurations.light_brightness_colortemp],
|
2019-03-15 13:52:21 -07:00
|
|
|
'QBKG11LM': [configurations.switch, configurations.sensor_power, configurations.sensor_click],
|
|
|
|
'QBKG12LM': [
|
|
|
|
switchWithPostfix('left'), switchWithPostfix('right'), configurations.sensor_power,
|
|
|
|
configurations.sensor_click,
|
|
|
|
],
|
2018-11-16 12:23:11 -07:00
|
|
|
'K2RGBW01': [configurations.light_brightness_colortemp_colorxy],
|
2018-06-25 13:06:11 -07:00
|
|
|
'9290011370': [configurations.light_brightness],
|
2018-06-27 12:31:00 -07:00
|
|
|
'DNCKATSW001': [configurations.switch],
|
2018-06-30 00:48:21 -07:00
|
|
|
'Z809A': [configurations.switch, configurations.sensor_power],
|
2018-06-30 10:56:13 -07:00
|
|
|
'NL08-0800': [configurations.light_brightness],
|
2018-11-16 12:23:11 -07:00
|
|
|
'915005106701': [configurations.light_brightness_colortemp_colorxy],
|
2018-06-30 14:47:51 -07:00
|
|
|
'AB32840': [configurations.light_brightness_colortemp],
|
2018-11-16 12:23:11 -07:00
|
|
|
'8718696485880': [configurations.light_brightness_colortemp_colorxy],
|
2018-07-07 14:39:30 -07:00
|
|
|
'8718696598283': [configurations.light_brightness_colortemp],
|
2018-10-17 09:25:33 -07:00
|
|
|
'8718696695203': [configurations.light_brightness_colortemp],
|
2018-11-16 12:23:11 -07:00
|
|
|
'73693': [configurations.light_brightness_colortemp_colorxy],
|
2019-01-06 07:42:25 -07:00
|
|
|
'324131092621': [configurations.sensor_action, configurations.sensor_battery],
|
2018-08-29 00:11:41 -07:00
|
|
|
'9290012607': [
|
|
|
|
configurations.binary_sensor_occupancy, configurations.sensor_temperature,
|
2018-11-19 12:43:23 -07:00
|
|
|
configurations.sensor_illuminance, configurations.sensor_battery,
|
2018-08-29 00:11:41 -07:00
|
|
|
],
|
2018-11-16 12:23:11 -07:00
|
|
|
'GL-C-008': [configurations.light_brightness_colortemp_colorxy],
|
2018-11-19 12:43:23 -07:00
|
|
|
'STSS-MULT-001': [configurations.binary_sensor_contact, configurations.sensor_battery],
|
2018-10-29 13:12:37 -07:00
|
|
|
'E11-G23/E11-G33': [configurations.light_brightness],
|
2019-01-18 12:37:29 -07:00
|
|
|
'E1ACA4ABE38A': [configurations.light_brightness],
|
2018-11-16 12:23:11 -07:00
|
|
|
'AC03645': [configurations.light_brightness_colortemp_colorxy],
|
2018-07-22 09:49:45 -07:00
|
|
|
'AC03641': [configurations.light_brightness],
|
2018-12-24 11:08:11 -07:00
|
|
|
'AC03648': [configurations.light_brightness_colortemp],
|
2018-07-31 12:50:04 -07:00
|
|
|
'FB56+ZSW05HG1.2': [configurations.switch],
|
2018-07-31 13:04:22 -07:00
|
|
|
'72922-A': [configurations.switch],
|
2018-08-04 11:05:34 -07:00
|
|
|
'AC03642': [configurations.light_brightness_colortemp],
|
2019-08-13 10:47:43 -07:00
|
|
|
'AC08560': [configurations.light_brightness],
|
2018-08-04 11:05:34 -07:00
|
|
|
'DNCKATSW002': [switchWithPostfix('left'), switchWithPostfix('right')],
|
|
|
|
'DNCKATSW003': [switchWithPostfix('left'), switchWithPostfix('right'), switchWithPostfix('center')],
|
|
|
|
'DNCKATSW004': [
|
|
|
|
switchWithPostfix('bottom_left'), switchWithPostfix('bottom_right'),
|
|
|
|
switchWithPostfix('top_left'), switchWithPostfix('top_right'),
|
|
|
|
],
|
2018-08-09 09:10:22 -07:00
|
|
|
'BY 165': [configurations.light_brightness],
|
2018-08-10 15:57:21 -07:00
|
|
|
'ZLED-2709': [configurations.light_brightness],
|
2018-08-13 11:37:01 -07:00
|
|
|
'8718696548738': [configurations.light_brightness_colortemp],
|
2018-11-16 12:23:11 -07:00
|
|
|
'4052899926110': [configurations.light_brightness_colortemp_colorxy],
|
2018-08-15 12:10:19 -07:00
|
|
|
'Z01-CIA19NAE26': [configurations.light_brightness],
|
2018-11-16 12:23:11 -07:00
|
|
|
'E11-N1EA': [configurations.light_brightness_colortemp_colorxy],
|
2018-08-24 15:11:42 -07:00
|
|
|
'74283': [configurations.light_brightness],
|
2018-12-27 14:23:57 -07:00
|
|
|
'JTQJ-BF-01LM/BW': [
|
2019-02-03 10:07:17 -07:00
|
|
|
configurations.binary_sensor_gas,
|
2018-12-27 14:23:57 -07:00
|
|
|
configurations.sensor_gas_density,
|
|
|
|
],
|
2019-05-01 09:33:36 -07:00
|
|
|
'50043': [configurations.switch],
|
2018-09-11 09:01:48 -07:00
|
|
|
'50045': [configurations.light_brightness],
|
2018-11-19 12:43:23 -07:00
|
|
|
'AV2010/22': [configurations.binary_sensor_occupancy, configurations.sensor_battery],
|
2018-09-11 09:01:48 -07:00
|
|
|
'3210-L': [configurations.switch],
|
2018-12-04 12:40:47 -07:00
|
|
|
'3320-L': [configurations.binary_sensor_contact],
|
|
|
|
'3326-L': [configurations.binary_sensor_occupancy, configurations.sensor_temperature],
|
2018-11-16 12:23:11 -07:00
|
|
|
'7299355PH': [configurations.light_brightness_colorxy],
|
2018-09-20 13:23:12 -07:00
|
|
|
'45857GE': [configurations.light_brightness],
|
2018-09-18 13:24:17 -07:00
|
|
|
'A6121': [configurations.sensor_lock],
|
|
|
|
'433714': [configurations.light_brightness],
|
|
|
|
'3261030P7': [configurations.light_brightness_colortemp],
|
2019-01-01 05:28:50 -07:00
|
|
|
'3216431P5': [configurations.light_brightness_colortemp],
|
2019-01-06 07:42:25 -07:00
|
|
|
'DJT11LM': [configurations.sensor_action, configurations.sensor_battery],
|
2019-06-09 14:43:40 -07:00
|
|
|
'E1603/E1702': [configurations.switch],
|
2018-11-16 12:23:11 -07:00
|
|
|
'7199960PH': [configurations.light_brightness_colorxy],
|
2018-09-29 14:04:50 -07:00
|
|
|
'74696': [configurations.light_brightness],
|
2018-11-16 12:23:11 -07:00
|
|
|
'AB35996': [configurations.light_brightness_colortemp_colorxy],
|
2018-09-29 14:04:50 -07:00
|
|
|
'AB401130055': [configurations.light_brightness_colortemp],
|
2018-10-01 07:39:23 -07:00
|
|
|
'74282': [configurations.light_brightness_colortemp],
|
2018-10-17 12:16:06 -07:00
|
|
|
'RS 128 T': [configurations.light_brightness_colortemp],
|
2018-10-19 13:20:11 -07:00
|
|
|
'53170161': [configurations.light_brightness_colortemp],
|
2018-11-16 12:23:11 -07:00
|
|
|
'4058075036147': [configurations.light_brightness_colortemp_colorxy],
|
2018-10-19 13:26:14 -07:00
|
|
|
'KS-SM001': [configurations.switch],
|
2018-10-25 11:43:31 -07:00
|
|
|
'MG-AUWS01': [switchWithPostfix('left'), switchWithPostfix('right')],
|
2018-11-16 12:23:11 -07:00
|
|
|
'9290002579A': [configurations.light_brightness_colortemp_colorxy],
|
2018-10-29 13:34:48 -07:00
|
|
|
'4256251-RZHAC': [configurations.switch, configurations.sensor_power],
|
2018-11-19 12:43:23 -07:00
|
|
|
'STS-PRS-251': [configurations.binary_sensor_presence, configurations.sensor_battery],
|
2018-11-14 10:32:02 -07:00
|
|
|
'4058075816794': [configurations.light_brightness_colortemp],
|
|
|
|
'4052899926158': [configurations.light_brightness],
|
2018-11-16 12:23:11 -07:00
|
|
|
'4058075036185': [configurations.light_brightness_colortemp_colorxy],
|
|
|
|
'50049': [configurations.light_brightness_colorxy],
|
|
|
|
'915005733701': [configurations.light_brightness_colortemp_colorxy],
|
|
|
|
'RB 285 C': [configurations.light_brightness_colortemp_colorxy],
|
2018-11-14 10:32:02 -07:00
|
|
|
'3216331P5': [configurations.light_brightness_colortemp],
|
2018-11-16 14:00:09 -07:00
|
|
|
'AC08562': [configurations.light_brightness],
|
2018-11-27 13:19:53 -07:00
|
|
|
'900008-WW': [configurations.light_brightness],
|
|
|
|
'Mega23M12': [configurations.light_brightness_colortemp_colorxy],
|
2018-11-30 10:35:54 -07:00
|
|
|
'PSS-23ZBS': [configurations.switch],
|
2019-02-26 12:59:33 -07:00
|
|
|
'HS1SA': [configurations.binary_sensor_smoke, configurations.binary_sensor_battery_low],
|
2018-11-30 15:39:04 -07:00
|
|
|
'Z01-A19NAE26': [configurations.light_brightness_colortemp],
|
2019-08-06 12:16:07 -07:00
|
|
|
'AC01353010G': [
|
|
|
|
configurations.binary_sensor_occupancy, configurations.sensor_temperature,
|
|
|
|
configurations.binary_sensor_battery_low,
|
|
|
|
],
|
2018-12-14 14:08:01 -07:00
|
|
|
'SP 120': [configurations.switch, configurations.sensor_power],
|
|
|
|
'RB 248 T': [configurations.light_brightness_colortemp],
|
2019-02-26 12:59:33 -07:00
|
|
|
'HS3SA': [configurations.binary_sensor_smoke, configurations.binary_sensor_battery_low],
|
2019-05-29 10:33:15 -07:00
|
|
|
'HS1DS/HS3DS': [configurations.binary_sensor_contact],
|
|
|
|
'HS1WL/HS3WL': [configurations.binary_sensor_water_leak],
|
2019-05-02 10:59:23 -07:00
|
|
|
'HS1-WL-E': [configurations.binary_sensor_water_leak],
|
2018-12-14 14:08:01 -07:00
|
|
|
'421786': [configurations.light_brightness],
|
2019-01-13 09:28:56 -07:00
|
|
|
'ICZB-IW11D': [configurations.light_brightness],
|
2019-01-05 12:56:30 -07:00
|
|
|
'3321-S': [configurations.binary_sensor_contact, configurations.sensor_temperature],
|
2018-12-15 14:02:23 -07:00
|
|
|
'ZPIR-8000': [configurations.binary_sensor_occupancy],
|
|
|
|
'ZCTS-808': [configurations.binary_sensor_contact],
|
2018-12-19 09:55:35 -07:00
|
|
|
'ZNLDP12LM': [configurations.light_brightness_colortemp],
|
|
|
|
'D1821': [configurations.light_brightness_colortemp_colorxy],
|
2019-02-24 13:35:48 -07:00
|
|
|
'ZNCLDJ11LM': [configurations.cover_position, configurations.sensor_cover],
|
2018-12-27 14:23:57 -07:00
|
|
|
'LTFY004': [configurations.light_brightness_colorxy],
|
|
|
|
'GL-S-007Z': [configurations.light_brightness_colortemp_colorxy],
|
|
|
|
'3325-S': [configurations.sensor_temperature, configurations.binary_sensor_occupancy],
|
|
|
|
'4713407': [configurations.light_brightness],
|
2019-01-01 14:03:39 -07:00
|
|
|
'464800': [configurations.light_brightness_colortemp],
|
|
|
|
'3261331P7': [configurations.light_brightness_colortemp],
|
2019-02-08 16:37:07 -07:00
|
|
|
'4033930P7': [configurations.light_brightness_colortemp],
|
2019-01-01 14:03:39 -07:00
|
|
|
'GL-B-008Z': [configurations.light_brightness_colortemp_colorxy],
|
|
|
|
'AV2010/25': [configurations.switch, configurations.sensor_power],
|
2019-01-01 15:42:26 -07:00
|
|
|
'E12-N14': [configurations.light_brightness],
|
2019-04-16 07:31:05 -07:00
|
|
|
'1TST-EU': [configurations.thermostat, configurations.sensor_battery],
|
2019-01-06 07:31:08 -07:00
|
|
|
'RB 178 T': [configurations.light_brightness_colortemp],
|
|
|
|
'45856GE': [configurations.switch],
|
|
|
|
'GL-D-003Z': [configurations.light_brightness_colortemp_colorxy],
|
|
|
|
'GD-CZ-006': [configurations.light_brightness],
|
|
|
|
'AIRAM-CTR.U': [],
|
|
|
|
'HGZB-20-DE': [configurations.switch],
|
2019-01-08 10:46:38 -07:00
|
|
|
'D1531': [configurations.light_brightness],
|
|
|
|
'D1532': [configurations.light_brightness],
|
2019-01-08 11:38:56 -07:00
|
|
|
'AV2010/32': [],
|
|
|
|
'HGZB-07A': [configurations.light_brightness_colortemp_colorxy],
|
2019-08-06 12:16:07 -07:00
|
|
|
'E1524': [configurations.sensor_action, configurations.sensor_battery],
|
2019-03-25 13:53:39 -07:00
|
|
|
'GL-C-006/GL-C-009': [configurations.light_brightness_colortemp],
|
2019-01-13 11:11:15 -07:00
|
|
|
'100.424.11': [configurations.light_brightness_colortemp],
|
2019-05-14 12:46:55 -07:00
|
|
|
'AC0251100NJ': [configurations.sensor_action, configurations.sensor_battery],
|
2019-01-22 12:22:16 -07:00
|
|
|
'71831': [configurations.light_brightness_colortemp],
|
|
|
|
'404000/404005/404012': [configurations.light_brightness_colortemp_colorxy],
|
|
|
|
'404006/404008/404004': [configurations.light_brightness_colortemp],
|
2019-02-14 11:33:21 -07:00
|
|
|
'MLI-404011': [configurations.sensor_action],
|
2019-01-26 16:45:31 -07:00
|
|
|
'GL-S-003Z': [configurations.light_brightness_colortemp_colorxy],
|
|
|
|
'HS1DS-E': [configurations.binary_sensor_contact],
|
2019-01-28 14:10:44 -07:00
|
|
|
'SP600': [configurations.switch, configurations.sensor_power],
|
2019-01-28 14:22:20 -07:00
|
|
|
'1613V': [configurations.switch, configurations.sensor_power],
|
|
|
|
'XVV-Mega23M12': [configurations.light_brightness_colortemp],
|
2019-01-29 12:11:06 -07:00
|
|
|
'GL-B-007Z': [configurations.light_brightness_colortemp_colorxy],
|
|
|
|
'81809': [configurations.light_brightness_colortemp_colorxy],
|
2019-03-04 12:04:42 -07:00
|
|
|
'4090130P7': [configurations.light_brightness_colortemp_colorxy],
|
2019-02-01 11:58:12 -07:00
|
|
|
'100.110.39': [configurations.light_brightness_colortemp_colorxy],
|
2019-02-02 12:31:55 -07:00
|
|
|
'TI0001': [switchWithPostfix('left'), switchWithPostfix('right')],
|
2019-02-03 07:04:43 -07:00
|
|
|
'SPZB0001': [],
|
2019-02-05 10:26:17 -07:00
|
|
|
'HS3CG': [configurations.binary_sensor_gas],
|
|
|
|
'81825': [configurations.sensor_action],
|
|
|
|
'Z809AF': [configurations.switch, configurations.sensor_power],
|
2019-02-06 15:05:59 -07:00
|
|
|
'RADON TriTech ZB': [
|
|
|
|
configurations.binary_sensor_occupancy, configurations.sensor_temperature,
|
2019-03-03 10:37:46 -07:00
|
|
|
configurations.sensor_battery, configurations.binary_sensor_battery_low,
|
2019-02-06 15:05:59 -07:00
|
|
|
],
|
2019-02-08 17:01:08 -07:00
|
|
|
'IM-Z3.0-DIM': [configurations.light_brightness],
|
2019-02-10 12:35:26 -07:00
|
|
|
'E1746': [],
|
2019-02-11 11:59:50 -07:00
|
|
|
'YRD426NRSC': [configurations.lock, configurations.sensor_battery],
|
|
|
|
'E1743': [configurations.sensor_click, configurations.sensor_battery],
|
2019-02-14 11:45:52 -07:00
|
|
|
'LED1732G11': [configurations.light_brightness_colortemp],
|
2019-02-17 07:14:36 -07:00
|
|
|
'RB 265': [configurations.light_brightness],
|
2019-02-23 08:02:45 -07:00
|
|
|
'9290019758': [
|
|
|
|
configurations.binary_sensor_occupancy, configurations.sensor_temperature,
|
|
|
|
configurations.sensor_illuminance, configurations.sensor_battery,
|
|
|
|
],
|
2019-03-08 09:39:15 -07:00
|
|
|
'HGZB-042': [switchWithPostfix('top'), switchWithPostfix('bottom')],
|
2019-07-01 07:48:54 -07:00
|
|
|
'HGZB-42': [switchWithPostfix('top'), switchWithPostfix('bottom')],
|
2019-02-23 08:02:45 -07:00
|
|
|
'GL-FL-004TZ': [configurations.light_brightness_colortemp_colorxy],
|
|
|
|
'IM6001-OTP05': [configurations.switch],
|
|
|
|
'SV01': [
|
2019-02-25 09:56:47 -07:00
|
|
|
configurations.cover_position, configurations.sensor_temperature, configurations.sensor_pressure,
|
2019-02-23 08:02:45 -07:00
|
|
|
configurations.sensor_battery,
|
|
|
|
],
|
2019-07-01 07:48:54 -07:00
|
|
|
'SV02': [
|
|
|
|
configurations.cover_position, configurations.sensor_temperature, configurations.sensor_pressure,
|
|
|
|
configurations.sensor_battery,
|
|
|
|
],
|
2019-02-23 08:02:45 -07:00
|
|
|
'316GLEDRF': [configurations.light_brightness],
|
|
|
|
'LVS-ZB500D': [configurations.light_brightness],
|
|
|
|
'ST218': [],
|
2019-02-23 11:30:17 -07:00
|
|
|
'E1525': [configurations.binary_sensor_occupancy, configurations.sensor_battery],
|
|
|
|
'ZYCT-202': [configurations.sensor_action],
|
2019-02-24 05:29:46 -07:00
|
|
|
'GR-ZB01-W': [configurations.cover_position],
|
2019-03-02 08:35:00 -07:00
|
|
|
'4090531P7': [configurations.light_brightness_colortemp_colorxy],
|
2019-03-09 09:04:41 -07:00
|
|
|
'HGZB-42-UK / HGZB-41': [configurations.switch],
|
2019-03-03 10:37:46 -07:00
|
|
|
'ISW-ZPR1-WP13': [
|
|
|
|
configurations.binary_sensor_occupancy, configurations.sensor_temperature,
|
|
|
|
configurations.sensor_battery, configurations.binary_sensor_battery_low,
|
|
|
|
],
|
|
|
|
'9290018195': [configurations.light_brightness],
|
2019-03-06 14:09:51 -07:00
|
|
|
'HGZB-04D': [configurations.light_brightness],
|
2019-03-08 09:39:15 -07:00
|
|
|
'HGZB-043': [switchWithPostfix('top'), switchWithPostfix('bottom'), switchWithPostfix('center')],
|
2019-03-09 09:04:41 -07:00
|
|
|
'NCZ-3043-HA': [
|
|
|
|
configurations.binary_sensor_occupancy, configurations.sensor_temperature,
|
|
|
|
configurations.sensor_battery, configurations.binary_sensor_battery_low,
|
|
|
|
],
|
2019-05-24 09:32:37 -07:00
|
|
|
'NCZ-3041-HA': [
|
|
|
|
configurations.binary_sensor_occupancy, configurations.sensor_temperature,
|
|
|
|
configurations.sensor_battery, configurations.binary_sensor_battery_low,
|
|
|
|
],
|
|
|
|
'NCZ-3045-HA': [
|
|
|
|
configurations.binary_sensor_occupancy, configurations.sensor_temperature,
|
|
|
|
configurations.sensor_battery, configurations.binary_sensor_battery_low,
|
|
|
|
],
|
2019-03-09 09:04:41 -07:00
|
|
|
'STS-IRM-250': [
|
|
|
|
configurations.binary_sensor_occupancy, configurations.sensor_temperature,
|
|
|
|
configurations.sensor_battery, configurations.binary_sensor_battery_low,
|
|
|
|
],
|
|
|
|
'3305-S': [
|
|
|
|
configurations.binary_sensor_occupancy, configurations.sensor_temperature,
|
|
|
|
configurations.sensor_battery, configurations.binary_sensor_battery_low,
|
|
|
|
],
|
|
|
|
'3300-S': [
|
|
|
|
configurations.sensor_temperature, configurations.binary_sensor_contact,
|
|
|
|
configurations.sensor_battery, configurations.binary_sensor_battery_low,
|
|
|
|
],
|
2019-03-24 07:05:56 -07:00
|
|
|
'IM6001-BTP01': [configurations.sensor_click, configurations.sensor_temperature],
|
2019-03-10 06:12:11 -07:00
|
|
|
'AV2010/34': [configurations.sensor_click],
|
2019-07-11 10:36:50 -07:00
|
|
|
'PP-WHT-US': [
|
|
|
|
configurations.switch, configurations.sensor_power,
|
|
|
|
configurations.sensor_current, configurations.sensor_voltage,
|
|
|
|
],
|
2019-03-13 11:41:58 -07:00
|
|
|
'CR701-YZ': [
|
|
|
|
configurations.binary_sensor_battery_low, configurations.binary_sensor_carbon_monoxide,
|
|
|
|
configurations.binary_sensor_gas,
|
|
|
|
],
|
|
|
|
'HGZB-1S': [configurations.switch, configurations.sensor_click],
|
|
|
|
'HGZB-045': [configurations.switch, configurations.sensor_click],
|
|
|
|
'HGZB-43': [switchWithPostfix('top'), switchWithPostfix('bottom'), switchWithPostfix('center')],
|
2019-08-12 08:47:55 -07:00
|
|
|
'HGZB-01A': [configurations.switch],
|
|
|
|
'HGZB-02A': [configurations.light_brightness],
|
2019-03-13 11:41:58 -07:00
|
|
|
'MCT-350 SMA': [configurations.binary_sensor_contact],
|
2019-03-15 13:58:49 -07:00
|
|
|
'3310-S': [configurations.sensor_temperature, configurations.sensor_battery],
|
2019-08-06 12:06:26 -07:00
|
|
|
'IM6001-WLP01': [
|
|
|
|
configurations.sensor_temperature, configurations.binary_sensor_water_leak,
|
|
|
|
configurations.sensor_battery,
|
|
|
|
],
|
2019-03-15 13:58:49 -07:00
|
|
|
'3315-S': [
|
|
|
|
configurations.sensor_temperature, configurations.binary_sensor_water_leak,
|
|
|
|
configurations.sensor_battery,
|
|
|
|
],
|
|
|
|
'F-MLT-US-2': [
|
|
|
|
configurations.sensor_temperature, configurations.binary_sensor_contact,
|
|
|
|
configurations.sensor_battery, configurations.binary_sensor_battery_low,
|
|
|
|
],
|
|
|
|
'SWO-KEF1PA': [configurations.sensor_action],
|
|
|
|
'HGZB-02S': [configurations.sensor_click, configurations.switch],
|
|
|
|
'HGZB-41': [configurations.switch],
|
|
|
|
'ZG9101SAC-HP': [configurations.light_brightness],
|
2019-03-19 12:58:12 -07:00
|
|
|
'RS 122': [configurations.light_brightness],
|
|
|
|
'GL-B-001Z': [configurations.light_brightness_colortemp_colorxy],
|
2019-03-21 12:34:54 -07:00
|
|
|
'IM6001-MTP01': [
|
|
|
|
configurations.sensor_temperature, configurations.sensor_battery,
|
|
|
|
configurations.binary_sensor_occupancy,
|
|
|
|
],
|
|
|
|
'U86K31ND6': [switchWithPostfix('left'), switchWithPostfix('right'), switchWithPostfix('center')],
|
|
|
|
'HLD812-Z-SC': [configurations.light_brightness],
|
2019-04-19 11:44:11 -07:00
|
|
|
'HLC610-Z': [configurations.light_brightness],
|
2019-03-22 14:45:59 -07:00
|
|
|
'BY 285 C': [configurations.light_brightness_colortemp_colorxy],
|
|
|
|
'HS1RC-M': [configurations.sensor_action, configurations.sensor_battery],
|
2019-03-23 07:32:18 -07:00
|
|
|
'SWO-WDS1PA': [configurations.binary_sensor_contact],
|
2019-03-25 13:53:39 -07:00
|
|
|
'LLKZMK11LM': [switchWithPostfix('l1'), switchWithPostfix('l2')],
|
|
|
|
'LVS-SM10ZW': [configurations.binary_sensor_contact, configurations.binary_sensor_battery_low],
|
|
|
|
'HS2SK': [configurations.switch, configurations.sensor_power],
|
2019-06-13 12:48:04 -07:00
|
|
|
'45853GE': [configurations.switch, configurations.sensor_power],
|
2019-03-27 10:22:40 -07:00
|
|
|
'50064': [configurations.light_brightness_colortemp],
|
2019-03-30 12:50:40 -07:00
|
|
|
'9290011998B': [configurations.light_brightness_colortemp],
|
2019-04-07 06:38:27 -07:00
|
|
|
'4096730U7': [configurations.light_brightness_colortemp],
|
|
|
|
'RB 278 T': [configurations.light_brightness],
|
|
|
|
'3315-G': [
|
|
|
|
configurations.sensor_temperature, configurations.sensor_battery, configurations.binary_sensor_water_leak,
|
|
|
|
],
|
|
|
|
'N2G-SP': [configurations.sensor_power, configurations.switch],
|
2019-04-18 09:27:41 -07:00
|
|
|
'AC0363900NJ': [configurations.light_brightness_colortemp_colorxy],
|
|
|
|
'LXZB-02A': [configurations.light_brightness],
|
|
|
|
'GL-S-004Z': [configurations.light_brightness_colortemp],
|
|
|
|
'SCM-5ZBS': [configurations.cover_position],
|
|
|
|
'YRD226HA2619': [configurations.sensor_battery, configurations.lock],
|
|
|
|
'YMF40': [configurations.lock],
|
|
|
|
'V3-BTZB': [configurations.lock],
|
|
|
|
'3RSS008Z': [configurations.switch, configurations.sensor_battery],
|
2019-04-28 11:53:50 -07:00
|
|
|
'99432': [configurations.fan, configurations.light_brightness],
|
2019-04-26 12:57:38 -07:00
|
|
|
'511.10': [configurations.light_brightness],
|
|
|
|
'IM6001-MPP01': [
|
|
|
|
configurations.sensor_temperature, configurations.binary_sensor_contact, configurations.sensor_battery,
|
|
|
|
],
|
|
|
|
'HLC821-Z-SC': [configurations.light_brightness],
|
2019-04-28 12:14:52 -07:00
|
|
|
'RS 228 T': [configurations.light_brightness_colortemp],
|
|
|
|
'67200BL': [configurations.switch],
|
2019-05-02 10:59:23 -07:00
|
|
|
'2430-100': [configurations.sensor_action],
|
2019-05-05 11:14:30 -07:00
|
|
|
'100.425.90': [configurations.switch],
|
2019-05-10 09:25:08 -07:00
|
|
|
'74580': [configurations.light_brightness],
|
2019-06-11 11:07:32 -07:00
|
|
|
'HS1CA-E': [
|
|
|
|
configurations.binary_sensor_carbon_monoxide, configurations.binary_sensor_battery_low,
|
|
|
|
configurations.sensor_battery,
|
|
|
|
],
|
2019-05-14 09:04:47 -07:00
|
|
|
'MCT-340 E': [configurations.binary_sensor_contact],
|
2019-05-19 09:51:00 -07:00
|
|
|
'D1542': [configurations.light_brightness_colortemp],
|
2019-05-19 10:51:27 -07:00
|
|
|
'ZGRC-KEY-013': [configurations.sensor_click],
|
2019-05-20 11:53:51 -07:00
|
|
|
'ZigUP': [configurations.switch],
|
|
|
|
'YRD256HA20BP': [configurations.sensor_battery, configurations.lock],
|
|
|
|
'SZ-ESW01-AU': [configurations.sensor_power, configurations.switch],
|
2019-05-21 12:15:16 -07:00
|
|
|
'PSM-29ZBSR': [configurations.switch],
|
|
|
|
'ZM350STW1TCF': [configurations.light_brightness_colortemp],
|
|
|
|
'M350STW1': [configurations.light_brightness],
|
|
|
|
'A806S-Q1R': [configurations.light_brightness],
|
2019-05-22 13:09:13 -07:00
|
|
|
'XY12S-15': [configurations.light_brightness_colortemp_colorxy],
|
|
|
|
'B07KG5KF5R': [configurations.light_brightness_colortemp],
|
2019-05-24 09:32:37 -07:00
|
|
|
'SCM-S1': [configurations.cover_position],
|
|
|
|
'HEIMAN-M1': [configurations.binary_sensor_contact],
|
2019-05-29 10:33:15 -07:00
|
|
|
'3216131P5': [configurations.light_brightness_colortemp],
|
|
|
|
'ST8AU-CON': [configurations.light_brightness],
|
|
|
|
'HS3MS': [configurations.binary_sensor_occupancy],
|
|
|
|
'DIYRUZ_R4_5': [
|
|
|
|
switchWithPostfix('bottom_left'), switchWithPostfix('bottom_right'), switchWithPostfix('center'),
|
|
|
|
switchWithPostfix('top_left'), switchWithPostfix('top_right'),
|
|
|
|
],
|
|
|
|
'NCZ-3011-HA': [
|
|
|
|
configurations.binary_sensor_occupancy, configurations.sensor_humidity, configurations.sensor_temperature,
|
|
|
|
],
|
|
|
|
'MEAZON_BIZY_PLUG': [configurations.sensor_power, configurations.switch, configurations.sensor_temperature],
|
|
|
|
'MEAZON_DINRAIL': [configurations.sensor_power, configurations.switch, configurations.sensor_temperature],
|
|
|
|
'HS1CA-M': [configurations.binary_sensor_carbon_monoxide, configurations.binary_sensor_battery_low],
|
2019-05-29 11:26:40 -07:00
|
|
|
'7099860PH': [configurations.light_brightness_colorxy],
|
2019-06-09 14:43:40 -07:00
|
|
|
'HV-GSCXZB269': [configurations.light_brightness_colortemp],
|
|
|
|
'3216231P5': [configurations.light_brightness_colortemp],
|
|
|
|
'AC03647': [configurations.light_brightness_colortemp_colorxy],
|
|
|
|
'12031': [configurations.cover_position],
|
|
|
|
'421792': [configurations.light_brightness_colortemp_colorxy],
|
2019-06-13 13:01:39 -07:00
|
|
|
'HGZB-06A': [configurations.light_brightness_colortemp_colorxy],
|
2019-06-15 05:02:58 -07:00
|
|
|
'LED1733G7': [configurations.light_brightness_colortemp],
|
2019-06-19 12:44:44 -07:00
|
|
|
'9290011370B': [configurations.light_brightness],
|
2019-07-01 07:48:54 -07:00
|
|
|
'RB 250 C': [configurations.light_brightness_colortemp_colorxy],
|
|
|
|
'8718696170625': [configurations.light_brightness],
|
|
|
|
'GL-G-001Z': [configurations.light_brightness_colortemp_colorxy],
|
2019-07-03 08:38:43 -07:00
|
|
|
'HV-GSCXZB279_HV-GSCXZB229': [configurations.light_brightness_colortemp],
|
2019-07-04 11:16:20 -07:00
|
|
|
'HS2WD-E': [configurations.sensor_battery],
|
2019-07-08 12:42:07 -07:00
|
|
|
'ZNMS12LM': [
|
2019-07-08 13:04:38 -07:00
|
|
|
configurations.sensor_action, configurations.binary_sensor_lock, configurations.binary_sensor_lock_reverse,
|
2019-07-08 12:42:07 -07:00
|
|
|
],
|
2019-08-16 08:40:47 -07:00
|
|
|
'ZNMS13LM': [
|
|
|
|
configurations.sensor_action, configurations.binary_sensor_lock, configurations.binary_sensor_lock_reverse,
|
|
|
|
],
|
2019-07-08 12:42:07 -07:00
|
|
|
'12050': [configurations.switch, configurations.sensor_power],
|
2019-07-13 07:36:24 -07:00
|
|
|
'ROB_200-004-0': [configurations.light_brightness],
|
|
|
|
'RH3040': [configurations.sensor_battery, configurations.binary_sensor_occupancy],
|
2019-07-27 08:33:33 -07:00
|
|
|
'GLSK3ZB-1711': [configurations.switch],
|
|
|
|
'GLSK3ZB-1712': [switchWithPostfix('top'), switchWithPostfix('bottom')],
|
|
|
|
'GLSK3ZB-1713': [switchWithPostfix('top'), switchWithPostfix('center'), switchWithPostfix('bottom')],
|
|
|
|
'GLSK6ZB-1714': [
|
|
|
|
switchWithPostfix('top_left'), switchWithPostfix('bottom_left'),
|
|
|
|
switchWithPostfix('top_right'), switchWithPostfix('bottom_right'),
|
|
|
|
],
|
|
|
|
'GLSK6ZB-1715': [
|
|
|
|
switchWithPostfix('top_left'), switchWithPostfix('center_left'), switchWithPostfix('bottom_left'),
|
|
|
|
switchWithPostfix('top_right'), switchWithPostfix('bottom_right'),
|
|
|
|
],
|
|
|
|
'GLSK6ZB-1716': [
|
|
|
|
switchWithPostfix('top_left'), switchWithPostfix('center_left'), switchWithPostfix('bottom_left'),
|
|
|
|
switchWithPostfix('top_right'), switchWithPostfix('center_right'), switchWithPostfix('bottom_right'),
|
|
|
|
],
|
2019-07-18 11:24:14 -07:00
|
|
|
'3306431P7': [configurations.light_brightness_colortemp],
|
2019-08-11 05:12:30 -07:00
|
|
|
'AC08559': [configurations.light_brightness_colortemp],
|
|
|
|
'LVS-ZB15S': [configurations.switch],
|
|
|
|
'LZL4BWHL01': [configurations.sensor_action],
|
|
|
|
'2AJZ4KPKEY': [configurations.sensor_click, configurations.sensor_battery],
|
|
|
|
'2AJZ4KPFT': [configurations.sensor_temperature, configurations.sensor_humidity, configurations.sensor_battery],
|
|
|
|
'TT001ZAV20': [configurations.sensor_temperature, configurations.sensor_humidity, configurations.sensor_battery],
|
|
|
|
'ZM-CSW002-D': [switchWithPostfix('l1'), switchWithPostfix('l2'), configurations.sensor_power],
|
|
|
|
'LVS-SN10ZW': [configurations.sensor_battery, configurations.binary_sensor_occupancy],
|
|
|
|
'LVS-ZB15R': [configurations.switch],
|
|
|
|
'TH1123ZB': [configurations.thermostat],
|
2019-07-24 12:44:04 -07:00
|
|
|
'Zen-01-W': [configurations.thermostat],
|
|
|
|
'9290022166': [configurations.light_brightness_colortemp_colorxy],
|
2019-08-03 10:54:02 -07:00
|
|
|
'PM-C140-ZB': [configurations.sensor_power, configurations.switch],
|
2019-08-03 11:20:04 -07:00
|
|
|
'ptvo.switch': [
|
|
|
|
switchWithPostfix('bottom_left'), switchWithPostfix('bottom_right'), switchWithPostfix('top_left'),
|
|
|
|
switchWithPostfix('top_right'), switchWithPostfix('center'),
|
|
|
|
],
|
|
|
|
'DIYRuZ_R4_5': [
|
|
|
|
switchWithPostfix('bottom_left'), switchWithPostfix('bottom_right'), switchWithPostfix('top_left'),
|
|
|
|
switchWithPostfix('top_right'), switchWithPostfix('center'),
|
|
|
|
],
|
|
|
|
'DIYRuZ_KEYPAD20': [],
|
|
|
|
'DTB190502A1': [],
|
|
|
|
'RF 263': [configurations.light_brightness],
|
|
|
|
'F-WTR-UK-V2': [
|
|
|
|
configurations.sensor_temperature, configurations.binary_sensor_water_leak, configurations.sensor_battery,
|
|
|
|
],
|
|
|
|
'HS1CG-M': [configurations.binary_sensor_gas],
|
|
|
|
'LVS-SN10ZW_SN11': [configurations.sensor_battery, configurations.binary_sensor_occupancy],
|
2019-08-05 10:44:20 -07:00
|
|
|
'B00TN589ZG': [configurations.light_brightness],
|
|
|
|
'PSB19-SW27': [configurations.light_brightness],
|
2019-08-08 11:26:50 -07:00
|
|
|
// ubisys
|
|
|
|
'S1': [configurations.switch],
|
|
|
|
'S2': [switchWithPostfix('l1'), switchWithPostfix('l2')],
|
|
|
|
'D1': [configurations.light_brightness],
|
|
|
|
'J1': [configurations.cover_position_tilt],
|
2019-08-12 10:20:33 -07:00
|
|
|
'73741': [configurations.light_brightness_colortemp_colorxy],
|
|
|
|
'ZA806SQ1TCF': [configurations.light_brightness_colortemp],
|
|
|
|
'RF 265': [configurations.light_brightness],
|
2018-05-16 10:40:05 -07:00
|
|
|
};
|
|
|
|
|
2019-02-20 12:10:38 -07:00
|
|
|
Object.keys(mapping).forEach((key) => {
|
|
|
|
mapping[key].push(configurations.sensor_linkquality);
|
|
|
|
});
|
|
|
|
|
2018-11-16 12:23:11 -07:00
|
|
|
/**
|
|
|
|
* This extensions handles integration with HomeAssistant
|
|
|
|
*/
|
|
|
|
class HomeAssistant {
|
2019-02-04 10:36:49 -07:00
|
|
|
constructor(zigbee, mqtt, state, publishEntityState) {
|
2018-11-16 12:23:11 -07:00
|
|
|
this.zigbee = zigbee;
|
|
|
|
this.mqtt = mqtt;
|
|
|
|
this.state = state;
|
2019-02-04 10:36:49 -07:00
|
|
|
this.publishEntityState = publishEntityState;
|
2019-01-30 10:07:44 -07:00
|
|
|
this.zigbee2mqttVersion = zigbee2mqttVersion;
|
2018-04-25 11:54:41 -07:00
|
|
|
|
2018-11-16 12:23:11 -07:00
|
|
|
// A map of all discoverd devices
|
|
|
|
this.discovered = {};
|
2018-04-25 11:54:41 -07:00
|
|
|
|
2018-11-16 12:23:11 -07:00
|
|
|
if (!settings.get().advanced.cache_state) {
|
|
|
|
logger.warn('In order for HomeAssistant integration to work properly set `cache_state: true');
|
|
|
|
}
|
2019-03-04 10:13:36 -07:00
|
|
|
|
|
|
|
if (settings.get().experimental.output === 'attribute') {
|
|
|
|
throw new Error('Home Assitant integration is not possible with attribute output!');
|
|
|
|
}
|
2019-03-15 14:41:39 -07:00
|
|
|
|
|
|
|
this.discoveryTopic = settings.get().advanced.homeassistant_discovery_topic;
|
2019-06-24 11:52:47 -07:00
|
|
|
this.statusTopic = settings.get().advanced.homeassistant_status_topic;
|
2018-11-16 12:23:11 -07:00
|
|
|
}
|
2018-04-25 11:54:41 -07:00
|
|
|
|
2018-11-16 12:23:11 -07:00
|
|
|
onMQTTConnected() {
|
2019-06-24 11:52:47 -07:00
|
|
|
this.mqtt.subscribe(this.statusTopic);
|
2018-04-25 11:54:41 -07:00
|
|
|
|
2018-11-16 12:23:11 -07:00
|
|
|
// MQTT discovery of all paired devices on startup.
|
|
|
|
this.zigbee.getAllClients().forEach((device) => {
|
2018-12-07 15:17:29 -07:00
|
|
|
const mappedModel = zigbeeShepherdConverters.findByZigbeeModel(device.modelId);
|
|
|
|
if (mappedModel) {
|
|
|
|
this.discover(device.ieeeAddr, mappedModel, true);
|
2018-11-16 12:23:11 -07:00
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
2018-06-24 05:21:56 -07:00
|
|
|
|
2019-02-19 11:43:50 -07:00
|
|
|
discover(entityID, mappedModel, force=false) {
|
2018-11-16 12:23:11 -07:00
|
|
|
// Check if already discoverd and check if there are configs.
|
2019-02-19 11:43:50 -07:00
|
|
|
const discover = force || !this.discovered[entityID];
|
|
|
|
if (!discover) {
|
2018-11-16 12:23:11 -07:00
|
|
|
return;
|
2018-06-24 05:21:56 -07:00
|
|
|
}
|
2018-04-25 11:54:41 -07:00
|
|
|
|
2019-03-08 08:10:28 -07:00
|
|
|
const entity = settings.resolveEntity(entityID);
|
2019-02-19 11:43:50 -07:00
|
|
|
if (entity.type === 'device' && (!mapping[mappedModel.model] || !settings.getDevice(entity.ID))) {
|
|
|
|
return;
|
|
|
|
} else if (entity.type === 'group' && (!settings.getGroup(entity.ID))) {
|
|
|
|
return;
|
|
|
|
}
|
2018-11-16 12:23:11 -07:00
|
|
|
|
2018-12-07 15:17:29 -07:00
|
|
|
mapping[mappedModel.model].forEach((config) => {
|
2019-02-19 11:43:50 -07:00
|
|
|
const topic = `${config.type}/${entityID}/${config.object_id}/config`;
|
2018-11-16 12:23:11 -07:00
|
|
|
const payload = {...config.discovery_payload};
|
2019-02-23 08:02:45 -07:00
|
|
|
const stateTopic = `${settings.get().mqtt.base_topic}/${entity.friendlyName}`;
|
|
|
|
|
|
|
|
if (!payload.hasOwnProperty('state_topic') || payload.state_topic) {
|
|
|
|
payload.state_topic = stateTopic;
|
|
|
|
} else if (payload.hasOwnProperty('state_topic')) {
|
|
|
|
delete payload.state_topic;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (payload.position_topic) {
|
|
|
|
payload.position_topic = stateTopic;
|
|
|
|
}
|
2018-11-16 12:23:11 -07:00
|
|
|
|
2019-08-08 11:26:50 -07:00
|
|
|
if (payload.tilt_status_topic) {
|
|
|
|
payload.tilt_status_topic = stateTopic;
|
|
|
|
}
|
|
|
|
|
2019-01-14 10:04:33 -07:00
|
|
|
// Set json_attributes_topic for types which support this
|
|
|
|
// https://github.com/Koenkk/zigbee2mqtt/issues/840
|
2019-04-24 11:59:06 -07:00
|
|
|
if (['binary_sensor', 'sensor', 'lock', 'climate', 'fan'].includes(config.type)) {
|
2019-01-14 10:04:33 -07:00
|
|
|
payload.json_attributes_topic = payload.state_topic;
|
|
|
|
}
|
|
|
|
|
2018-12-07 15:13:20 -07:00
|
|
|
// Set (unique) name
|
2019-02-19 11:43:50 -07:00
|
|
|
payload.name = `${entity.friendlyName}_${config.object_id}`;
|
2018-11-16 12:23:11 -07:00
|
|
|
|
2018-12-07 15:09:15 -07:00
|
|
|
// Set unique_id
|
2019-02-19 11:43:50 -07:00
|
|
|
payload.unique_id = `${entityID}_${config.object_id}_${settings.get().mqtt.base_topic}`;
|
2018-11-16 12:23:11 -07:00
|
|
|
|
2018-12-07 15:17:29 -07:00
|
|
|
// Attributes for device registry
|
|
|
|
payload.device = {
|
2019-06-15 07:55:33 -07:00
|
|
|
identifiers: [`zigbee2mqtt_${entityID}`],
|
2019-02-19 11:43:50 -07:00
|
|
|
name: entity.friendlyName,
|
2019-01-30 10:07:44 -07:00
|
|
|
sw_version: `Zigbee2mqtt ${this.zigbee2mqttVersion}`,
|
2018-12-07 15:17:29 -07:00
|
|
|
model: `${mappedModel.description} (${mappedModel.model})`,
|
|
|
|
manufacturer: mappedModel.vendor,
|
|
|
|
};
|
|
|
|
|
2018-12-30 12:08:31 -07:00
|
|
|
// Set availability payload
|
2019-01-29 12:17:56 -07:00
|
|
|
// When using availability_timeout each device has it's own availability topic.
|
2018-12-30 12:08:31 -07:00
|
|
|
// If not, use the availability topic of zigbee2mqtt.
|
2019-01-29 12:17:56 -07:00
|
|
|
if (settings.get().advanced.availability_timeout) {
|
2019-02-19 11:43:50 -07:00
|
|
|
payload.availability_topic = `${settings.get().mqtt.base_topic}/${entity.friendlyName}/availability`;
|
2018-12-29 11:55:59 -07:00
|
|
|
} else {
|
|
|
|
payload.availability_topic = `${settings.get().mqtt.base_topic}/bridge/state`;
|
|
|
|
}
|
|
|
|
|
2019-01-08 11:00:47 -07:00
|
|
|
// Add precision to value_template
|
2019-02-19 11:43:50 -07:00
|
|
|
const device = settings.getDevice(entityID);
|
2019-02-09 11:42:31 -07:00
|
|
|
if (device.hasOwnProperty(`${config.object_id}_precision`)) {
|
|
|
|
const precision = device[`${config.object_id}_precision`];
|
2019-01-08 11:00:47 -07:00
|
|
|
let template = payload.value_template;
|
|
|
|
template = template.replace('{{ ', '').replace(' }}', '');
|
|
|
|
template = `{{ (${template} | float) | round(${precision}) }}`;
|
|
|
|
payload.value_template = template;
|
|
|
|
}
|
|
|
|
|
2018-11-16 12:23:11 -07:00
|
|
|
if (payload.command_topic) {
|
2019-02-19 11:43:50 -07:00
|
|
|
payload.command_topic = `${settings.get().mqtt.base_topic}/${entity.friendlyName}/`;
|
2018-04-29 05:09:49 -07:00
|
|
|
|
2018-11-16 12:23:11 -07:00
|
|
|
if (payload.command_topic_prefix) {
|
|
|
|
payload.command_topic += `${payload.command_topic_prefix}/`;
|
2019-02-07 11:33:00 -07:00
|
|
|
delete payload.command_topic_prefix;
|
2018-11-16 12:23:11 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
payload.command_topic += 'set';
|
2019-04-24 11:59:06 -07:00
|
|
|
|
|
|
|
if (payload.command_topic_postfix) {
|
|
|
|
payload.command_topic += `/${payload.command_topic_postfix}`;
|
|
|
|
delete payload.command_topic_postfix;
|
|
|
|
}
|
2018-04-29 05:09:49 -07:00
|
|
|
}
|
|
|
|
|
2019-02-23 08:02:45 -07:00
|
|
|
if (payload.set_position_topic && payload.command_topic) {
|
|
|
|
payload.set_position_topic = payload.command_topic;
|
|
|
|
}
|
|
|
|
|
2019-08-08 11:26:50 -07:00
|
|
|
if (payload.tilt_command_topic && payload.command_topic) {
|
|
|
|
// Home Assistant does not support templates to set tilt (as of 2019-08-17),
|
|
|
|
// so we (have to) use a subtopic.
|
|
|
|
payload.tilt_command_topic = payload.command_topic + '/tilt';
|
|
|
|
}
|
|
|
|
|
2019-04-16 07:31:05 -07:00
|
|
|
if (payload.mode_state_topic) {
|
|
|
|
payload.mode_state_topic = stateTopic;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (payload.mode_command_topic) {
|
|
|
|
payload.mode_command_topic = `${stateTopic}/set/system_mode`;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (payload.current_temperature_topic) {
|
|
|
|
payload.current_temperature_topic = stateTopic;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (payload.temperature_state_topic) {
|
|
|
|
payload.temperature_state_topic = stateTopic;
|
|
|
|
}
|
|
|
|
|
2019-04-24 11:59:06 -07:00
|
|
|
if (payload.speed_state_topic) {
|
|
|
|
payload.speed_state_topic = stateTopic;
|
|
|
|
}
|
|
|
|
|
2019-04-16 07:31:05 -07:00
|
|
|
if (payload.temperature_command_topic) {
|
|
|
|
payload.temperature_command_topic = `${stateTopic}/set/occupied_heating_setpoint`;
|
|
|
|
}
|
|
|
|
|
2019-04-24 11:59:06 -07:00
|
|
|
if (payload.speed_command_topic) {
|
|
|
|
payload.speed_command_topic = `${stateTopic}/set/fan_mode`;
|
|
|
|
}
|
|
|
|
|
2019-02-09 11:42:31 -07:00
|
|
|
// Override configuration with user settings.
|
|
|
|
if (device.hasOwnProperty('homeassistant')) {
|
|
|
|
const add = (obj) => {
|
|
|
|
Object.keys(obj).forEach((key) => {
|
2019-08-16 08:44:18 -07:00
|
|
|
if (['number', 'string', 'boolean'].includes(typeof obj[key])) {
|
2019-02-09 11:42:31 -07:00
|
|
|
payload[key] = obj[key];
|
2019-08-16 08:44:18 -07:00
|
|
|
} else if (typeof obj[key] === 'object' && obj[key] === null) {
|
|
|
|
delete payload[key];
|
2019-03-10 13:48:40 -07:00
|
|
|
} else if (key === 'device' && typeof obj[key] === 'object') {
|
|
|
|
Object.keys(obj['device']).forEach((key) => {
|
|
|
|
payload['device'][key] = obj['device'][key];
|
|
|
|
});
|
2019-02-09 11:42:31 -07:00
|
|
|
}
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
add(device.homeassistant);
|
|
|
|
|
|
|
|
if (device.homeassistant.hasOwnProperty(config.object_id)) {
|
|
|
|
add(device.homeassistant[config.object_id]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-03-15 14:41:39 -07:00
|
|
|
this.mqtt.publish(topic, JSON.stringify(payload), {retain: true, qos: 0}, null, this.discoveryTopic);
|
2018-11-16 12:23:11 -07:00
|
|
|
});
|
|
|
|
|
2019-02-19 11:43:50 -07:00
|
|
|
this.discovered[entityID] = true;
|
2018-11-16 12:23:11 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
onMQTTMessage(topic, message) {
|
2019-06-24 11:52:47 -07:00
|
|
|
if (!topic === this.statusTopic) {
|
2018-11-16 12:23:11 -07:00
|
|
|
return false;
|
2018-04-25 11:54:41 -07:00
|
|
|
}
|
|
|
|
|
2018-11-16 12:23:11 -07:00
|
|
|
if (message.toString().toLowerCase() === 'online') {
|
|
|
|
const timer = setTimeout(() => {
|
|
|
|
// Publish all device states.
|
|
|
|
this.zigbee.getAllClients().forEach((device) => {
|
2019-05-02 11:14:44 -07:00
|
|
|
if (this.state.exists(device.ieeeAddr)) {
|
2019-03-15 15:18:19 -07:00
|
|
|
this.publishEntityState(device.ieeeAddr, this.state.get(device.ieeeAddr));
|
2018-11-16 12:23:11 -07:00
|
|
|
}
|
|
|
|
});
|
2018-04-25 11:54:41 -07:00
|
|
|
|
2018-11-16 12:23:11 -07:00
|
|
|
clearTimeout(timer);
|
|
|
|
}, 20000);
|
|
|
|
}
|
2018-04-25 11:54:41 -07:00
|
|
|
|
2018-11-16 12:23:11 -07:00
|
|
|
return true;
|
2018-06-09 03:27:04 -07:00
|
|
|
}
|
|
|
|
|
2018-12-07 15:17:29 -07:00
|
|
|
onZigbeeMessage(message, device, mappedModel) {
|
|
|
|
if (device && mappedModel) {
|
|
|
|
this.discover(device.ieeeAddr, mappedModel);
|
2018-11-16 12:23:11 -07:00
|
|
|
}
|
|
|
|
}
|
2018-06-09 03:27:04 -07:00
|
|
|
|
2018-11-16 12:23:11 -07:00
|
|
|
// Only for homeassistant.test.js
|
|
|
|
_getMapping() {
|
|
|
|
return mapping;
|
|
|
|
}
|
2018-06-09 03:27:04 -07:00
|
|
|
}
|
|
|
|
|
2018-11-16 12:23:11 -07:00
|
|
|
module.exports = HomeAssistant;
|