mikelawrence / senseme-hacs

Haiku with SenseME fan integration for Home Assistant
MIT License
21 stars 14 forks source link

Wireless Wall Control Unstable with new integration #4

Closed andrewpc closed 3 years ago

andrewpc commented 4 years ago

I have an L series fan with the independent wireless wall control. Both are on the same wireless network.

This integration finds both devices however it causes the wireless wall control to become unstable, it drops off the network and then lights on the device flash constantly in some kind of error state. Hard resetting the device gives a short break before the errors occur again. Removing the integration has resolved the issue and its been connected for the last 10 hours. Before that, it would last ~10 minutes and be very intermittent

In the old pre aiosenseme integration I used to disable the Wall control using config.yaml. The new integration does not seem to allow me to tell home assistant or the underlying library not to query this device.

If its possible to still get access to the occupancy sensor (which the L doesnt have built in - it comes from the wall controller) that would be great but if not, then disabling it would be a backup solution.

andrewpc commented 4 years ago

Also meant to say thank you for this new work. Overall stability and response with the fan direct has been excellent and looking forward to resolving this issue with the controller. Let me know how I can help.

mikelawrence commented 4 years ago

Do you see a warning in your log about unknown SenseME model? Are there any other warnings?

I had no idea that the wall controller (I have none) showed up like a fan. Hopefully I can just ignore a model number.

andrewpc commented 4 years ago

Received 'Master Bedroom Wall;DEVICE;ID;20:F8:5E:14:DC:8B;SWITCH,SENSEME' from 192.168.1.97 on 192.168.1.6

andrewpc commented 4 years ago
2020-04-21 09:24:02 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Connecting
2020-04-21 09:24:02 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Fan: Param updated: [SCHEDULE;EVENT;INDEX;0;SUN+MON+TUE+WED+THU+FRI+SAT;22:00]='FAN,SPD,1'
2020-04-21 09:24:02 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Connected
2020-04-21 09:24:02 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Status update
2020-04-21 09:24:02 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Fan: Param updated: [SCHEDULE;EVENT;INDEX;1;SUN+MON+TUE+WED+THU+FRI+SAT;8:01]='FAN,PWR,OFF'
2020-04-21 09:24:02 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Param updated: [DEVICE;INDICATORS]='ON'
2020-04-21 09:24:02 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Param updated: [SNSROCC;STATUS]='UNOCCUPIED'
2020-04-21 09:24:02 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Param updated: [DEVICE;SERVER]='PRODUCTION'
2020-04-21 09:24:02 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Param updated: [ERRORLOG;ENTRIES;NUM]='10'
2020-04-21 09:24:02 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Param updated: [ERRORLOG;ENTRIES;MAX]='10'
2020-04-21 09:24:02 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Param updated: [FW;NAME]='FW000004'
2020-04-21 09:24:02 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Param updated: [FW;FW000004]='2.5.0'
2020-04-21 09:24:02 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Param updated: [GROUP;LIST]='EMPTY'
2020-04-21 09:24:02 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Param updated: [GROUP;ROOM;TYPE]='2'
2020-04-21 09:24:02 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Param updated: [NAME;VALUE]='Master Bedroom Wall'
2020-04-21 09:24:03 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Param updated: [NW;AP;STATUS]='OFF'
2020-04-21 09:24:03 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Param updated: [NW;DHCP]='OFF'
2020-04-21 09:24:03 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Param updated: [NW;PARAMS;ACTUAL]='192.168.1.97;255.255.255.0;192.168.1.1'
2020-04-21 09:24:03 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Param updated: [NW;SSID]='Gladiator'
2020-04-21 09:24:03 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Param updated: [NW;TOKEN]='17cf41cc-a843-4225-91f2-b6d277ffbf61'
2020-04-21 09:24:03 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Param updated: [WALLCONTROL;CONFIGURE;FANSPEED]='LIGHTLEVEL'
andrewpc commented 4 years ago

Hopefully the above helps. Ignoring it will help, but the occupancy comes from it for this fan which doesnt have the built in occupancy sensor, so it we could resolve the issue, that would be great to keep it.

andrewpc commented 4 years ago

Here is just a little more logging that shows an error

2020-04-21 09:29:09 DEBUG (MainThread) [aiosenseme.discovery] Received 'Master Bedroom Fan;DEVICE;ID;20:F8:5E:19:FB:C9;FAN,LSERIES' from 192.168.1.98 on 192.168.1.6
2020-04-21 09:29:09 DEBUG (MainThread) [aiosenseme.discovery] Received 'Master Bedroom Wall;DEVICE;ID;20:F8:5E:14:DC:8B;SWITCH,SENSEME' from 192.168.1.97 on 192.168.1.6
2020-04-21 09:29:09 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Connecting
2020-04-21 09:29:09 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Connected
2020-04-21 09:29:09 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Status update
2020-04-21 09:29:09 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Param updated: [DEVICE;INDICATORS]='ON'
2020-04-21 09:29:09 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Param updated: [SNSROCC;STATUS]='UNOCCUPIED'
2020-04-21 09:29:10 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Param updated: [DEVICE;SERVER]='PRODUCTION'
2020-04-21 09:29:10 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Param updated: [ERRORLOG;ENTRIES;NUM]='10'
2020-04-21 09:29:10 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Param updated: [ERRORLOG;ENTRIES;MAX]='10'
2020-04-21 09:29:10 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Param updated: [FW;NAME]='FW000004'
2020-04-21 09:29:10 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Param updated: [FW;FW000004]='2.5.0'
2020-04-21 09:29:10 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Param updated: [GROUP;LIST]='EMPTY'
2020-04-21 09:29:10 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Param updated: [GROUP;ROOM;TYPE]='2'
2020-04-21 09:29:10 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Param updated: [NAME;VALUE]='Master Bedroom Wall'
2020-04-21 09:29:10 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Param updated: [NW;AP;STATUS]='OFF'
2020-04-21 09:29:10 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Param updated: [NW;DHCP]='OFF'
2020-04-21 09:29:10 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Param updated: [NW;PARAMS;ACTUAL]='192.168.1.97;255.255.255.0;192.168.1.1'
2020-04-21 09:29:10 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Param updated: [NW;SSID]='Gladiator'
2020-04-21 09:29:10 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Param updated: [NW;TOKEN]='17cf41cc-a843-4225-91f2-b6d277ffbf61'
2020-04-21 09:29:10 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Param updated: [WALLCONTROL;CONFIGURE;FANSPEED]='LIGHTLEVEL'
2020-04-21 09:29:14 DEBUG (MainThread) [aiosenseme.discovery] Failed to start Master Bedroom Wall
2020-04-21 09:29:15 DEBUG (MainThread) [aiosenseme.discovery] Discovered 2 existing fans
2020-04-21 09:29:15 DEBUG (MainThread) [aiosenseme.discovery] Listener closed on 192.168.1.6
2020-04-21 09:29:15 DEBUG (MainThread) [aiosenseme.discovery] Listener closed on 172.17.0.1
2020-04-21 09:29:15 DEBUG (MainThread) [aiosenseme.discovery] Listener closed on 172.30.32.1
2020-04-21 09:29:46 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Fan: Status update
2020-04-21 09:29:46 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Fan: Param updated: [SLEEP;EVENT]='OFF'
2020-04-21 09:29:46 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Fan: Param updated: [SLEEP;EVENT]='ON'
2020-04-21 09:29:48 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Status update
2020-04-21 09:29:57 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Status update
andrewpc commented 4 years ago

