home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
70k stars 29.08k forks source link

ZHA & ptvo.info bmp280 #37845

Closed pruwait closed 4 years ago

pruwait commented 4 years ago

The problem

No objects for bmp280 Data Clusters. Can't read value from temperature, humidity, pressure. In logs DATA exists.

Only switch and binary sensor is is created.

Environment

cc2530_io_1.2.2a.44539_firmware cc2530 bmp280

arch | x86_64 chassis | desktop dev | false docker | true docker_version | 19.03.8 hassio | true host_os | Ubuntu 20.04 LTS installation_type | Home Assistant Supervised os_name | Linux os_version | 5.4.0-40-generic python_version | 3.7.7 supervisor | 228 timezone | Europe/Moscow version | 0.112.4 virtualenv | false

Problem-relevant configuration Zigbee device


{
  "node_descriptor": "<Optional byte1=1 byte2=64 mac_capability_flags=142 manufacturer_code=4447 maximum_buffer_size=80 maximum_incoming_transfer_size=160 server_mask=0 maximum_outgoing_transfer_size=160 descriptor_capability_field=0>",
  "endpoints": {
    "1": {
      "profile_id": 260,
      "device_type": "0x0100",
      "in_clusters": [
        "0x0000",
        "0x0006",
        "0x000c",
        "0x0b05"
      ],
      "out_clusters": [
        "0x0000",
        "0x0006",
        "0x0b05"
      ]
    },
    "2": {
      "profile_id": 260,
      "device_type": "0x0100",
      "in_clusters": [
        "0x0012"
      ],
      "out_clusters": []
    },
    "3": {
      "profile_id": 260,
      "device_type": "0x0100",
      "in_clusters": [
        "0x0006",
        "0x000c"
      ],
      "out_clusters": [
        "0x0006"
      ]
    },
    "4": {
      "profile_id": 260,
      "device_type": "0x0100",
      "in_clusters": [
        "0x0012"
      ],
      "out_clusters": []
    },
    "6": {
      "profile_id": 260,
      "device_type": "0x0100",
      "in_clusters": [
        "0x000c"
      ],
      "out_clusters": []
    }
  },
  "manufacturer": "ptvo.info",
  "model": "ptvo.switch",
  "class": "zigpy.device.Device"
}

Traceback/Error logs

