Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when publishing #17

Closed
mikekap opened this issue Dec 12, 2020 · 7 comments · Fixed by #20
Closed

Error when publishing #17

mikekap opened this issue Dec 12, 2020 · 7 comments · Fixed by #20
Labels
bug Something isn't working

Comments

@mikekap
Copy link
Owner

mikekap commented Dec 12, 2020

I'm getting a different error but potentially related. I had a new, unopened, hub I pulled out yesterday and rooted before ever connecting it to the internet. I think I got it updated to the most current release. I setup homeassistant for the first time today and while I'm able to control the device using aprontest I can't seem to control it through MQTT. Attempting to publish a packet to topic 'home/wink/1/set' with payload '{"On_Off": 0}' I'm getting the failure below

Dec 12 02:17:49.453 WARN async_failure, error: SimpleError { err: "Bad attribute type: STRING" }, type: poll_device
Dec 12 02:17:59.380 WARN async_failure, error: SimpleError { err: "Bad attribute type: STRING" }, type: poll_device
Dec 12 02:18:09.540 WARN async_failure, error: SimpleError { err: "Bad attribute type: STRING" }, type: poll_device

[root@flex-dvt ~]# aprontest -u -m 1 -t 1 -v OFF
Update device with master ID 1, setting value OFF for attribute 1
Waiting for 1 callbacks...
Received a myNodeDataCallback from Zigbee
                Source: aprontest
                Event:  RADIO_EVT_NODE_UPDATE
                Status: FLX_OK
                Node:   1
[root@flex-dvt ~]# aprontest -u -m 1 -t 1 -v ON
Update device with master ID 1, setting value ON for attribute 1
Waiting for 1 callbacks...
Received a myNodeDataCallback from Zigbee
                Source: aprontest
                Event:  RADIO_EVT_NODE_UPDATE
                Status: FLX_OK
                Node:   1

[root@flex-dvt ~]# aprontest -l
Found 1 devices in database...
MASTERID |     INTERCONNECT |                         USERNAME
       1 |           ZIGBEE |            New HA Dimmable Light

Found 0 master groups in database...
GROUP ID |             NAME |            RADIO |

Found 0 control groups in database...
GROUP ID |             NAME |            RADIO |

[root@flex-dvt ~]# aprontest -l -m 1
Gang ID: 0x7ce8f9f9
Manufacturer ID: 0x10dc, Product Number: 0xdfbf
Device is ONLINE, 0 failed tx attempts, 4 seconds since last msg rx'ed, polling period 0 seconds
Device has 14 attributes...
New HA Dimmable Light
   ATTRIBUTE |                         DESCRIPTION |   TYPE | MODE |                              GET |                              SET
           1 |                              On_Off | STRING |  R/W |                              OFF |                              OFF
           2 |                               Level |  UINT8 |  R/W |                              254 |
           4 |                         NameSupport |  UINT8 |    R |                                0 |
       61440 |                          ZCLVersion |  UINT8 |    R |                                1 |
       61441 |                  ApplicationVersion |  UINT8 |    R |                                2 |
       61442 |                        StackVersion |  UINT8 |    R |                                2 |
       61443 |                           HWVersion |  UINT8 |    R |                                1 |
       61444 |                    ManufacturerName | STRING |    R |                               GE |
       61445 |                     ModelIdentifier | STRING |    R |                        SoftWhite |
       61446 |                            DateCode | STRING |    R |                         20150515 |
       61447 |                         PowerSource |  UINT8 |    R |                                1 |
      258048 |                        IdentifyTime | UINT16 |  R/W |                                0 |
     1699842 |               ZB_CurrentFileVersion | UINT32 |    R |                         33554952 |
  4294901760 |                   WK_TransitionTime | UINT16 |  R/W |                                  |

EDIT:
version information
[root@flex-dvt ~]# grep 0 /database/cf*
/database/cf_build:00.01
/database/cf_fver2:00.01
/database/cf_fver3:04.01

Originally posted by @BobRyan530 in #16 (comment)

@mikekap
Copy link
Owner Author

mikekap commented Dec 12, 2020

Hey @BobRyan530 - I opened this issue for your problem. I think it's unrelated to bad aprontest output.

I think I just don't support TYPE STRING for the On_Off attribute. This will be fixed in the next release!

@mikekap mikekap added the bug Something isn't working label Dec 12, 2020
@BobRyan530
Copy link

Thanks for the quick response Mike. I think UINT16 and UINT32 types might need to be added as well.

@mikekap
Copy link
Owner Author

mikekap commented Dec 12, 2020

Good call. I'll include those as well.

@BobRyan530
Copy link

Compiled, scp to winkhub, and restarted program. Looking good so far!