Just one further log. I went and walked in front of the device - and this was the output regarding 'Occupied' status. Thanks

2020-04-21 09:43:38 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Status update
2020-04-21 09:43:38 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Status update
2020-04-21 09:43:54 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Status update
2020-04-21 09:43:54 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Param updated: [SNSROCC;STATUS]='OCCUPIED'
2020-04-21 09:44:07 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Fan: Status update
2020-04-21 09:44:07 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Fan: Param updated: [SLEEP;EVENT]='OFF'
2020-04-21 09:44:07 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Fan: Param updated: [SLEEP;EVENT]='ON'
2020-04-21 09:44:10 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Status update
2020-04-21 09:44:10 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Param updated: [SNSROCC;STATUS]='OCCUPIED'
2020-04-21 09:44:14 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Status update
2020-04-21 09:44:14 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Param updated: [SNSROCC;STATUS]='OCCUPIED'
2020-04-21 09:44:26 DEBUG (MainThread) [aiosenseme.discovery] Listening on 192.168.1.6
2020-04-21 09:44:26 DEBUG (MainThread) [aiosenseme.discovery] Discovery broadcast on 192.168.1.6
2020-04-21 09:44:26 DEBUG (MainThread) [aiosenseme.discovery] Listening on 172.17.0.1
2020-04-21 09:44:26 DEBUG (MainThread) [aiosenseme.discovery] Discovery broadcast on 172.17.0.1
2020-04-21 09:44:26 DEBUG (MainThread) [aiosenseme.discovery] Listening on 172.30.32.1
2020-04-21 09:44:26 DEBUG (MainThread) [aiosenseme.discovery] Discovery broadcast on 172.30.32.1
2020-04-21 09:44:26 DEBUG (MainThread) [aiosenseme.discovery] Received 'Master Bedroom Fan;DEVICE;ID;20:F8:5E:19:FB:C9;FAN,LSERIES' from 192.168.1.98 on 192.168.1.6
2020-04-21 09:44:26 DEBUG (MainThread) [aiosenseme.discovery] Received 'Master Bedroom Wall;DEVICE;ID;20:F8:5E:14:DC:8B;SWITCH,SENSEME' from 192.168.1.97 on 192.168.1.6
2020-04-21 09:44:26 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Connecting
2020-04-21 09:44:26 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Connected
2020-04-21 09:44:26 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Status update
2020-04-21 09:44:26 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Param updated: [DEVICE;INDICATORS]='ON'
2020-04-21 09:44:26 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Param updated: [SNSROCC;STATUS]='OCCUPIED'
2020-04-21 09:44:26 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Param updated: [DEVICE;SERVER]='PRODUCTION'
2020-04-21 09:44:26 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Param updated: [ERRORLOG;ENTRIES;NUM]='10'
2020-04-21 09:44:26 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Param updated: [ERRORLOG;ENTRIES;MAX]='10'
2020-04-21 09:44:27 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Param updated: [FW;NAME]='FW000004'
2020-04-21 09:44:27 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Param updated: [FW;FW000004]='2.5.0'
2020-04-21 09:44:27 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Param updated: [GROUP;LIST]='EMPTY'
2020-04-21 09:44:27 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Param updated: [GROUP;ROOM;TYPE]='2'
2020-04-21 09:44:27 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Param updated: [NAME;VALUE]='Master Bedroom Wall'
2020-04-21 09:44:27 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Param updated: [NW;AP;STATUS]='OFF'
2020-04-21 09:44:27 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Param updated: [NW;DHCP]='OFF'
2020-04-21 09:44:27 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Param updated: [NW;PARAMS;ACTUAL]='192.168.1.97;255.255.255.0;192.168.1.1'
2020-04-21 09:44:27 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Param updated: [NW;SSID]='Gladiator'
2020-04-21 09:44:27 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Param updated: [NW;TOKEN]='17cf41cc-a843-4225-91f2-b6d277ffbf61'
2020-04-21 09:44:27 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Param updated: [WALLCONTROL;CONFIGURE;FANSPEED]='LIGHTLEVEL'
2020-04-21 09:44:31 DEBUG (MainThread) [aiosenseme.discovery] Failed to start Master Bedroom Wall
2020-04-21 09:44:32 DEBUG (MainThread) [aiosenseme.discovery] Discovered 2 existing fans
2020-04-21 09:44:32 DEBUG (MainThread) [aiosenseme.discovery] Listener closed on 192.168.1.6
2020-04-21 09:44:32 DEBUG (MainThread) [aiosenseme.discovery] Listener closed on 172.17.0.1
2020-04-21 09:44:32 DEBUG (MainThread) [aiosenseme.discovery] Listener closed on 172.30.32.1
2020-04-21 09:44:35 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Status update
2020-04-21 09:44:35 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Param updated: [SNSROCC;STATUS]='OCCUPIED'
2020-04-21 09:44:40 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Status update
2020-04-21 09:44:40 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Param updated: [SNSROCC;STATUS]='OCCUPIED'
2020-04-21 09:44:56 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Status update
mikelawrence commented 4 years ago