Device 0x0830 (00:12:4b:00:1d:38:d3:c6) joined the network
[0x0830:zdo] ZDO request ZDOCmd.Device_annce: [0x0830, 00:12:4b:00:1d:38:d3:c6, 142]
[0x0830] Requesting 'Node Descriptor'
Tries remaining: 2
[0x0830] Extending timeout for 0xa0 request
[0x0830] Node Descriptor: <Optional byte1=1 byte2=64 mac_capability_flags=142 manufacturer_code=4447 maximum_buffer_size=80 maximum_incoming_transfer_size=160 server_mask=0 maximum_outgoing_transfer_size=160 descriptor_capability_field=0>
[0x0830] Discovering endpoints
Tries remaining: 3
Ignoring message (b'00000a00001000') on cluster 6: unknown endpoint or cluster id: 1
[0x0830] Discovered endpoints: [6, 4, 3, 2, 1]
[0x0830:6] Discovering endpoint information
Tries remaining: 3
Ignoring message (b'00010a00001000') on cluster 6: unknown endpoint or cluster id: 'No cluster ID 0x0006 on (00:12:4b:00:1d:38:d3:c6, 3)'
[0x0830:6] Discovered endpoint information: <Optional endpoint=6 profile=260 device_type=256 device_version=0 input_clusters=[12] output_clusters=[]>
[0x0830:4] Discovering endpoint information
Tries remaining: 3
[0x0830:4] Discovered endpoint information: <Optional endpoint=4 profile=260 device_type=256 device_version=0 input_clusters=[18] output_clusters=[]>
[0x0830:3] Discovering endpoint information
Tries remaining: 3
[0x0830:6:0x000c] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=False disable_default_response=False> manufacturer=None tsn=2 command_id=Command.Report_Attributes>
[0x0830:6:0x000c] ZCL request 0x000a: [[<Attribute attrid=85 value=<TypeValue type=float, value=29.670000076293945>>, <Attribute attrid=28 value=<TypeValue type=CharacterString, value=C,77>>]]
[0x0830:6:0x000c] Attribute report received: present_value=29.670000076293945, description=C,77
[0x0830:6:0x000c] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=False disable_default_response=False> manufacturer=None tsn=3 command_id=Command.Report_Attributes>
[0x0830:6:0x000c] ZCL request 0x000a: [[<Attribute attrid=85 value=<TypeValue type=float, value=99570.0>>, <Attribute attrid=28 value=<TypeValue type=CharacterString, value=Pa,77>>]]
[0x0830:6:0x000c] Attribute report received: present_value=99570.0, description=Pa,77
[0x0830:6:0x000c] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=False disable_default_response=False> manufacturer=None tsn=4 command_id=Command.Report_Attributes>
[0x0830:6:0x000c] ZCL request 0x000a: [[<Attribute attrid=85 value=<TypeValue type=float, value=147.1482391357422>>, <Attribute attrid=28 value=<TypeValue type=CharacterString, value=m,77>>]]
[0x0830:6:0x000c] Attribute report received: present_value=147.1482391357422, description=m,77
[0x0830:6:0x000c] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=False disable_default_response=False> manufacturer=None tsn=5 command_id=Command.Report_Attributes>
[0x0830:6:0x000c] ZCL request 0x000a: [[<Attribute attrid=85 value=<TypeValue type=float, value=54.0830078125>>, <Attribute attrid=28 value=<TypeValue type=CharacterString, value=%,77>>]]
[0x0830:6:0x000c] Attribute report received: present_value=54.0830078125, description=%,77
[0x0830:3] Discovered endpoint information: <Optional endpoint=3 profile=260 device_type=256 device_version=0 input_clusters=[12, 6] output_clusters=[6]>
[0x0830:2] Discovering endpoint information
Tries remaining: 3
[0x0830:2] Discovered endpoint information: <Optional endpoint=2 profile=260 device_type=256 device_version=0 input_clusters=[18] output_clusters=[]>
[0x0830:1] Discovering endpoint information
Tries remaining: 3
[0x0830:1] Discovered endpoint information: <Optional endpoint=1 profile=260 device_type=256 device_version=0 input_clusters=[0, 2821, 12, 6] output_clusters=[0, 2821, 6]>
[0x0830:1:0x0000] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=True disable_default_response=True> manufacturer=None tsn=178 command_id=Command.Read_Attributes_rsp>
[0x0830:1] Manufacturer: ptvo.info
[0x0830:1] Model: ptvo.switch
Checking quirks for ptvo.info ptvo.switch (00:12:4b:00:1d:38:d3:c6)
Considering <class 'bellows.zigbee.application.EZSPCoordinator'>
Fail because endpoint list mismatch: {1} {1, 2, 3, 4, 6}
Considering <class 'zhaquirks.gledopto.soposhgu10.SoposhGU10'>
Fail because endpoint list mismatch: {11, 13} {1, 2, 3, 4, 6}
Considering <class 'zhaquirks.lutron.lzl4bwhl01remote.LutronLZL4BWHL01Remote2'>
Fail because endpoint list mismatch: {1} {1, 2, 3, 4, 6}
Considering <class 'zhaquirks.netvox.z308e3ed.Z308E3ED'>
Fail because endpoint list mismatch: {1} {1, 2, 3, 4, 6}
Considering <class 'zhaquirks.osram.a19twhite.A19TunableWhite'>
Fail because endpoint list mismatch: {3} {1, 2, 3, 4, 6}
Considering <class 'zhaquirks.philips.rom001.PhilipsROM001'>
Fail because endpoint list mismatch: {1} {1, 2, 3, 4, 6}
Considering <class 'zhaquirks.philips.rwl020.PhilipsRWL020'>
Fail because endpoint list mismatch: {1, 2} {1, 2, 3, 4, 6}
Considering <class 'zhaquirks.philips.rwl021.PhilipsRWL021'>
Fail because endpoint list mismatch: {1, 2} {1, 2, 3, 4, 6}
Considering <class 'zhaquirks.smartthings.multi.SmartthingsMultiPurposeSensor'>
Fail because endpoint list mismatch: {1} {1, 2, 3, 4, 6}
Considering <class 'zhaquirks.smartthings.tag_v4.SmartThingsTagV4'>
Fail because endpoint list mismatch: {1} {1, 2, 3, 4, 6}
Considering <class 'zhaquirks.xbee.xbee3_io.XBee3Sensor'>
Fail because endpoint list mismatch: {232, 230} {1, 2, 3, 4, 6}
Considering <class 'zhaquirks.xbee.xbee_io.XBeeSensor'>
Fail because endpoint list mismatch: {232, 230} {1, 2, 3, 4, 6}
Considering <class 'zhaquirks.xiaomi.mija.smoke.MijiaHoneywellSmokeDetectorSensor'>
Fail because endpoint list mismatch: {1} {1, 2, 3, 4, 6}
device - 0x0830:00:12:4b:00:1d:38:d3:c6 entering async_device_initialized - is_new_join: True
device - 0x0830:00:12:4b:00:1d:38:d3:c6 has joined the ZHA zigbee network
[0x0830](ptvo.switch): started configuration
[0x0830:ZDO](ptvo.switch): 'async_configure' stage succeeded
[0x0830:1:0x0006]: bound 'on_off' cluster: Status.SUCCESS
[0x0830:1:0x0006]: finished channel configuration
[0x0830:1:0x0000]: bound 'basic' cluster: Status.SUCCESS
[0x0830:1:0x0000]: finished channel configuration
[0x0830:1:0x0006]: bound 'on_off' cluster: Status.SUCCESS
[0x0830:1:0x0006]: finished channel configuration
[0x0830:3:0x0006]: bound 'on_off' cluster: Status.SUCCESS
[0x0830:3:0x0006]: finished channel configuration
[0x0830:3:0x0006]: bound 'on_off' cluster: Status.SUCCESS
[0x0830:3:0x0006]: finished channel configuration
[0x0830:3:0x0006]: 'async_configure' stage succeeded
[0x0830:3:0x0006]: 'async_configure' stage succeeded
[0x0830:1:0x0000] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=True disable_default_response=True> manufacturer=None tsn=188 command_id=Command.Read_Attributes_rsp>
[0x0830:1:0x0000]: initializing channel: from_cache: False
[0x0830:1:0x0006]: 'async_configure' stage succeeded
[0x0830:1:0x0000]: 'async_configure' stage succeeded
[0x0830:1:0x0006]: 'async_configure' stage succeeded
[0x0830](ptvo.switch): completed configuration
[0x0830](ptvo.switch): stored in registry: ZhaDeviceEntry(name='ptvo.info ptvo.switch', ieee='00:12:4b:00:1d:38:d3:c6', last_seen=1594728066.486898)
[0x0830](ptvo.switch): started initialization
[0x0830:ZDO](ptvo.switch): 'async_initialize' stage succeeded
[0x0830:1:0x0006]: initializing channel: from_cache: False
[0x0830:1:0x0006] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=True disable_default_response=True> manufacturer=None tsn=192 command_id=Command.Read_Attributes_rsp>
[0x0830:1:0x0006]: initializing channel: from_cache: False
[0x0830:1:0x0000] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=True disable_default_response=True> manufacturer=None tsn=194 command_id=Command.Read_Attributes_rsp>
[0x0830:1:0x0000]: initializing channel: from_cache: False
[0x0830:3:0x0006]: initializing channel: from_cache: False
[0x0830:1:0x0006] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=True disable_default_response=True> manufacturer=None tsn=198 command_id=Command.Read_Attributes_rsp>
[0x0830:1:0x0006]: 'async_initialize' stage succeeded
[0x0830:1:0x0000]: 'async_initialize' stage succeeded
[0x0830:1:0x0006]: 'async_initialize' stage succeeded
[0x0830:3:0x0006]: initializing channel: from_cache: False
[0x0830:1:0x0006] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=False disable_default_response=False> manufacturer=None tsn=6 command_id=Command.Report_Attributes>
[0x0830:1:0x0006] ZCL request 0x000a: [[<Attribute attrid=0 value=<TypeValue type=Bool, value=Bool.false>>]]
[0x0830:1:0x0006] Attribute report received: on_off=0
[0x0830:3:0x0006] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=False disable_default_response=False> manufacturer=None tsn=7 command_id=Command.Report_Attributes>
[0x0830:3:0x0006] ZCL request 0x000a: [[<Attribute attrid=0 value=<TypeValue type=Bool, value=Bool.false>>]]
[0x0830:3:0x0006] Attribute report received: on_off=0
[0x0830:6:0x000c] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=False disable_default_response=False> manufacturer=None tsn=8 command_id=Command.Report_Attributes>
[0x0830:6:0x000c] ZCL request 0x000a: [[<Attribute attrid=85 value=<TypeValue type=float, value=29.65999984741211>>, <Attribute attrid=28 value=<TypeValue type=CharacterString, value=C,77>>]]
[0x0830:6:0x000c] Attribute report received: present_value=29.65999984741211, description=C,77
[0x0830:6:0x000c] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=False disable_default_response=False> manufacturer=None tsn=9 command_id=Command.Report_Attributes>
[0x0830:6:0x000c] ZCL request 0x000a: [[<Attribute attrid=85 value=<TypeValue type=float, value=99561.0>>, <Attribute attrid=28 value=<TypeValue type=CharacterString, value=Pa,77>>]]
[0x0830:6:0x000c] Attribute report received: present_value=99561.0, description=Pa,77
[0x0830:6:0x000c] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=False disable_default_response=False> manufacturer=None tsn=11 command_id=Command.Report_Attributes>
[0x0830:6:0x000c] ZCL request 0x000a: [[<Attribute attrid=85 value=<TypeValue type=float, value=54.10546875>>, <Attribute attrid=28 value=<TypeValue type=CharacterString, value=%,77>>]]
[0x0830:6:0x000c] Attribute report received: present_value=54.10546875, description=%,77
[0x0830:6:0x000c] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=False disable_default_response=False> manufacturer=None tsn=10 command_id=Command.Report_Attributes>
[0x0830:6:0x000c] ZCL request 0x000a: [[<Attribute attrid=85 value=<TypeValue type=float, value=147.90921020507812>>, <Attribute attrid=28 value=<TypeValue type=CharacterString, value=m,77>>]]
[0x0830:6:0x000c] Attribute report received: present_value=147.90921020507812, description=m,77
[0x0830:3:0x0006]: failed to get attributes '['on_off']' on 'on_off' cluster: 
[0x0830:3:0x0006]: 'async_initialize' stage succeeded
[0x0830:3:0x0006]: 'async_initialize' stage succeeded
[0x0830](ptvo.switch): power source: Mains
[0x0830](ptvo.switch): completed initialization
[0x0830:1:0x0006]: attempting to update onoff state - from cache: False
[0x0830:3:0x0006]: attempting to update onoff state - from cache: False
[0x0830:1:0x0006] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=True disable_default_response=True> manufacturer=None tsn=208 command_id=Command.Read_Attributes_rsp>
None: polling current state
None: polling current state
[0x0830:1:0x0006] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=False disable_default_response=False> manufacturer=None tsn=12 command_id=Command.Report_Attributes>
[0x0830:1:0x0006] ZCL request 0x000a: [[<Attribute attrid=0 value=<TypeValue type=Bool, value=Bool.false>>]]
[0x0830:1:0x0006] Attribute report received: on_off=0
[0x0830:6:0x000c] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=False disable_default_response=False> manufacturer=None tsn=14 command_id=Command.Report_Attributes>
[0x0830:6:0x000c] ZCL request 0x000a: [[<Attribute attrid=85 value=<TypeValue type=float, value=29.65999984741211>>, <Attribute attrid=28 value=<TypeValue type=CharacterString, value=C,77>>]]
[0x0830:6:0x000c] Attribute report received: present_value=29.65999984741211, description=C,77
[0x0830:3:0x0006] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=False disable_default_response=False> manufacturer=None tsn=13 command_id=Command.Report_Attributes>
[0x0830:3:0x0006] ZCL request 0x000a: [[<Attribute attrid=0 value=<TypeValue type=Bool, value=Bool.false>>]]
[0x0830:3:0x0006] Attribute report received: on_off=0
[0x0830:6:0x000c] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=False disable_default_response=False> manufacturer=None tsn=15 command_id=Command.Report_Attributes>
[0x0830:6:0x000c] ZCL request 0x000a: [[<Attribute attrid=85 value=<TypeValue type=float, value=99569.0>>, <Attribute attrid=28 value=<TypeValue type=CharacterString, value=Pa,77>>]]
[0x0830:6:0x000c] Attribute report received: present_value=99569.0, description=Pa,77
[0x0830:6:0x000c] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=False disable_default_response=False> manufacturer=None tsn=17 command_id=Command.Report_Attributes>
[0x0830:6:0x000c] ZCL request 0x000a: [[<Attribute attrid=85 value=<TypeValue type=float, value=54.423828125>>, <Attribute attrid=28 value=<TypeValue type=CharacterString, value=%,77>>]]
[0x0830:6:0x000c] Attribute report received: present_value=54.423828125, description=%,77
[0x0830:6:0x000c] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=False disable_default_response=False> manufacturer=None tsn=16 command_id=Command.Report_Attributes>
[0x0830:6:0x000c] ZCL request 0x000a: [[<Attribute attrid=85 value=<TypeValue type=float, value=147.2327880859375>>, <Attribute attrid=28 value=<TypeValue type=CharacterString, value=m,77>>]]
[0x0830:6:0x000c] Attribute report received: present_value=147.2327880859375, 
probot-home-assistant[bot] commented 4 years ago

