Package: aiosenseme
aiosenseme libraryThis asynchronous Python library provides periodic discovery, control and push-based status for SenseME fans and lights by Big Ass Fans. It was developed mainly to provide access to SenseME devices forHome Assistantusing asyncio but should work fine in other applications.This library (based onTomFaulkner'slibrary) keeps an open socket to each controlled fan so that state changes from any source including local control are pushed more or less immediately. This approach is far more robust and responsive. A discovery task was also added to periodically detect SenseME devices on the network.Sniffing the packets and documenting the protocol was the work ofBruce. His work in making anIndigo pluginmade this library possible.Thanks toPenitentTangent2401for help in debugging the standalone Haiku Light.Model NotesConfirmed support of Haiku, Haiku H, and Haiku L fans.Confirmed support of discontinued standalone Haiku Light.SupportsWireless Wall Controlindirectly through fan status reporting.Probably supports Haiku C fans.Thei6 fanis NOT currently supported.Thees6 fanis most likely NOT supported. This is untested.Command line accessThe aiosenseme package now installs a command line script along with the package. To discover all devices on the network type the following. Here discovery found two standard Haiku Fans and a Haiku Light. The fans are inStudio Fansroom and the Haiku Light is not part of a room.$aiosenseme--discoverStudio Beam FanRoom Name: Studio Fans, Room Type: Family RoomModel: Haiku Fan with light, FW Version: 2.6.0IP Addr: 192.168.1.2, MAC Addr: FF:FF:FF:FF:FF:FFUUID: 73264cb2-1234-1234-1234-012345678912Studio Vault FanRoom Name: Studio Fans, Room Type: Family RoomModel: Haiku Fan with light, FW Version: 2.6.0IP Addr: 192.168.1.3, MAC Addr: FF:FF:FF:FF:FF:FFUUID: 73264cb2-1234-1234-1234-012345678913Hallway LightModel: Haiku Light, FW Version: 2.6.0IP Addr: 192.168.1.3, MAC Addr: FF:FF:FF:FF:FF:FFUUID: 73264cb2-1234-1234-1234-012345678913To get information and state of the device type the following. This uses discovery to match the specified device name or room name.$aiosenseme-n"Studio Vault Fan"Studio Vault FanRoom Name: Studio Fans, Room Type: Family RoomModel: Haiku Fan with light, FW Version: 2.6.0IP Addr: 192.168.1.3, MAC Addr: FF:FF:FF:FF:FF:FFUUID: 73264cb2-1234-1234-1234-012345678912State: Fan is off, Light is offHere both the fan speed is set and the light is turned on. Notice also that Whoosh was turned off when the fan speed was set specific value.$aiosenseme--name"Studio Vault Fan"--speed3--lightonStudio Beam FanRoom Name: Studio Fans, Room Type: Family RoomModel: Haiku Fan with light, FW Version: 2.6.0IP Addr: 192.168.1.2, MAC Addr: FF:FF:FF:FF:FF:FFUUID: 73264cb2-1234-1234-1234-012345678912State: Fan is on (speed: 2), Light is off, Whoosh: onNew State: Fan is on (speed: 3), Light is on (brightness: 16)You can also select the fan by IP address. This connects directly to the fan without using discovery.$aiosenseme-i192.168.1.3--speed4Studio Vault FanRoom Name: Studio Fans, Room Type: Family RoomModel: Haiku Fan with light, FW Version: 2.6.0IP Addr: 192.168.1.3, MAC Addr: FF:FF:FF:FF:FF:FFUUID: 73264cb2-1234-1234-1234-012345678912State: Fan is off, Light is offNew State: Fan is on (speed: 4), Light is offTo change the color temperature of a Haiku Light type the following. Changing a Haiku Light color temp will not turn the light on if it is already off.$aiosenseme--name"Hallway Light"--lighton--colortemp5000Hallway LightModel: Haiku Light, FW Version: 2.6.0IP Addr: 192.168.1.3, MAC Addr: FF:FF:FF:FF:FF:FFUUID: 73264cb2-1234-1234-1234-012345678913State: Light is offState: Light is on (brightness: 9, color temp: 5000)To get a fan's information and state formatted as json.$aiosenseme-i192.168.1.3-j{"address": "192.168.1.3","base_model": "FAN,HAIKU,SENSEME","device_beeper": true,"device_indicators": true,"fan_autocomfort": "OFF","fan_cooltemp": 22.77,"fan_dir": "FWD","fan_on": false,"fan_smartmode": "OFF","fan_speed": 0,"fan_speed_limits_room": [1,7],"fan_speed_max": 7,"fan_speed_min": 1,"fan_whoosh_mode": false,"fw_version": "2.6.0","has_light": true,"has_sensor": true,"is_fan": true,"is_light": false,"light_brightness": 0,"light_brightness_limits_room": [1,16],"light_brightness_max": 16,"light_brightness_min": 1,"light_on": false,"mac": "FF:FF:FF:FF:FF:FF","model": "Haiku Fan","motion_detected": false,"motion_fan_auto": false,"motion_light_auto": false,"name": "Studio Vault Fan","network_gateway": "255.255.255.0","network_ip": "192.168.1.3","network_ssid": "Network IoT","network_subnetmask": "192.168.1.1","room_name": "Studio","room_type": "Family Room","sleep_mode": false,"uuid": "73264cb2-1234-1234-1234-012345678913"}IssuesThere is a lot of error handling and reconnection logic to help with the fact that these devices sometimes stop working on the network. I have managed to decrease the likelihood of this happening by keeping an open connection to the device at all times instead of using multiple socket connections but it still happens.Discovery sometimes just does not work and it can happen for an extended period. Connecting via IP address instead of discovery may still work.Early testing indicates the i6 fan from Big Ass Fans is not compatible with this library. The Big Ass Fanswebsitesays the i6 fan has SenseME technology but it uses a different app which requires Bluetooth for initial setup. There is someevidencethat WiFi is still used to control the fan from the app once setup.The occupancy sensor is treated differently than other fan settings/states; occupancy state changes are not pushed immediately and must be detected with periodic status updates. So unfortunately this sensor will not seem very responsive.UDP port 31415 must be available and not blocked by a firewall.This library will not handle multiple instances of discovery running on the same machine.