Dec 13 01:51:29.425 WARN async_failure, error: SimpleError { err: "Bad attribute type: STRING" }, type: poll_device
Dec 13 01:51:43.604 INFO init_logger, min_log_level: Info
Dec 13 01:51:43.605 INFO starting, version: 0.1.4-prerelease
Dec 13 01:51:43.617 INFO opening_client, client_id: wink-mqtt-rs, port: 1883, host: server.drinksbeer.org
Dec 13 01:51:43.625 INFO poller_starting, resync_interval: 10000
Dec 13 01:51:44.854 INFO discovered_device, name: New HA Dimmable Light, id: 1

@BobRyan530
Copy link

I think this needs to accept string values (ridiculous, right?) also. I tried sending {"On_Off": "ON"}, "On", "on", 1, 0. Manually turning the bulb on and setting the level does control the light so it's mostly functional now.

[root@flex-dvt ~]# aprontest -u -m 1 -t 1 -v ON
Update device with master ID 1, setting value ON for attribute 1
Waiting for 1 callbacks...
Received a myNodeDataCallback from Zigbee
                Source: aprontest
                Event:  RADIO_EVT_NODE_UPDATE
                Status: FLX_OK
                Node:   1
[root@flex-dvt ~]# aprontest -l -m 1
Gang ID: 0x7ce8f9f9
Manufacturer ID: 0x10dc, Product Number: 0xdfbf
Device is ONLINE, 0 failed tx attempts, 53 seconds since last msg rx'ed, polling period 0 seconds
Device has 14 attributes...
New HA Dimmable Light
   ATTRIBUTE |                         DESCRIPTION |   TYPE | MODE |                              GET |                              SET
           1 |                              On_Off | STRING |  R/W |                                1 |                               ON
           2 |                               Level |  UINT8 |  R/W |                              254 |
           4 |                         NameSupport |  UINT8 |    R |                                0 |
       61440 |                          ZCLVersion |  UINT8 |    R |                                1 |
       61441 |                  ApplicationVersion |  UINT8 |    R |                                2 |
       61442 |                        StackVersion |  UINT8 |    R |                                2 |
       61443 |                           HWVersion |  UINT8 |    R |                                1 |
       61444 |                    ManufacturerName | STRING |    R |                               GE |
       61445 |                     ModelIdentifier | STRING |    R |                        SoftWhite |
       61446 |                            DateCode | STRING |    R |                         20150515 |
       61447 |                         PowerSource |  UINT8 |    R |                                1 |
      258048 |                        IdentifyTime | UINT16 |  R/W |                                0 |
     1699842 |               ZB_CurrentFileVersion | UINT32 |    R |                         33554952 |
  4294901760 |                   WK_TransitionTime | UINT16 |  R/W |                                  |

[root@flex-dvt ~]# tail -F /var/log/wink-mqtt-rs.log
Dec 13 01:51:43.617 INFO opening_client, client_id: wink-mqtt-rs, port: 1883, host: server.drinksbeer.org
Dec 13 01:51:43.625 INFO poller_starting, resync_interval: 10000
Dec 13 01:51:44.854 INFO discovered_device, name: New HA Dimmable Light, id: 1
Dec 13 01:54:12.812 INFO set, value: UInt8(1), attribute: On_Off, device: New HA Dimmable Light, device_id: 1
Dec 13 02:00:46.660 ERRO bad_setting_for_attribute, error: unknown value for type String: "ON", value: "ON", attribute: On_Off
Dec 13 02:01:07.727 ERRO bad_setting_for_attribute, error: unknown value for type String: "On", value: "On", attribute: On_Off
Dec 13 02:01:12.739 ERRO bad_setting_for_attribute, error: unknown value for type String: "on", value: "on", attribute: On_Off
Dec 13 02:01:20.153 INFO set, value: UInt8(1), attribute: On_Off, device: New HA Dimmable Light, device_id: 1
Dec 13 02:02:48.585 INFO set, value: UInt8(1), attribute: Level, device: New HA Dimmable Light, device_id: 1
Dec 13 02:02:59.363 INFO set, value: UInt8(0), attribute: Level, device: New HA Dimmable Light, device_id: 1

@mikekap
Copy link
Owner Author

mikekap commented Dec 13, 2020

This should be fixed in 0.1.4 - just re-run the installation command and let me know if you find any more issues!

@BobRyan530
Copy link

This is working now. Thanks Mike!

Dec 13 14:06:11.393 INFO set, value: String("ON"), attribute: On_Off, device: New HA Dimmable Light, device_id: 1
Dec 13 14:06:16.325 INFO set, value: String("OFF"), attribute: On_Off, device: New HA Dimmable Light, device_id: 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants