APP Android version 1.7.85.25 issues

@nayelyz

I do define refresh handler, I just do not update ALL the capabilities (only some of the capabilities).
This is for multiple reasons:

  1. It is not always possible to read all attributes. In fact, for Tuya devices that are working with proprietary cluster, I just send a single Query all command and hope for the best. I process every message I get from the device, but the device might not update all attributes, so not necessary all capabilities are updated
  2. For virtual devices it make sense to update only some fields. For example, vDevices Controller not always shows a list of created devices, as it is a relatively heavy operation. It however allows user to refresh to show the complete list. There was no reason to emit events for other capabilities
  3. Even when working with physical devices, there are could be capabilities that might not be worth of refreshing. Some devices update energy measurement every 5 or 10 min, it make little sense to read energy measurement in smaller intervals

Thank you for sharing these use cases. I’ll share them with the engineering team in the report of the issue so they can see the uses of null values for capabilities.

@nayelyz
Sorry for not being clear.
There are no null values. All capabilities have real values set before the refresh.
Refresh handler only updates some capabilities.
The capabilities not being updated, show broken cloud

Aaah, got it, then this is a normal use case.
In my tests, I used a stock driver and it didn’t support the Refresh capability. When this happens, there should be a process that makes the refresh automatically but it was receiving not valid values and that’s why it might have shown the cloud disconnected icon.
Perhaps, as a workaround for those capabilities, you can use the device cache to get the last known value (get_latest_state, here’s an example) and send them in a capability event (device:emit_event())

Thank you @nayelyz .

I’m aware of this workaround, thank you.
Refresh worked fine on previous Android version, so for now, I’d like to understand whether it is expected behaviour that is going to stay or it is just a bug that is going to be fixed.

One more thing to consider:
There are limitations for events rate per device, per driver and per hub.
Sending unnecessary events from cached state is not scalable

1 Like

colorControl is no longer functional on detail view.

switch (and other capabilities) on detail view now changes state before the device generates an event.

What do you mean? it is not showing the buttons, you don’t receive the events or it shows an error?

Can you elaborate, please? So, instead of showing a “loading icon”, it just changes state and you don’t receive the event until after that?
I just tested a Switch and I see the events right when the state changes.

colorControl from detail view almost always generates a network error - same for Edge, DTH and Hue. On Edge, it doesn’t seem to be triggering the capability handler. Here’s Hue (the stock hub to hub integration):

switch when toggled on detail view immediately changes state without waiting for the event. This is best viewed on a slow to respond or non-responsive device.

Yes

For colorControl, it appears that at least part of the issue is that detail view is now sending two separate commands - a setHue and a setSaturation. Scenes/automations continue to work and generate a single setColor command. I’m guessing the behavior of detail view has been changed and used to generate a setColor command. The Edge z-wave library only includes a default handler for setColor. Meanwhile, the zigbee library includes default handlers for all three commands.

For Hue, the “Recently used colors” work, but the color selection wheel generates the network error.

Ok, so you get the network error because you’re not handling these events, correct?

In this case, are you also receiving the event but not handling it or you receive the network error directly? This is important because in each case, the issue is caused by different factors.

If it’s because of the capability event handlers, then, please add the missing ones as custom handlers. I’ll report this new behavior, if it’s expected, then, the default libraries (for Z-Wave) need to be updated.

In that case I meant Hue as in the stock Philips Hue hub to hub integration.

Pretty sure I understand this now to be two separate issues:

  • The color wheel generates an immediate network error. Same behavior with Z-wave Edge, ZigBee DTH, and the stock Philips Hue integration. I don’t see any command being generated on the Edge driver, so I have nothing to handle.

  • The recent colors work, but now generate setHue/setSaturatuon commands instead of setColor. This is not handled in the default z-wave library. I’m actually not getting an error in the app when I fail to handle those commands. The app shows the color change immediately and pretends like everything worked (same behavior as what I noted for switch above).

Is correct @philh30, Looking at the logs of a driver zigbee, I think too the problem is that in the details view the colorControl capability does NOT send the setColor command, which causes the MoveTo Hue and Sat command to be sent to the device, as it happened before and as it happens when you do it from an automation.

This log is for a setColor command from automation