So first of all I'm adding an occupancy sensor for the L-Series fan when it doesn't exist. So that is pretty easy to fix.

What I am confused about is how to handle the occupancy sensor in the wall switch. Especially since my library connecting to it seems to cause it to go unstable. Are you are willing to help debug remotely? If so...

You said it doesn't take long for the Wall Controller to go wonky. How long? I'm assuming you have access to the Home Assistant config directory. So could you edit the const.py file in config/custom_components/senseme directory and change

UPDATE_RATE = 1 to UPDATE_RATE = 120

Doing this will slow the frequency of updates to all SenseME devices (it will not change push changes). I'm hoping it will change how long it takes to make the wall controller go stupid.

andrewpc commented 4 years ago

Thanks Mike. Yes I can help. I will re-enable now without changing anything and wait till it fails and see if there is any additional logging (and how long this takes). Afterwards I will make the change above.

mikelawrence commented 4 years ago

The additional logging will help.

andrewpc commented 4 years ago

Just watching the log here Mike and having a quick look at the code and it seems to be increasing the amount of status requests hitting this device, sometimes in the same second but otherwise very close. Is this expected? Is there some issue here where if the init fails, it continues to creates a new task and/or doesnt close an old one? I dont see this logging on the fan itself.

2020-04-21 11:28:11 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Status update
2020-04-21 11:28:13 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Status update
2020-04-21 11:28:19 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Status update
2020-04-21 11:28:30 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Status update
2020-04-21 11:28:31 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Status update
2020-04-21 11:29:00 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Fan: Status update
2020-04-21 11:29:00 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Fan: Param updated: [SLEEP;EVENT]='OFF'
2020-04-21 11:29:00 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Fan: Param updated: [SLEEP;EVENT]='ON'
2020-04-21 11:29:01 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Status update
2020-04-21 11:29:03 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Status update
2020-04-21 11:29:04 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Status update
2020-04-21 11:29:05 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Status update
2020-04-21 11:29:17 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Status update
2020-04-21 11:29:17 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Status update
2020-04-21 11:29:36 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Status update
2020-04-21 11:29:38 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Status update
2020-04-21 11:29:54 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Status update
2020-04-21 11:29:58 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Status update
2020-04-21 11:30:01 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Fan: Status update
2020-04-21 11:30:01 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Fan: Param updated: [SLEEP;EVENT]='OFF'
2020-04-21 11:30:01 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Fan: Param updated: [SLEEP;EVENT]='ON'
2020-04-21 11:30:04 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Status update
2020-04-21 11:30:09 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Status update
2020-04-21 11:30:13 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Status update
2020-04-21 11:30:22 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Status update
2020-04-21 11:30:28 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Status update
2020-04-21 11:30:37 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Status update
2020-04-21 11:30:51 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Status update
2020-04-21 11:30:57 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Status update
2020-04-21 11:30:57 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Status update
andrewpc commented 4 years ago

Ok it just failed. It took 37 minutes

2020-04-21 11:33:11 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Connecting
2020-04-21 11:33:11 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Connected
2020-04-21 11:33:11 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Status update
2020-04-21 11:33:11 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Connection lost
2020-04-21 11:33:11 WARNING (MainThread) [aiosenseme.fan] Master Bedroom Wall: Connection lost
2020-04-21 11:33:11 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Updater task cancelled
2020-04-21 11:33:12 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Connecting
2020-04-21 11:33:12 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Connected
2020-04-21 11:33:12 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Status update
2020-04-21 11:33:12 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Connection lost
2020-04-21 11:33:12 WARNING (MainThread) [aiosenseme.fan] Master Bedroom Wall: Connection lost
2020-04-21 11:33:12 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Updater task cancelled
2020-04-21 11:33:13 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Connecting
2020-04-21 11:33:13 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Connected
2020-04-21 11:33:13 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Status update
2020-04-21 11:33:13 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Connection lost
2020-04-21 11:33:13 WARNING (MainThread) [aiosenseme.fan] Master Bedroom Wall: Connection lost
2020-04-21 11:33:13 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Updater task cancelled
2020-04-21 11:33:14 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Status update
2020-04-21 11:33:14 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Connecting
2020-04-21 11:33:14 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Connected
2020-04-21 11:33:14 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Status update
2020-04-21 11:33:16 DEBUG (MainThread) [aiosenseme.discovery] Failed to start Master Bedroom Wall
2020-04-21 11:33:17 DEBUG (MainThread) [aiosenseme.discovery] Discovered 2 existing fans
2020-04-21 11:33:17 DEBUG (MainThread) [aiosenseme.discovery] Listener closed on 192.168.1.6
2020-04-21 11:33:17 DEBUG (MainThread) [aiosenseme.discovery] Listener closed on 172.17.0.1
2020-04-21 11:33:17 DEBUG (MainThread) [aiosenseme.discovery] Listener closed on 172.30.32.1
2020-04-21 11:33:24 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Status update
2020-04-21 11:33:24 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Connection lost
2020-04-21 11:33:24 WARNING (MainThread) [aiosenseme.fan] Master Bedroom Wall: Connection lost
2020-04-21 11:33:24 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Updater task cancelled
2020-04-21 11:33:25 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Connecting
2020-04-21 11:33:25 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Connected
2020-04-21 11:33:25 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Status update
2020-04-21 11:33:29 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Status update
2020-04-21 11:33:29 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Connection lost
2020-04-21 11:33:29 WARNING (MainThread) [aiosenseme.fan] Master Bedroom Wall: Connection lost
2020-04-21 11:33:29 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Updater task cancelled
2020-04-21 11:33:30 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Connecting
2020-04-21 11:33:30 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Connected
2020-04-21 11:33:30 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Status update
2020-04-21 11:33:44 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Status update
2020-04-21 11:33:44 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Wall: Connection lost
andrewpc commented 4 years ago

