ozczecho / wyze-mqtt

A simple wrapper for Kevin Vincent `ha-wyzesense`.
16 stars 4 forks source link

No MQTT topic published #1

Closed jasonogren closed 4 years ago

jasonogren commented 4 years ago

First, thanks for wyze-mqtt

I do not see any MQTT traffic

I'm running an Ubuntu 18.04 VM on Windows 7 Device is recognized as hidraw1 I have a functioning local MQTT broker (working with other topics and messages)

Edit: The adapter light is solid blue when VM loads.

Status shows:

wyze-mqtt.service - Wyzesense via Mqtt Loaded: loaded (/etc/systemd/system/wyze-mqtt.service; enabled; vendor preset: enabled) Active: active (running) since Wed 2019-12-04 19:52:42 MST; 2s ago Docs: https://www.github.com/ozczecho Main PID: 11892 (service.sh) Tasks: 3 (limit: 4915) CGroup: /system.slice/wyze-mqtt.service ├─11892 /bin/sh /home/w/wyze-mqtt/service.sh └─11895 python3 ./wyze-mqtt.py

netstat shows broker connected:

w@w-Ubuntu:~/wyze-mqtt$ sudo netstat -a | grep 1883 tcp 0 0 0.0.0.0:1883 0.0.0.0: LISTEN
tcp 0 0 w-Ubuntu.loca:43109 192.168.1.x:1883 ESTABLISHED tcp6 0 0 [::]:1883 [::]:
LISTEN

When attempting to pair sensors I do not get any MQTT traffic or any traffic at any time.

Thanks

ozczecho commented 4 years ago

HI @jasonogren - sorry for the very late reply. I totally missed this ticket.

I have just pushed a couple of changes. One change is better logging. The debug messages now get logged to wyze_impl.log If you are still having the issue do you mind posting the log?

jasonogren commented 4 years ago

No problem. Thanks for the reply and the logging!

I am still having the issue. Here are the log contents at startup:

