Hello @nayelyz,
Analyzing the logs, I don’t think the problem is using MoveToLevelWithOnOff
I think the problem is in the automation. It is the problem that has already been reported that in order to establish actions of other capabilities it is always necessary to also activate the switch to on.
Then 2 commands are sent: (See the previous logs posted)
- Turn On: Turn on the device with the last known level. (currentLevel)
- MoveToLevelWithOnOff: turn the device On and to the level set in the command
This is confirmed if you turn off the device at 100% level and directly execute MoveToLevelWithOnOff in the details view, entering a level of 5%, for example.
It never turns on the device at the last known 100% level, it turns it on directly at the 5% level.
See logs with stock zigbee Switch version 2022-02-23T00:49:26.1289948
2022-02-24T11:33:32.052807930+00:00 INFO Zigbee Switch <ZigbeeDevice: 84944c69-fa8e-417e-bb62-92b7d5087d63 [0x1786] (Luz Mesita)> received command: {“component”:“main”,“positional_args”:[5],“args”:{“level”:5},“capability”:“switchLevel”,“command”:“setLevel”}
2022-02-24T11:33:32.067793930+00:00 TRACE Zigbee Switch Found CapabilityCommandDispatcher handler in zigbee_switch → ZLL Dimmer Bulb
2022-02-24T11:33:32.085218930+00:00 INFO Zigbee Switch <ZigbeeDevice: 84944c69-fa8e-417e-bb62-92b7d5087d63 [0x1786] (Luz Mesita)> sending Zigbee message: < ZigbeeMessageTx || Uint16: 0x0000, < AddressHeader || src_addr:
0x0000, src_endpoint: 0x01, dest_addr: 0x1786, dest_endpoint: 0x03, profile: 0x0104, cluster: Level >, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x01, seqno: 0x00, ZCLCommandId: 0x04 >, < MoveToLevelWithOnOff || level: 0x0C, transition_time: 0xFFFF, options_mask: 0x00, options_override: 0x00 > > >
2022-02-24T11:33:32.109081596+00:00 DEBUG Zigbee Switch Luz Mesita device thread event handled
2022-02-24T11:33:32.128604263+00:00 DEBUG Zigbee Switch Luz Mesita device thread event handled
2022-02-24T11:33:32.261906596+00:00 TRACE Zigbee Switch Received event with handler zigbee
2022-02-24T11:33:32.303585263+00:00 INFO Zigbee Switch <ZigbeeDevice: 84944c69-fa8e-417e-bb62-92b7d5087d63 [0x1786] (Luz Mesita)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0x1786, src_endpoint: 0x03, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: Level >, lqi: 0xB8, rssi: -54, body_length: 0x0005, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x18, seqno: 0x4F, ZCLCommandId: 0x0B >, < DefaultResponse || cmd: 0x04, ZclStatus: SUCCESS > > >
2022-02-24T11:33:32.418452263+00:00 DEBUG Zigbee Switch Luz Mesita device thread event handled
2022-02-24T11:33:32.444408596+00:00 TRACE Zigbee Switch Received event with handler zigbee
2022-02-24T11:33:32.514967930+00:00 INFO Zigbee Switch <ZigbeeDevice: 84944c69-fa8e-417e-bb62-92b7d5087d63 [0x1786] (Luz Mesita)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0x1786, src_endpoint: 0x03, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: OnOff >, lqi: 0xB8, rssi: -54, body_length: 0x0007, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x18, seqno: 0x8C, ZCLCommandId: 0x0A >, < ReportAttribute || < AttributeRecord || AttributeId: 0x0000, DataType: Boolean, OnOff: true > > > >
2022-02-24T11:33:32.641229263+00:00 TRACE Zigbee Switch Found ZigbeeMessageDispatcher handler in zigbee_switch
2022-02-24T11:33:32.657440930+00:00 INFO Zigbee Switch Executing ZclClusterAttributeValueHandler: cluster: OnOff, attribute: OnOff
2022-02-24T11:33:32.710351263+00:00 INFO Zigbee Switch <ZigbeeDevice: 84944c69-fa8e-417e-bb62-92b7d5087d63 [0x1786] (Luz Mesita)> emitting event: {“component_id”:“main”,“attribute_id”:“switch”,“capability_id”:“switch”,“state”:{“value”:“on”}}
2022-02-24T11:33:32.801464930+00:00 DEBUG Zigbee Switch Luz Mesita device thread event handled
2022-02-24T11:33:32.831217263+00:00 TRACE Zigbee Switch Received event with handler zigbee
2022-02-24T11:33:32.863446263+00:00 INFO Zigbee Switch <ZigbeeDevice: 84944c69-fa8e-417e-bb62-92b7d5087d63 [0x1786] (Luz Mesita)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0x1786, src_endpoint: 0x03, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: Level >, lqi: 0xB8, rssi: -54, body_length: 0x0007, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x18, seqno: 0x8D, ZCLCommandId: 0x0A >, < ReportAttribute || < AttributeRecord || AttributeId: 0x0000, DataType: Uint8, CurrentLevel: 0x0C > > > >
2022-02-24T11:33:33.045299597+00:00 TRACE Zigbee Switch Found ZigbeeMessageDispatcher handler in zigbee_switch
2022-02-24T11:33:33.054061930+00:00 INFO Zigbee Switch Executing ZclClusterAttributeValueHandler: cluster: Level, attribute: CurrentLevel
2022-02-24T11:33:33.068711263+00:00 INFO Zigbee Switch <ZigbeeDevice: 84944c69-fa8e-417e-bb62-92b7d5087d63 [0x1786] (Luz Mesita)> emitting event: {“component_id”:“main”,“attribute_id”:“level”,“capability_id”:“switchLevel”,“state”:{“value”:5}}
2022-02-24T11:33:33.108776597+00:00 DEBUG Zigbee Switch Luz Mesita device thread event handled
Once the level event is emitted, the attributes 0x0000 de OnOff and level is read and the level 5% event is emitted again
2022-02-24T11:33:34.121596597+00:00 INFO Zigbee Switch <ZigbeeDevice: 84944c69-fa8e-417e-bb62-92b7d5087d63 [0x1786] (Luz Mesita)> sending Zigbee message: < ZigbeeMessageTx || Uint16: 0x0000, < AddressHeader || src_addr:
0x0000, src_endpoint: 0x01, dest_addr: 0x1786, dest_endpoint: 0x03, profile: 0x0104, cluster: Level >, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x00, seqno: 0x00, ZCLCommandId: 0x00 >, < ReadAttribute || AttributeId: 0x0000 > > >
2022-02-24T11:33:34.135484597+00:00 INFO Zigbee Switch <ZigbeeDevice: 84944c69-fa8e-417e-bb62-92b7d5087d63 [0x1786] (Luz Mesita)> sending Zigbee message: < ZigbeeMessageTx || Uint16: 0x0000, < AddressHeader || src_addr:
0x0000, src_endpoint: 0x01, dest_addr: 0x1786, dest_endpoint: 0x03, profile: 0x0104, cluster: OnOff >, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x00, seqno: 0x00, ZCLCommandId: 0x00 >, < ReadAttribute || AttributeId: 0x0000 > > >
2022-02-24T11:33:34.162285264+00:00 DEBUG Zigbee Switch Luz Mesita device thread event handled
2022-02-24T11:33:34.248066597+00:00 TRACE Zigbee Switch Received event with handler zigbee
2022-02-24T11:33:34.260388597+00:00 INFO Zigbee Switch <ZigbeeDevice: 84944c69-fa8e-417e-bb62-92b7d5087d63 [0x1786] (Luz Mesita)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0x1786, src_endpoint: 0x03, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: Level >, lqi: 0xB8, rssi: -54, body_length: 0x0008, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x18, seqno: 0x50, ZCLCommandId: 0x01 >, < ReadAttributeResponse || < AttributeRecord || AttributeId: 0x0000, ZclStatus: SUCCESS, DataType: Uint8, CurrentLevel: 0x0C > > > >
2022-02-24T11:33:34.299747597+00:00 TRACE Zigbee Switch Found ZigbeeMessageDispatcher handler in zigbee_switch
2022-02-24T11:33:34.308163931+00:00 INFO Zigbee Switch Executing ZclClusterAttributeValueHandler: cluster: Level, attribute: CurrentLevel
2022-02-24T11:33:34.315910264+00:00 INFO Zigbee Switch <ZigbeeDevice: 84944c69-fa8e-417e-bb62-92b7d5087d63 [0x1786] (Luz Mesita)> emitting event: {“component_id”:“main”,“attribute_id”:“level”,“capability_id”:“switchLevel”,“state”:{“value”:5}}