I've run it two more times and its failed both times right around 37 minutes, even after changing the value as you requested. I updated the const.py and cleared the pycache folder. Anything else I need to do to get the new value picked up?

mikelawrence commented 4 years ago

As long as you restarted Home Assistant the const.py value was picked up. So when it fails you mean the Wall Controller did its weird dance with the lights flashing?

I'm pretty sure there is an error not being caught in the internal method _updater() which is causing the update rate to increase. What I don't know is if that is causing the problem with the controller going loopy or just a side effect. The previous library opened a new socket to the fan each time a command was sent or status was updated and it appeared to eventually cause the fan to loose the ability to communicate on the network for a bit. Sounds similar...

I did some digging around and it looks like they have discontinued your wall controller. Do you have a spare?

andrewpc commented 4 years ago

Thanks Mike. Yes errors began appearing in the log around 37 mins, as the device was falling off and trying to reconnect to my wifi. Pushing any buttons on the unit would then cause it to flash and if left like that for a long time, eventually it would flash continually in an error state.

I agree with you, it feels like the update rate is increasing or old requests are not being cancelled.

It may have been happening with the old implementation, but as I could disable the wall controller from being probed I hadnt seen it.

My thoughts are at this stage, it might be easiest to

  1. Add a config to disable wall controllers or just ignore them completely as they seem to identify as a Switch per the log
  2. If we can solve the status updates killing the device, then perhaps we could then create binary sensors in HA for wall controllers that just give occupancy state. It means they could then be used for automations. No need to link them to the specific fan, as they can be setup to control more than one.

I believe the wireless wall controller was discontinued in favour of a traditional wired controller recently. Its the only one Ive got unfortunately :) but happy to test for you.

mikelawrence commented 4 years ago

I agree. I released a new aiosenseme library and senseme-hacs integration that hopefully ignores Wall Controllers for now.

Trying to debug this via your Home Assistant/senseme integration/aiosenseme library is a significant challenge. Do you have any Python experience? Access to a linux (virtual) machine with Python 3.6-3.8? The reason I ask this I could write some specific test code that you could run on one of your machines with network acces to the Wall Controller. Yes this would entail trusting me not to do something bad. You can directly contact me via mike{at}bigmike{remove}home{period}com

andrewpc commented 4 years ago

The new version is installed and working well. Ive recently added a second fan and the two fans seem reliable and updates are quick. The wall control is now disabled which means I can now keep the integration running. Thanks!

I will email you in regards to the testing of the wall control code. Cheers.

mikelawrence commented 4 years ago

I received some Debug information from another user that has an L-Series fan and a Wireless Wall Controller and I noticed that his L-Series fan has a parameter [SNSROCC;STATUS] which is the Occupancy Sensor Status on my fans. There is another parameter [DEVICE;OPTION;SENSORS] which I think indicates the L-Series fan has an occupancy sensor.

Correct me if I'm wrong but the only way the L-Series fan can have an occupancy sensor is if it's connected a Wireless Wall Controller. So this may be a way to get occupancy status without connecting directly to the Wireless Wall Controller.

Would you be willing to enable debug in Home Assistant again and collect all the senseme messages over the course of several hours. It would be especially helpful if there is motion followed by inactivity near the Wireless Wall Controller?

logger:
  default: warning
  logs:
    custom_components.senseme: debug
    aiosenseme: debug

I don't need the discovery debug messages.

andrewpc commented 4 years ago

Mike, apologies for the delay in response. Ive just had a chance to try this today. The L series fan is the Master Bedroom fan in the log below. It looks to be correctly sending an 'OCCUPIED' state when I walked in front of the sensor at 12:59:29 and then 10 minutes later at 13:09:29, the state is reset to 'UNOCCUPIED'. The only thing that I noticed was that 'OCCUPIED' state is not shown in the log right at the point that it occurs but on the next 1 minute interval where the values are updated. Should this value be pushed immediately?