Hey there @dmulcahey, @adminiuga, mind taking a look at this issue as its been labeled with an integration (zha) you are listed as a codeowner for? Thanks! (message by CodeOwnersMention)

Adminiuga commented 4 years ago

It uses non standard clusters to send information about temp, pressure, humidity. This would require a quirk. Open an issue in zigpy/zha-device-handlers repository

MaximumSU commented 4 years ago

@pruwait read this topic #36696 This is what i discussed already but no luck. You may continue ;-)

Adminiuga commented 4 years ago

has nothing to do #36696 Feel free to read ZCL specs.

MaximumSU commented 4 years ago

@Adminiuga

Feel free to read ZCL specs.

Ok, in log we see:

[0x0830:6:0x000c] ZCL request 0x000a: [[<Attribute attrid=85 value=<TypeValue type=float, value=29.65999984741211>>, <Attribute attrid=28 value=<TypeValue type=CharacterString, value=C,77>>]]
[0x0830:6:0x000c] Attribute report received: present_value=29.65999984741211, description=C,77

In zigbeealliance.org zigbee-cluster-library-specification:

3.14.2 Analog Input (Basic) Identifier | Name 0x000c | Analog Input

36696 exactly about AnalogInput sensor dropping. Where i am wrong?

Adminiuga commented 4 years ago