2020-01-20 21:25:39|7435|INFO|started 2020-01-20 21:25:39|7435|DEBUG|In beginConn 2020-01-20 21:25:39|7435|DEBUG|Start Inquiry... 2020-01-20 21:25:39|7435|DEBUG|===> Sending: Packet: Cmd=4327, Payload= 2020-01-20 21:25:39|7435|DEBUG|Sending: b'aa55430327016c' 2020-01-20 21:25:39|7435|DEBUG|Trying to parse: b'55aa43042801016f' 2020-01-20 21:25:39|7435|DEBUG|Received: b'55aa43042801016f' 2020-01-20 21:25:39|7435|DEBUG|<=== Received: Packet: Cmd=4328, Payload=b'01' 2020-01-20 21:25:39|7435|DEBUG|Inquiry returns 1 2020-01-20 21:25:39|7435|DEBUG|===> Sending: Packet: Cmd=5314, Payload=b'ff' 2020-01-20 21:25:39|7435|DEBUG|Sending: b'aa55530414ff0269' 2020-01-20 21:25:39|7435|DEBUG|Trying to parse: b'55aa5314ff026555aa530e350000016fc6590f6f0314ff04b855aa530315016a' 2020-01-20 21:25:39|7435|DEBUG|Received: b'55aa5314ff0265' 2020-01-20 21:25:39|7435|DEBUG|<=== Received: Packet: Cmd=53FF, Payload=ACK(5314) 2020-01-20 21:25:39|7435|DEBUG|Trying to parse: b'55aa530e350000016fc6590f6f0314ff04b855aa530315016a55aa530315016a' 2020-01-20 21:25:39|7435|DEBUG|Received: b'55aa530e350000016fc6590f6f0314ff04b8' 2020-01-20 21:25:39|7435|DEBUG|<=== Received: Packet: Cmd=5335, Payload=b'0000016fc6590f6f0314ff' 2020-01-20 21:25:39|7435|DEBUG|===> Sending: Packet: Cmd=53FF, Payload=ACK(5335) 2020-01-20 21:25:39|7435|DEBUG|Sending: b'aa555335ff0286' 2020-01-20 21:25:39|7435|INFO|LOG: time=2020-01-20T21:25:23.055000, data=b'14ff' 2020-01-20 21:25:39|7435|DEBUG|Trying to parse: b'55aa530315016a55aa530315016a' 2020-01-20 21:25:39|7435|DEBUG|Received: b'55aa530315016a' 2020-01-20 21:25:39|7435|DEBUG|<=== Received: Packet: Cmd=5315, Payload= 2020-01-20 21:25:39|7435|DEBUG|===> Sending: Packet: Cmd=53FF, Payload=ACK(5315) 2020-01-20 21:25:39|7435|DEBUG|Sending: b'aa555315ff0266' 2020-01-20 21:25:39|7435|DEBUG|Trying to parse: b'55aa530315016a' 2020-01-20 21:25:39|7435|DEBUG|Received: b'55aa530315016a' 2020-01-20 21:25:39|7435|DEBUG|<=== Received: Packet: Cmd=5315, Payload= 2020-01-20 21:25:39|7435|DEBUG|===> Sending: Packet: Cmd=53FF, Payload=ACK(5315) 2020-01-20 21:25:39|7435|DEBUG|Sending: b'aa555315ff0266' 2020-01-20 21:25:39|7435|DEBUG|Loop Forever 2020-01-20 21:25:39|7435|DEBUG|Connected with result code 0 2020-01-20 21:25:39|7435|DEBUG|Handlers Added 2020-01-20 21:25:39|7435|DEBUG|Trying to parse: b'55aa530332018755aa5303320187' 2020-01-20 21:25:39|7435|DEBUG|Received: b'55aa5303320187' 2020-01-20 21:25:39|7435|DEBUG|<=== Received: Packet: Cmd=5332, Payload= 2020-01-20 21:25:39|7435|DEBUG|===> Sending: Packet: Cmd=53FF, Payload=ACK(5332) 2020-01-20 21:25:39|7435|DEBUG|Sending: b'aa555332ff0283' 2020-01-20 21:25:39|7435|DEBUG|===> Sending: Packet: Cmd=5333, Payload=b'0000016fc6595144' 2020-01-20 21:25:39|7435|DEBUG|Sending: b'aa55530b330000016fc659514403b4' 2020-01-20 21:25:39|7435|DEBUG|Trying to parse: b'55aa5303320187' 2020-01-20 21:25:39|7435|DEBUG|Received: b'55aa5303320187' 2020-01-20 21:25:39|7435|DEBUG|<=== Received: Packet: Cmd=5332, Payload= 2020-01-20 21:25:39|7435|DEBUG|===> Sending: Packet: Cmd=53FF, Payload=ACK(5332) 2020-01-20 21:25:39|7435|DEBUG|Sending: b'aa555332ff0283' 2020-01-20 21:25:39|7435|DEBUG|===> Sending: Packet: Cmd=5333, Payload=b'0000016fc6595149' 2020-01-20 21:25:39|7435|DEBUG|Sending: b'aa55530b330000016fc659514903b9' 2020-01-20 21:25:40|7435|DEBUG|Trying to parse: b'55aa5333ff028455aa5333ff0284' 2020-01-20 21:25:40|7435|DEBUG|Received: b'55aa5333ff0284' 2020-01-20 21:25:40|7435|DEBUG|<=== Received: Packet: Cmd=53FF, Payload=ACK(5333) 2020-01-20 21:25:40|7435|DEBUG|Trying to parse: b'55aa5333ff0284' 2020-01-20 21:25:40|7435|DEBUG|Received: b'55aa5333ff0284' 2020-01-20 21:25:40|7435|DEBUG|<=== Received: Packet: Cmd=53FF, Payload=ACK(5333)

ozczecho commented 4 years ago

Adding a new sensor requires Home Assistant (or any Mqtt publisher) to publish a message (topic is defined in the config.json file under subscribeScanTopic

{
  "topic": "ubuntu/wyze/scan"
}

Then hold the pin in the reset button until you see a red light flash.

jasonogren commented 4 years ago

Thanks for your help. My error was mismatched topic sent from HA to initiate the scan. (Ugh must have checked a dozen times and missed it.) I can’t tell you how much I appreciate the work you did on this. I have added the sensors. One, door sensor is “stuck” “open” and I see that you have a “todo” to remove sensors. If they can’t be removed individually is there a way to reset the whole hub? I’ve only added 3 sensors and wouldn’t mind starting over. Thanks again.

ozczecho commented 4 years ago

@jasonogren - Glad you got it working. I am getting more sensors (any day now) so I plan to do more testing as well as finish off the removal. I had a quick look if there is a way to reset the hub: https://forums.wyzecam.com/t/new-sense-kit-will-not-connect/28130/16 - but I have not tried this.

jasonogren commented 4 years ago

https://forums.wyzecam.com/t/new-sense-kit-will-not-connect/28130/16

This method did allow the sensors to be rediscovered and re-added.

Thanks.