2020-05-27 12:59:01 DEBUG (MainThread) [aiosenseme.fan] Living Room Fan: Status update
2020-05-27 12:59:01 DEBUG (MainThread) [aiosenseme.fan] Living Room Fan: Param updated: [SLEEP;EVENT]='OFF'
2020-05-27 12:59:01 DEBUG (MainThread) [aiosenseme.fan] Living Room Fan: Param updated: [SLEEP;EVENT]='ON'
2020-05-27 12:59:29 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Fan: Status update
2020-05-27 12:59:29 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Fan: Param updated: [SNSROCC;STATUS]='OCCUPIED'
2020-05-27 12:59:29 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Fan: Param updated: [SLEEP;EVENT]='OFF'
2020-05-27 12:59:29 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Fan: Param updated: [SLEEP;EVENT]='ON'
2020-05-27 13:00:10 DEBUG (MainThread) [aiosenseme.fan] Living Room Fan: Status update
2020-05-27 13:00:10 DEBUG (MainThread) [aiosenseme.fan] Living Room Fan: Param updated: [SLEEP;EVENT]='OFF'
2020-05-27 13:00:10 DEBUG (MainThread) [aiosenseme.fan] Living Room Fan: Param updated: [SLEEP;EVENT]='ON'
2020-05-27 13:00:28 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Fan: Status update
2020-05-27 13:00:29 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Fan: Param updated: [SLEEP;EVENT]='OFF'
2020-05-27 13:00:29 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Fan: Param updated: [SLEEP;EVENT]='ON'
2020-05-27 13:00:46 DEBUG (MainThread) [aiosenseme.discovery] Listening on 192.168.1.6
2020-05-27 13:00:46 DEBUG (MainThread) [aiosenseme.discovery] Discovery broadcast on 192.168.1.6
2020-05-27 13:00:46 DEBUG (MainThread) [aiosenseme.discovery] Listening on 172.17.0.1
2020-05-27 13:00:46 DEBUG (MainThread) [aiosenseme.discovery] Discovery broadcast on 172.17.0.1
2020-05-27 13:00:46 DEBUG (MainThread) [aiosenseme.discovery] Listening on 172.30.32.1
2020-05-27 13:00:46 DEBUG (MainThread) [aiosenseme.discovery] Discovery broadcast on 172.30.32.1
2020-05-27 13:00:46 DEBUG (MainThread) [aiosenseme.discovery] Received 'Living Room Fan;DEVICE;ID;20:F8:5E:39:0D:67;FAN,HAIKU,HSERIES' from 192.168.1.110 on 192.168.1.6
2020-05-27 13:00:46 DEBUG (MainThread) [aiosenseme.discovery] Ignored Wall Switch 'Master Bedroom Wall Control;DEVICE;ID;20:F8:5E:14:DC:8B;SWITCH,SENSEME' on 192.168.1.6
2020-05-27 13:00:46 DEBUG (MainThread) [aiosenseme.discovery] Received 'Master Bedroom Fan;DEVICE;ID;20:F8:5E:19:FB:C9;FAN,LSERIES' from 192.168.1.98 on 192.168.1.6
2020-05-27 13:00:47 DEBUG (MainThread) [aiosenseme.discovery] Discovery broadcast on 192.168.1.6
2020-05-27 13:00:47 DEBUG (MainThread) [aiosenseme.discovery] Discovery broadcast on 172.17.0.1
2020-05-27 13:00:47 DEBUG (MainThread) [aiosenseme.discovery] Discovery broadcast on 172.30.32.1
2020-05-27 13:00:47 DEBUG (MainThread) [aiosenseme.discovery] Received 'Living Room Fan;DEVICE;ID;20:F8:5E:39:0D:67;FAN,HAIKU,HSERIES' from 192.168.1.110 on 192.168.1.6
2020-05-27 13:00:47 DEBUG (MainThread) [aiosenseme.discovery] Received 'Master Bedroom Fan;DEVICE;ID;20:F8:5E:19:FB:C9;FAN,LSERIES' from 192.168.1.98 on 192.168.1.6
2020-05-27 13:00:47 DEBUG (MainThread) [aiosenseme.discovery] Ignored Wall Switch 'Master Bedroom Wall Control;DEVICE;ID;20:F8:5E:14:DC:8B;SWITCH,SENSEME' on 192.168.1.6
2020-05-27 13:00:48 DEBUG (MainThread) [aiosenseme.discovery] Discovery broadcast on 192.168.1.6
2020-05-27 13:00:48 DEBUG (MainThread) [aiosenseme.discovery] Discovery broadcast on 172.17.0.1
2020-05-27 13:00:48 DEBUG (MainThread) [aiosenseme.discovery] Discovery broadcast on 172.30.32.1
2020-05-27 13:00:48 DEBUG (MainThread) [aiosenseme.discovery] Received 'Master Bedroom Fan;DEVICE;ID;20:F8:5E:19:FB:C9;FAN,LSERIES' from 192.168.1.98 on 192.168.1.6
2020-05-27 13:00:48 DEBUG (MainThread) [aiosenseme.discovery] Ignored Wall Switch 'Master Bedroom Wall Control;DEVICE;ID;20:F8:5E:14:DC:8B;SWITCH,SENSEME' on 192.168.1.6
2020-05-27 13:00:49 DEBUG (MainThread) [aiosenseme.discovery] Received 'Living Room Fan;DEVICE;ID;20:F8:5E:39:0D:67;FAN,HAIKU,HSERIES' from 192.168.1.110 on 192.168.1.6
2020-05-27 13:00:50 DEBUG (MainThread) [aiosenseme.discovery] Discovery broadcast on 192.168.1.6
2020-05-27 13:00:50 DEBUG (MainThread) [aiosenseme.discovery] Discovery broadcast on 172.17.0.1
2020-05-27 13:00:50 DEBUG (MainThread) [aiosenseme.discovery] Discovery broadcast on 172.30.32.1
2020-05-27 13:00:50 DEBUG (MainThread) [aiosenseme.discovery] Received 'Living Room Fan;DEVICE;ID;20:F8:5E:39:0D:67;FAN,HAIKU,HSERIES' from 192.168.1.110 on 192.168.1.6
2020-05-27 13:00:50 DEBUG (MainThread) [aiosenseme.discovery] Ignored Wall Switch 'Master Bedroom Wall Control;DEVICE;ID;20:F8:5E:14:DC:8B;SWITCH,SENSEME' on 192.168.1.6
2020-05-27 13:00:50 DEBUG (MainThread) [aiosenseme.discovery] Received 'Master Bedroom Fan;DEVICE;ID;20:F8:5E:19:FB:C9;FAN,LSERIES' from 192.168.1.98 on 192.168.1.6
2020-05-27 13:00:51 DEBUG (MainThread) [aiosenseme.discovery] Discovery broadcast on 192.168.1.6
2020-05-27 13:00:51 DEBUG (MainThread) [aiosenseme.discovery] Discovery broadcast on 172.17.0.1
2020-05-27 13:00:51 DEBUG (MainThread) [aiosenseme.discovery] Discovery broadcast on 172.30.32.1
2020-05-27 13:00:51 DEBUG (MainThread) [aiosenseme.discovery] Received 'Living Room Fan;DEVICE;ID;20:F8:5E:39:0D:67;FAN,HAIKU,HSERIES' from 192.168.1.110 on 192.168.1.6
2020-05-27 13:00:51 DEBUG (MainThread) [aiosenseme.discovery] Ignored Wall Switch 'Master Bedroom Wall Control;DEVICE;ID;20:F8:5E:14:DC:8B;SWITCH,SENSEME' on 192.168.1.6
2020-05-27 13:00:52 DEBUG (MainThread) [aiosenseme.discovery] Received 'Master Bedroom Fan;DEVICE;ID;20:F8:5E:19:FB:C9;FAN,LSERIES' from 192.168.1.98 on 192.168.1.6
2020-05-27 13:00:53 DEBUG (MainThread) [aiosenseme.discovery] Discovered 2 existing fans
2020-05-27 13:00:53 DEBUG (MainThread) [aiosenseme.discovery] Listener closed on 192.168.1.6
2020-05-27 13:00:53 DEBUG (MainThread) [aiosenseme.discovery] Listener closed on 172.17.0.1
2020-05-27 13:00:53 DEBUG (MainThread) [aiosenseme.discovery] Listener closed on 172.30.32.1
2020-05-27 13:01:05 DEBUG (MainThread) [aiosenseme.fan] Living Room Fan: Status update
2020-05-27 13:01:05 DEBUG (MainThread) [aiosenseme.fan] Living Room Fan: Param updated: [SNSROCC;STATUS]='UNOCCUPIED'
2020-05-27 13:01:05 DEBUG (MainThread) [aiosenseme.fan] Living Room Fan: Param updated: [SLEEP;EVENT]='OFF'
2020-05-27 13:01:05 DEBUG (MainThread) [aiosenseme.fan] Living Room Fan: Param updated: [SLEEP;EVENT]='ON'
2020-05-27 13:01:34 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Fan: Status update
2020-05-27 13:01:34 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Fan: Param updated: [SLEEP;EVENT]='OFF'
2020-05-27 13:01:34 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Fan: Param updated: [SLEEP;EVENT]='ON'
2020-05-27 13:02:07 DEBUG (MainThread) [aiosenseme.fan] Living Room Fan: Status update
2020-05-27 13:02:07 DEBUG (MainThread) [aiosenseme.fan] Living Room Fan: Param updated: [SLEEP;EVENT]='OFF'
2020-05-27 13:02:07 DEBUG (MainThread) [aiosenseme.fan] Living Room Fan: Param updated: [SLEEP;EVENT]='ON'
2020-05-27 13:02:39 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Fan: Status update
2020-05-27 13:02:39 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Fan: Param updated: [SLEEP;EVENT]='OFF'
2020-05-27 13:02:39 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Fan: Param updated: [SLEEP;EVENT]='ON'
2020-05-27 13:03:01 DEBUG (MainThread) [aiosenseme.fan] Living Room Fan: Status update
2020-05-27 13:03:01 DEBUG (MainThread) [aiosenseme.fan] Living Room Fan: Param updated: [SLEEP;EVENT]='OFF'
2020-05-27 13:03:01 DEBUG (MainThread) [aiosenseme.fan] Living Room Fan: Param updated: [SLEEP;EVENT]='ON'
2020-05-27 13:03:41 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Fan: Status update
2020-05-27 13:03:41 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Fan: Param updated: [SLEEP;EVENT]='OFF'
2020-05-27 13:03:41 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Fan: Param updated: [SLEEP;EVENT]='ON'
2020-05-27 13:03:58 DEBUG (MainThread) [aiosenseme.fan] Living Room Fan: Status update
2020-05-27 13:03:58 DEBUG (MainThread) [aiosenseme.fan] Living Room Fan: Param updated: [SLEEP;EVENT]='OFF'
2020-05-27 13:03:58 DEBUG (MainThread) [aiosenseme.fan] Living Room Fan: Param updated: [SLEEP;EVENT]='ON'
2020-05-27 13:04:41 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Fan: Status update
2020-05-27 13:04:42 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Fan: Param updated: [SLEEP;EVENT]='OFF'
2020-05-27 13:04:42 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Fan: Param updated: [SLEEP;EVENT]='ON'
2020-05-27 13:05:03 DEBUG (MainThread) [aiosenseme.fan] Living Room Fan: Status update
2020-05-27 13:05:03 DEBUG (MainThread) [aiosenseme.fan] Living Room Fan: Param updated: [SLEEP;EVENT]='OFF'
2020-05-27 13:05:03 DEBUG (MainThread) [aiosenseme.fan] Living Room Fan: Param updated: [SLEEP;EVENT]='ON'
2020-05-27 13:05:44 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Fan: Status update
2020-05-27 13:05:44 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Fan: Param updated: [SLEEP;EVENT]='OFF'
2020-05-27 13:05:44 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Fan: Param updated: [SLEEP;EVENT]='ON'
2020-05-27 13:05:47 DEBUG (MainThread) [aiosenseme.discovery] Listening on 192.168.1.6
2020-05-27 13:05:47 DEBUG (MainThread) [aiosenseme.discovery] Discovery broadcast on 192.168.1.6
2020-05-27 13:05:47 DEBUG (MainThread) [aiosenseme.discovery] Listening on 172.17.0.1
2020-05-27 13:05:47 DEBUG (MainThread) [aiosenseme.discovery] Discovery broadcast on 172.17.0.1
2020-05-27 13:05:47 DEBUG (MainThread) [aiosenseme.discovery] Listening on 172.30.32.1
2020-05-27 13:05:47 DEBUG (MainThread) [aiosenseme.discovery] Discovery broadcast on 172.30.32.1
2020-05-27 13:05:47 DEBUG (MainThread) [aiosenseme.discovery] Received 'Master Bedroom Fan;DEVICE;ID;20:F8:5E:19:FB:C9;FAN,LSERIES' from 192.168.1.98 on 192.168.1.6
2020-05-27 13:05:47 DEBUG (MainThread) [aiosenseme.discovery] Received 'Living Room Fan;DEVICE;ID;20:F8:5E:39:0D:67;FAN,HAIKU,HSERIES' from 192.168.1.110 on 192.168.1.6
2020-05-27 13:05:47 DEBUG (MainThread) [aiosenseme.discovery] Ignored Wall Switch 'Master Bedroom Wall Control;DEVICE;ID;20:F8:5E:14:DC:8B;SWITCH,SENSEME' on 192.168.1.6
2020-05-27 13:05:48 DEBUG (MainThread) [aiosenseme.discovery] Discovery broadcast on 192.168.1.6
2020-05-27 13:05:48 DEBUG (MainThread) [aiosenseme.discovery] Discovery broadcast on 172.17.0.1
2020-05-27 13:05:48 DEBUG (MainThread) [aiosenseme.discovery] Discovery broadcast on 172.30.32.1
2020-05-27 13:05:48 DEBUG (MainThread) [aiosenseme.discovery] Received 'Master Bedroom Fan;DEVICE;ID;20:F8:5E:19:FB:C9;FAN,LSERIES' from 192.168.1.98 on 192.168.1.6
2020-05-27 13:05:48 DEBUG (MainThread) [aiosenseme.discovery] Ignored Wall Switch 'Master Bedroom Wall Control;DEVICE;ID;20:F8:5E:14:DC:8B;SWITCH,SENSEME' on 192.168.1.6
2020-05-27 13:05:49 DEBUG (MainThread) [aiosenseme.discovery] Received 'Living Room Fan;DEVICE;ID;20:F8:5E:39:0D:67;FAN,HAIKU,HSERIES' from 192.168.1.110 on 192.168.1.6
2020-05-27 13:05:50 DEBUG (MainThread) [aiosenseme.discovery] Discovery broadcast on 192.168.1.6
2020-05-27 13:05:50 DEBUG (MainThread) [aiosenseme.discovery] Discovery broadcast on 172.17.0.1
2020-05-27 13:05:50 DEBUG (MainThread) [aiosenseme.discovery] Discovery broadcast on 172.30.32.1
2020-05-27 13:05:50 DEBUG (MainThread) [aiosenseme.discovery] Received 'Master Bedroom Fan;DEVICE;ID;20:F8:5E:19:FB:C9;FAN,LSERIES' from 192.168.1.98 on 192.168.1.6
2020-05-27 13:05:50 DEBUG (MainThread) [aiosenseme.discovery] Received 'Living Room Fan;DEVICE;ID;20:F8:5E:39:0D:67;FAN,HAIKU,HSERIES' from 192.168.1.110 on 192.168.1.6
2020-05-27 13:05:50 DEBUG (MainThread) [aiosenseme.discovery] Ignored Wall Switch 'Master Bedroom Wall Control;DEVICE;ID;20:F8:5E:14:DC:8B;SWITCH,SENSEME' on 192.168.1.6
2020-05-27 13:05:51 DEBUG (MainThread) [aiosenseme.discovery] Discovery broadcast on 192.168.1.6
2020-05-27 13:05:51 DEBUG (MainThread) [aiosenseme.discovery] Discovery broadcast on 172.17.0.1
2020-05-27 13:05:51 DEBUG (MainThread) [aiosenseme.discovery] Discovery broadcast on 172.30.32.1
2020-05-27 13:05:51 DEBUG (MainThread) [aiosenseme.discovery] Received 'Living Room Fan;DEVICE;ID;20:F8:5E:39:0D:67;FAN,HAIKU,HSERIES' from 192.168.1.110 on 192.168.1.6
2020-05-27 13:05:51 DEBUG (MainThread) [aiosenseme.discovery] Ignored Wall Switch 'Master Bedroom Wall Control;DEVICE;ID;20:F8:5E:14:DC:8B;SWITCH,SENSEME' on 192.168.1.6
2020-05-27 13:05:52 DEBUG (MainThread) [aiosenseme.discovery] Received 'Master Bedroom Fan;DEVICE;ID;20:F8:5E:19:FB:C9;FAN,LSERIES' from 192.168.1.98 on 192.168.1.6
2020-05-27 13:05:53 DEBUG (MainThread) [aiosenseme.discovery] Discovered 2 existing fans
2020-05-27 13:05:53 DEBUG (MainThread) [aiosenseme.discovery] Listener closed on 192.168.1.6
2020-05-27 13:05:53 DEBUG (MainThread) [aiosenseme.discovery] Listener closed on 172.17.0.1
2020-05-27 13:05:53 DEBUG (MainThread) [aiosenseme.discovery] Listener closed on 172.30.32.1
2020-05-27 13:05:54 DEBUG (MainThread) [aiosenseme.fan] Living Room Fan: Status update
2020-05-27 13:05:54 DEBUG (MainThread) [aiosenseme.fan] Living Room Fan: Param updated: [SLEEP;EVENT]='OFF'
2020-05-27 13:05:54 DEBUG (MainThread) [aiosenseme.fan] Living Room Fan: Param updated: [SLEEP;EVENT]='ON'
2020-05-27 13:06:39 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Fan: Status update
2020-05-27 13:06:39 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Fan: Param updated: [SLEEP;EVENT]='OFF'
2020-05-27 13:06:39 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Fan: Param updated: [SLEEP;EVENT]='ON'
2020-05-27 13:07:02 DEBUG (MainThread) [aiosenseme.fan] Living Room Fan: Status update
2020-05-27 13:07:02 DEBUG (MainThread) [aiosenseme.fan] Living Room Fan: Param updated: [SLEEP;EVENT]='OFF'
2020-05-27 13:07:02 DEBUG (MainThread) [aiosenseme.fan] Living Room Fan: Param updated: [SLEEP;EVENT]='ON'
2020-05-27 13:07:30 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Fan: Status update
2020-05-27 13:07:30 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Fan: Param updated: [SLEEP;EVENT]='OFF'
2020-05-27 13:07:30 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Fan: Param updated: [SLEEP;EVENT]='ON'
2020-05-27 13:08:03 DEBUG (MainThread) [aiosenseme.fan] Living Room Fan: Status update
2020-05-27 13:08:04 DEBUG (MainThread) [aiosenseme.fan] Living Room Fan: Param updated: [SLEEP;EVENT]='OFF'
2020-05-27 13:08:04 DEBUG (MainThread) [aiosenseme.fan] Living Room Fan: Param updated: [SLEEP;EVENT]='ON'
2020-05-27 13:08:35 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Fan: Status update
2020-05-27 13:08:35 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Fan: Param updated: [SLEEP;EVENT]='OFF'
2020-05-27 13:08:35 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Fan: Param updated: [SLEEP;EVENT]='ON'
2020-05-27 13:09:12 DEBUG (MainThread) [aiosenseme.fan] Living Room Fan: Status update
2020-05-27 13:09:12 DEBUG (MainThread) [aiosenseme.fan] Living Room Fan: Param updated: [SLEEP;EVENT]='OFF'
2020-05-27 13:09:12 DEBUG (MainThread) [aiosenseme.fan] Living Room Fan: Param updated: [SLEEP;EVENT]='ON'
2020-05-27 13:09:29 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Fan: Status update
2020-05-27 13:09:29 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Fan: Param updated: [SNSROCC;STATUS]='UNOCCUPIED'
2020-05-27 13:09:29 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Fan: Param updated: [SLEEP;EVENT]='OFF'
2020-05-27 13:09:29 DEBUG (MainThread) [aiosenseme.fan] Master Bedroom Fan: Param updated: [SLEEP;EVENT]='ON'
mikelawrence commented 4 years ago

