Zigbee2mqtt Dimmer Switch Light Control

Takes a zigbee2mqtt action from a dimmer switch and uses it to control lights.

Language: JavaScript

Dependencies:
MQTT

Changelog

Version 0.1

  • initial release

Resources

uid: cossey:mqtt_dimmer_light
label: MQTT Dimmer/Switch Lighting Control
description: 
configDescriptions:
  - name: mqttTrigger1
    label: MQTT Light Switch Trigger 1
    description: Select the MQTT light switch triggers
    type: TEXT
    context: channel
    filterCriteria:
      - name: kind
        value: TRIGGER
    required: true
  - name: mqttTrigger2
    label: MQTT Light Switch Trigger 2
    description: Select the MQTT light switch triggers
    type: TEXT
    context: channel
    filterCriteria:
      - name: kind
        value: TRIGGER
    required: false
    defaultValue: ''
  - name: lights
    label: Lights
    description: Select the Light items to affect
    type: TEXT
    context: item
    filterCriteria:
      - name: kind
        value: Switch
      - name: type
        value: Switch
    required: true
    multiple: true
triggers:
  - id: "1"
    configuration:
      channelUID: "{{mqttTrigger1}}"
    type: core.ChannelEventTrigger
  - id: "2"
    configuration:
      channelUID: "{{mqttTrigger2}}"
    type: core.ChannelEventTrigger
conditions: []
actions:
  - inputs: {}
    id: "3"
    type: script.ScriptAction
    configuration:
      type: application/javascript
      script: >-
        var lights = {{lights}};
        console.log(lights);