2022-06-28T20:26:00.288237824+00:00 DEBUG Zigbee Light Multifunction Mc  Luz Cocina device thread event handled
2022-06-28T20:26:00.298239491+00:00 INFO Zigbee Light Multifunction Mc  <ZigbeeDevice: 175500e5-e3eb-425e-bd32-9b7cdfb3899a [0x79E2] (Luz Cocina)> received command: {"args":{"color":{"hue":4.407713413238525,"saturation":96.03174591064452}},"capability":"colorControl","command":"setColor","component":"main","positional_args":[{"hue":4.407713413238525,"saturation":96.03174591064452}]}
2022-06-28T20:26:00.305824158+00:00 TRACE Zigbee Light Multifunction Mc  Found CapabilityCommandDispatcher handler in zigbee_light_multifunctions -> XY Color Bulb
2022-06-28T20:26:00.311125158+00:00 PRINT Zigbee Light Multifunction Mc  <<<< set_color_handler XY >>>>
2022-06-28T20:26:00.318653158+00:00 INFO Zigbee Light Multifunction Mc  <ZigbeeDevice: 175500e5-e3eb-425e-bd32-9b7cdfb3899a [0x79E2] (Luz Cocina)> sending Zigbee message: < ZigbeeMessageTx || Uint16: 0x0000, < AddressHeader || src_addr: 0x0000, src_endpoint: 0x01, dest_addr: 0x79E2, dest_endpoint: 0x01, profile: 0x0104, cluster: Level >, < ZCLMessageBody || < ZCLHeader 
|| frame_ctrl: 0x01, seqno: 0x00, ZCLCommandId: 0x04 >, < MoveToLevelWithOnOff || level: 0xFE, transition_time: 0xFFFF, options_mask: 0x00, options_override: 0x00 > > >
2022-06-28T20:26:00.351429825+00:00 INFO Zigbee Light Multifunction Mc  <ZigbeeDevice: 175500e5-e3eb-425e-bd32-9b7cdfb3899a [0x79E2] (Luz Cocina)> sending Zigbee message: < ZigbeeMessageTx || Uint16: 0x0000, < AddressHeader || src_addr: 0x0000, src_endpoint: 0x01, dest_addr: 0x79E2, dest_endpoint: 0x01, profile: 0x0104, cluster: ColorControl >, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x01, seqno: 0x00, ZCLCommandId: 0x07 >, < MoveToColor || color_x: 0xB108, color_y: 0x4D1C, transition_time: 0x0000, options_mask: 0x00, options_override: 0x00 > > 
>

What it does now is that it sends the Hue command and then the Saturation command separately with what:

  • first you see a color with the hue command and the last saturation value
  • Then send the saturation value with the last hue value
  • Result, you see 2 colors different from the one you sent to device

This log is for a set a color from color control in detaill view

2022-06-28T20:04:09.896616298+00:00 TRACE Zigbee Light Multifunction Mc  Received event with handler capability
2022-06-28T20:04:09.925495965+00:00 INFO Zigbee Light Multifunction Mc  <ZigbeeDevice: 175500e5-e3eb-425e-bd32-9b7cdfb3899a [0x79E2] (Luz Cocina)> received command: {"args":{"hue":96.11},"capability":"colorControl","command":"setHue","component":"main","positional_args":[96.11]}
2022-06-28T20:04:09.934124632+00:00 TRACE Zigbee Light Multifunction Mc  Found CapabilityCommandDispatcher handler in zigbee_light_multifunctions -> XY Color Bulb
2022-06-28T20:04:09.945218298+00:00 PRINT Zigbee Light Multifunction Mc  <<<< set_hue_handler XY >>>>
2022-06-28T20:04:09.955065965+00:00 INFO Zigbee Light Multifunction Mc  <ZigbeeDevice: 175500e5-e3eb-425e-bd32-9b7cdfb3899a [0x79E2] (Luz Cocina)> sending Zigbee message: < ZigbeeMessageTx || Uint16: 0x0000, < AddressHeader || src_addr: 0x0000, src_endpoint: 0x01, dest_addr: 0x79E2, dest_endpoint: 0x01, profile: 0x0104, cluster: Level >, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x01, seqno: 0x00, ZCLCommandId: 0x04 >, < MoveToLevelWithOnOff || level: 0xFE, transition_time: 0xFFFF, options_mask: 0x00, options_override: 0x00 > > >
2022-06-28T20:04:09.993801298+00:00 INFO Zigbee Light Multifunction Mc  <ZigbeeDevice: 175500e5-e3eb-425e-bd32-9b7cdfb3899a [0x79E2] (Luz Cocina)> sending Zigbee message: < ZigbeeMessageTx || Uint16: 0x0000, < AddressHeader || src_addr: 0x0000, src_endpoint: 0x01, dest_addr: 0x79E2, dest_endpoint: 0x01, profile: 0x0104, cluster: ColorControl >, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x01, seqno: 0x00, ZCLCommandId: 0x07 >, < MoveToColor || color_x: 0x9079, color_y: 0x4085, transition_time: 0x0000, options_mask: 0x00, options_override: 0x00 > > >
2022-06-28T20:04:10.013006298+00:00 DEBUG Zigbee Light Multifunction Mc  Luz Cocina device thread event handled
2022-06-28T20:04:10.028769632+00:00 TRACE Zigbee Light Multifunction Mc  Received event with handler capability
2022-06-28T20:04:10.068521298+00:00 DEBUG Zigbee Light Multifunction Mc  Luz Cocina device thread event handled
2022-06-28T20:04:10.083288298+00:00 INFO Zigbee Light Multifunction Mc  <ZigbeeDevice: 175500e5-e3eb-425e-bd32-9b7cdfb3899a [0x79E2] (Luz Cocina)> received command: {"args":{"saturation":34.1},"capability":"colorControl","command":"setSaturation","component":"main","positional_args":[34.1]}
2022-06-28T20:04:10.090489298+00:00 TRACE Zigbee Light Multifunction Mc  Found CapabilityCommandDispatcher handler in zigbee_light_multifunctions -> XY Color Bulb
2022-06-28T20:04:10.100050965+00:00 PRINT Zigbee Light Multifunction Mc  <<<< set_saturation_handler XY >>>>
2022-06-28T20:04:10.107863965+00:00 INFO Zigbee Light Multifunction Mc  <ZigbeeDevice: 175500e5-e3eb-425e-bd32-9b7cdfb3899a [0x79E2] (Luz Cocina)> sending Zigbee message: < ZigbeeMessageTx || Uint16: 0x0000, < AddressHeader || src_addr: 0x0000, src_endpoint: 0x01, dest_addr: 0x79E2, dest_endpoint: 0x01, profile: 0x0104, cluster: Level >, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x01, seqno: 0x00, ZCLCommandId: 0x04 >, < MoveToLevelWithOnOff || level: 0xFE, transition_time: 0xFFFF, options_mask: 0x00, options_override: 0x00 > > >
2022-06-28T20:04:10.132558632+00:00 INFO Zigbee Light Multifunction Mc  <ZigbeeDevice: 175500e5-e3eb-425e-bd32-9b7cdfb3899a [0x79E2] (Luz Cocina)> sending Zigbee message: < ZigbeeMessageTx || Uint16: 0x0000, < AddressHeader || src_addr: 0x0000, src_endpoint: 0x01, dest_addr: 0x79E2, dest_endpoint: 0x01, profile: 0x0104, cluster: ColorControl >, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x01, seqno: 0x00, ZCLCommandId: 0x07 >, < MoveToColor || color_x: 0x5B2C, color_y: 0x384C, transition_time: 0x0000, options_mask: 0x00, options_override: 0x00 > > >