Thanks for the info!

With my fans I believe the occupancy status is pushed immediately. If it doesn't on yours it is a function of the firmware in the fan/wall controller.

I have a pre-release of the senseme-hacs integration v2.1.1 that enables the occupancy sensor for Haiku L Fans when connected to a wall controller. Please give it a try and let me know if works.

andrewpc commented 4 years ago

Thank you, I have updated to 2.1.1 and can see the occupancy sensor for the L series fan and will monitor.

In regards to the sensor push updates, I see them as part of the 1 minute fan update messages in the debug log which reflect the speed of the entity changes. How are these sent from the fan? Perhaps Im blocking them on the network somehow as I have the latest firmware. Confirming you see them instantly without waiting for the next status update?

mikelawrence commented 4 years ago

I need to investigate a bit deeper later tonight but yes I believe occupancy status changes are pushed immediately and do not have a relationship to update requests for my Haiku Fan with no Wireless Wall Control setup.

The underlying library (aiosenseme) establishes a socket connection to each fan under control. This two way communication is used to send commands and receive push updates. The library attempts to keep this connection open at all times. So if the status update that occurs about every minute or so is working then so are the push updates. I doubt there is a network problem. You should see other settings update immediately in Home Assistant so try turning the fan on and off with a remote control or wall control to prove this.

