I did exactly that. It works… but it is very slow… the response time is around 1 second… or more…
- to move the dimmer
- the dimmer talk to the coordinator which talk to zigbee2mqtt
- the coordinator talk to mqtt
- mqtt to HA
- HA run automation which talk to mqtt
- mqtt talk to zigbee2mqtt which talk to the coordinator
- and finally the coordinator talk to the lamp
(and all this is repeated many times)
this is my HA config justy in case it may help
- alias: Dimmer Piano Lamp
trigger:
platform: mqtt
topic: 'zigbee2mqtt/Piano Dimmer'
condition:
condition: template
value_template: '{{ trigger.payload_json.brightness is number }}'
action:
service: light.turn_on
data_template:
entity_id: light.piano_lamp
brightness: '{{ trigger.payload_json.brightness }}'
and this the how they talk each other via mqtt
11/2/2019, 6:56:56 PM - info: MQTT publish: topic 'zigbee2mqtt/Piano Lamp', payload '{"state":"OFF","brightness":255,"linkquality":84,"last_seen":"2019-11-02T18:56:56+00:00"}'
11/2/2019, 6:56:56 PM - info: Zigbee publish to device 'Piano Lamp', genOnOff - off - {} - {"manufSpec":0,"disDefaultRsp":0} - 1
11/2/2019, 6:56:56 PM - info: MQTT publish: topic 'zigbee2mqtt/Piano Lamp', payload '{"state":"OFF","brightness":255,"linkquality":84,"last_seen":"2019-11-02T18:56:56+00:00"}'
11/2/2019, 6:56:56 PM - info: Zigbee publish to device 'Piano Lamp', genOnOff - off - {} - {"manufSpec":0,"disDefaultRsp":0} - 1
11/2/2019, 6:56:56 PM - info: MQTT publish: topic 'zigbee2mqtt/Piano Lamp', payload '{"state":"OFF","brightness":255,"linkquality":84,"last_seen":"2019-11-02T18:56:56+00:00"}'
11/2/2019, 6:56:56 PM - info: Zigbee publish to device 'Piano Lamp', genOnOff - off - {} - {"manufSpec":0,"disDefaultRsp":0} - 1
11/2/2019, 6:56:56 PM - info: MQTT publish: topic 'zigbee2mqtt/Piano Lamp', payload '{"state":"OFF","brightness":255,"linkquality":84,"last_seen":"2019-11-02T18:56:56+00:00"}'
11/2/2019, 6:56:56 PM - info: Zigbee publish to device 'Piano Lamp', genOnOff - off - {} - {"manufSpec":0,"disDefaultRsp":0} - 1
11/2/2019, 6:56:56 PM - info: MQTT publish: topic 'zigbee2mqtt/Piano Lamp', payload '{"state":"OFF","brightness":255,"linkquality":84,"last_seen":"2019-11-02T18:56:56+00:00"}'
11/2/2019, 6:56:56 PM - info: Zigbee publish to device 'Piano Lamp', genOnOff - off - {} - {"manufSpec":0,"disDefaultRsp":0} - 1
11/2/2019, 6:56:56 PM - info: MQTT publish: topic 'zigbee2mqtt/Piano Lamp', payload '{"state":"OFF","brightness":255,"linkquality":84,"last_seen":"2019-11-02T18:56:56+00:00"}'
11/2/2019, 6:56:56 PM - info: Zigbee publish to device 'Piano Lamp', genOnOff - off - {} - {"manufSpec":0,"disDefaultRsp":0} - 1
11/2/2019, 6:56:56 PM - info: MQTT publish: topic 'zigbee2mqtt/Piano Lamp', payload '{"state":"OFF","brightness":255,"linkquality":84,"last_seen":"2019-11-02T18:56:56+00:00"}'
11/2/2019, 6:56:56 PM - info: Zigbee publish to device 'Piano Lamp', genOnOff - off - {} - {"manufSpec":0,"disDefaultRsp":0} - 1
11/2/2019, 6:56:56 PM - info: MQTT publish: topic 'zigbee2mqtt/Piano Lamp', payload '{"state":"OFF","brightness":255,"linkquality":84,"last_seen":"2019-11-02T18:56:56+00:00"}'
11/2/2019, 6:56:57 PM - info: Zigbee publish to device 'Piano Lamp', genLevelCtrl - moveToLevelWithOnOff - {"level":5,"transtime":0} - {"manufSpec":0,"disDefaultRsp":0} - 1
11/2/2019, 6:56:57 PM - info: MQTT publish: topic 'zigbee2mqtt/Piano Lamp', payload '{"state":"ON","brightness":5,"linkquality":84,"last_seen":"2019-11-02T18:56:57+00:00"}'
11/2/2019, 6:56:57 PM - info: MQTT publish: topic 'zigbee2mqtt/Piano Lamp', payload '{"state":"ON","brightness":5,"linkquality":84,"last_seen":"2019-11-02T18:56:57+00:00","elapsed":30782}'
11/2/2019, 6:56:57 PM - info: MQTT publish: topic 'zigbee2mqtt/Piano Lamp', payload '{"state":"ON","brightness":5,"linkquality":84,"last_seen":"2019-11-02T18:56:57+00:00","elapsed":12}'
11/2/2019, 6:56:57 PM - info: MQTT publish: topic 'zigbee2mqtt/Piano Lamp', payload '{"state":"ON","brightness":5,"linkquality":84,"last_seen":"2019-11-02T18:56:57+00:00","elapsed":6}'
11/2/2019, 6:56:57 PM - info: Zigbee publish to device 'Piano Lamp', genLevelCtrl - moveToLevelWithOnOff - {"level":5,"transtime":0} - {"manufSpec":0,"disDefaultRsp":0} - 1
11/2/2019, 6:56:57 PM - info: MQTT publish: topic 'zigbee2mqtt/Piano Lamp', payload '{"state":"ON","brightness":5,"linkquality":84,"last_seen":"2019-11-02T18:56:57+00:00"}'
Just wandering if is there a more efficient way ??