Hello i am trying to switch from deconz to Z2M. (add-on in home assistant)
Now i have paired one Busch-Jaeger switch 6737 with dim module to Z2M
But i cannot dim the light bulb that is connected to the switch from Z2M.
Also there is no brightness available in Home assistant.
i can turn on/off the lamp from home assistant
also the actions of the buttons are coming to home assistant.
if i use node-red i can send {“brightness_relay”: “255”} to the topic
zigbee2mqtt/FRIENDLY_NAME/set
and change the brightness
This is what Z2M shows:
{
"brightness_relay": 254,
"linkquality": 94,
"state": "ON",
"state_relay": "ON",
"action": null
}
but in home assistant no brightness entity is created
is there a way to add these variabels manually to home assitant ?
nickrout
(Nick Rout)
November 21, 2022, 6:22am
2
This sort of device publishes an action when you press a button. The Actions are described here
https://www.zigbee2mqtt.io/devices/6735_6736_6737.html#action-enum
So in HA you have to automate based on that action.
Here is an example from a different device, but they all work this way:
alias: Dim Up Dining Lights
description: ""
trigger:
- platform: device
domain: mqtt
device_id: 44f8adc86e1f6ff305055755fb569a28
type: action
subtype: button_6_single
discovery_id: 0x04cf8cdf3c791f3f action_button_6_single
condition: []
action:
- service: light.turn_on
target:
entity_id: light.dining_table_lights
data:
transition: 3
brightness_step_pct: 10
mode: single
Although I have posted yaml, this is entirely do-able from the autmation UI.
Thanks for the response,
There are 3 Switch modules 1,2 and 4 buttons
which can be combined with 3 modules.
Power supply, Dim and Relay module.
If use a power supply only actions can be used as described in your link.
if used a Relay module Button No. 1 is used for switch on/off the connected light.
If used a dim module Button No. 1 is used for switch on/off the connected light.
And press long up dim up press long down dim down.
If I publish a message to “brightness_relay”: 254 I can dim the light.
If a publish a message to “state”: “ON” I can switch the light on/off
The “state_relay”: “ON” gives the actual state of the light on the module
Can I create a light in configuraton yaml with these settings ?
Now the auto creation is not working, now I have this:
Actions are coming to home assistant
The state is created as an entity, I can use this to switch the light on/off
Downside is that this is not the current state of the module, this is pulished in “state_relay”: “ON”
nickrout
(Nick Rout)
November 21, 2022, 7:26am
4
Do you have legacy set to true or false?
i have create 3 new lights and added the following:
Made a new folder
/config/mqtt/
Changed the following in configuration.yaml
mqtt: !include_dir_merge_named mqtt/
Then i ceated a new fille in /config/mqtt/
/config/mqtt/mqtt_light.yaml
There i added the following:
# Example mqtt.yaml entry
light:
- name: "Overkapping wand template mqtt"
state_topic: "zigbee2mqtt/Woonkamer overkapping wandlamp Z2M"
command_topic: "zigbee2mqtt/Woonkamer overkapping wandlamp Z2M/set/state"
brightness_state_topic: "zigbee2mqtt/Woonkamer overkapping wandlamp Z2M"
brightness_command_topic: "zigbee2mqtt/Woonkamer overkapping wandlamp Z2M/set/brightness_relay"
state_value_template: "{{ value_json.state_relay }}"
brightness_value_template: "{{ value_json.brightness_relay }}"
qos: 0
payload_on: "ON"
payload_off: "OFF"
optimistic: false
- name: "Keuken template mqtt"
state_topic: "zigbee2mqtt/Keuken licht keuken Z2M"
command_topic: "zigbee2mqtt/Keuken licht keuken Z2M/set/state"
brightness_state_topic: "zigbee2mqtt/Keuken licht keuken Z2M"
brightness_command_topic: "zigbee2mqtt/Keuken licht keuken Z2M/set/brightness_relay"
state_value_template: "{{ value_json.state_relay }}"
brightness_value_template: "{{ value_json.brightness_relay }}"
qos: 0
payload_on: "ON"
payload_off: "OFF"
optimistic: false
- name: "Tafel template mqtt"
state_topic: "zigbee2mqtt/Woonkamer licht tafel Z2M"
command_topic: "zigbee2mqtt/Woonkamer licht tafel Z2M/set/state"
brightness_state_topic: "zigbee2mqtt/Woonkamer licht tafel Z2M"
brightness_command_topic: "zigbee2mqtt/Woonkamer licht tafel Z2M/set/brightness_relay"
state_value_template: "{{ value_json.state_relay }}"
brightness_value_template: "{{ value_json.brightness_relay }}"
qos: 0
payload_on: "ON"
payload_off: "OFF"
optimistic: false
Looks like it is working now, downside the state / brightness feedback is slow +/- 3 sec.