This is a function of the firmware in the fan. Keep in might that at least in my environment the occupancy status does not appear in the BAF application which is why this may not matter to BAF.

Mike Lawrence

Note the new email address mike@bigmike.name

On May 27, 2020, at 7:35 AM, andrewpc notifications@github.com wrote:

Thank you, I have updated to 2.1.1 and can see the occupancy sensor for the L series fan and will monitor.

In regards to the sensor push updates, I see them as part of the 1 minute fan update messages in the debug log which reflect the speed of the entity changes. How are these sent from the fan? Perhaps Im blocking them on the network somehow as I have the latest firmware. Confirming you see them instantly without waiting for the next status update?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/mikelawrence/senseme-hacs/issues/4#issuecomment-634630255, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABH2ZGTSZIIIEUORJEUWYSDRTUCKNANCNFSM4MM2R4YQ.

mikelawrence commented 4 years ago

So I have been lookling at the occupancy sensor on my setup (two Haiku Fan with lights (pre 2016) and I don't think my previous statement about immediate occupancy sensor updates is true. In fact it looks exactly as you described (only updating with the status update). But I'm having problems with the sensor. Mine appears to indicate OCCUPIED most of the time. So I need further testing.

As a side note, BAF treats the occupancy sensor differently than other fans settings. There is one command to retrieve all current settings except the occupancy sensor. It requires a separate command to retrieve status.

I made a change to support occupancy sensor updates every 10 seconds with a full status update every 10th occupancy sensor update. This may improve the occupancy sensor usefulness but it may also cause more disconnects with the fans. I need to run an extended test on this change.

andrewpc commented 4 years ago

Good that you could replicate my issues. Ive done some further digging and been able to enable realtime push updates but it may come with a compromise. In the app, there is a Motion tab that allows you to automatically turn on the fan and/or light when entering a room and furthermore set how long before the fan/light then waits before turning off. If I enable this feature, a command is sent to the fan either one of these two:

[LIGHT;AUTO]='ON'
[FAN;AUTO]='ON'

After this I see realtime push events in my log when walking past the sensor. Adjusting the timeout option sends the following command (this is for 5 minutes):

[SNSROCC;TIMEOUT;CURR]='300000'

and after this time passes, then the UNOCCUPIED state is sent.

So, it all works as expected, although it appears you have to enable the auto fan/light feature to get the push which may not be what everyone wants.

Here is the screenshot of the app for clarity

Screenshot_20200601-103727

mikelawrence commented 3 years ago

I never found a good solution to this problem. Mainly because updating every 10 seconds seems a bit much. This is really a limitation of the fan itself so I'm going to close this issue.