Because there are standards. In ZCL for temperature there's temperature cluster. For pressure, there's pressure cluster. I'm not going to chase every manufacturer who re-invents the wheel and decide to do things their own way.

Second, analog cluster was representing a single entity in HA. What was that entity supposed to represent? temperature, pressure or humidity? Cause there're all three on reported by the same attribute

[0x0830:6:0x000c] Attribute report received: present_value=29.65999984741211, description=C,77
[0x0830:6:0x000c] Attribute report received: present_value=99569.0, description=Pa,77
[0x0830:6:0x000c] Attribute report received: present_value=54.423828125, description=%,77

But hey, it's open source, so your contribution is welcome.

MaximumSU commented 4 years ago

@Adminiuga

Second, analog cluster was representing a single entity in HA. What was that entity supposed to represent? temperature, pressure or humidity? Cause there're all three on reported by the same attribute

I agree with you, that is not correct usage. But:

Because there are standards. In ZCL for temperature there's temperature cluster. For pressure, there's pressure cluster.

And the AnalogInput cluster - it is also the ZCL standart for some analog readings. It may be any value. There is "description" to understand, what is it. Why you mix the incorrect usage of cluster with this cluster itself? If some crazy manufacturer will use temperature cluster for, in example, cloud cover of the sky, you will remove the temperature cluster?

dmulcahey commented 4 years ago

Dude you’re hijacking another issue and you skipped over the most important point here. This device is reporting all 3 on the same cluster on the same attribute. This would NOT have worked regardless. Give it a rest.

dmulcahey commented 4 years ago

Moved this here: https://github.com/zigpy/zha-device-handlers/issues/416