UPDATE:

From my.smartthings.com it works fine too. Send setColor command:

2022-06-28T21:30:02.115697746+00:00 TRACE Zigbee Light Multifunction Mc  Received event with handler capability
2022-06-28T21:30:02.145258079+00:00 INFO Zigbee Light Multifunction Mc  <ZigbeeDevice: 175500e5-e3eb-425e-bd32-9b7cdfb3899a [0x79E2] (Luz Cocina)> received command: {"args":{"color":{"hue":84,"saturation":72}},"capability":"colorControl","command":"setColor","component":"main","positional_args":[{"hue":84,"saturation":72}]}
2022-06-28T21:30:02.152266746+00:00 TRACE Zigbee Light Multifunction Mc  Found CapabilityCommandDispatcher handler in zigbee_light_multifunctions -> XY Color Bulb
2022-06-28T21:30:02.165157412+00:00 PRINT Zigbee Light Multifunction Mc  <<<< set_color_handler XY >>>>
2022-06-28T21:30:02.174485746+00:00 INFO Zigbee Light Multifunction Mc  <ZigbeeDevice: 175500e5-e3eb-425e-bd32-9b7cdfb3899a [0x79E2] (Luz Cocina)> sending Zigbee message: < ZigbeeMessageTx || Uint16: 0x0000, < AddressHeader || src_addr: 0x0000, src_endpoint: 0x01, dest_addr: 0x79E2, dest_endpoint: 0x01, profile: 0x0104, cluster: Level >, < ZCLMessageBody || < ZCLHeader 
|| frame_ctrl: 0x01, seqno: 0x00, ZCLCommandId: 0x04 >, < MoveToLevelWithOnOff || level: 0xFE, transition_time: 0xFFFF, options_mask: 0x00, options_override: 0x00 > > >
2022-06-28T21:30:02.216891746+00:00 INFO Zigbee Light Multifunction Mc  <ZigbeeDevice: 175500e5-e3eb-425e-bd32-9b7cdfb3899a [0x79E2] (Luz Cocina)> sending Zigbee message: < ZigbeeMessageTx || Uint16: 0x0000, < AddressHeader || src_addr: 0x0000, src_endpoint: 0x01, dest_addr: 0x79E2, dest_endpoint: 0x01, profile: 0x0104, cluster: ColorControl >, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x01, seqno: 0x00, ZCLCommandId: 0x07 >, < MoveToColor || color_x: 0x65B9, color_y: 0x24A1, transition_time: 0x0000, options_mask: 0x00, options_override: 0x00 > > 
>