SenseME by Big Ass Fans asynchronous Python library
Project description
aiosenseme library
This 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 for Home Assistant using asyncio but should work fine in other applications.
This library (based on TomFaulkner's library) 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 of Bruce. His work in making an Indigo plugin made this library possible.
Thanks to PenitentTangent2401 for help in debugging the standalone Haiku Light.
Model Notes
- Confirmed support of Haiku, Haiku H, and Haiku L fans.
- Confirmed support of discontinued standalone Haiku Light.
- Supports Wireless Wall Control indirectly through fan status reporting.
- Probably supports Haiku C fans.
- The i6 fan is NOT currently supported.
- The es6 fan is most likely NOT supported. This is untested.
Command line access
The 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 in Studio Fans
room and the Haiku Light is not part of a room.
$ aiosenseme --discover
Studio Beam Fan
Room Name: Studio Fans, Room Type: Family Room
Model: Haiku Fan with light, FW Version: 2.6.0
IP Addr: 192.168.1.2, MAC Addr: FF:FF:FF:FF:FF:FF
UUID: 73264cb2-1234-1234-1234-012345678912
Studio Vault Fan
Room Name: Studio Fans, Room Type: Family Room
Model: Haiku Fan with light, FW Version: 2.6.0
IP Addr: 192.168.1.3, MAC Addr: FF:FF:FF:FF:FF:FF
UUID: 73264cb2-1234-1234-1234-012345678913
Hallway Light
Model: Haiku Light, FW Version: 2.6.0
IP Addr: 192.168.1.3, MAC Addr: FF:FF:FF:FF:FF:FF
UUID: 73264cb2-1234-1234-1234-012345678913
To 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 Fan
Room Name: Studio Fans, Room Type: Family Room
Model: Haiku Fan with light, FW Version: 2.6.0
IP Addr: 192.168.1.3, MAC Addr: FF:FF:FF:FF:FF:FF
UUID: 73264cb2-1234-1234-1234-012345678912
State: Fan is off, Light is off
Here 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" --speed 3 --light on
Studio Beam Fan
Room Name: Studio Fans, Room Type: Family Room
Model: Haiku Fan with light, FW Version: 2.6.0
IP Addr: 192.168.1.2, MAC Addr: FF:FF:FF:FF:FF:FF
UUID: 73264cb2-1234-1234-1234-012345678912
State: Fan is on (speed: 2), Light is off, Whoosh: on
New 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 -i 192.168.1.3 --speed 4
Studio Vault Fan
Room Name: Studio Fans, Room Type: Family Room
Model: Haiku Fan with light, FW Version: 2.6.0
IP Addr: 192.168.1.3, MAC Addr: FF:FF:FF:FF:FF:FF
UUID: 73264cb2-1234-1234-1234-012345678912
State: Fan is off, Light is off
New State: Fan is on (speed: 4), Light is off
To 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" --light on --colortemp 5000
Hallway Light
Model: Haiku Light, FW Version: 2.6.0
IP Addr: 192.168.1.3, MAC Addr: FF:FF:FF:FF:FF:FF
UUID: 73264cb2-1234-1234-1234-012345678913
State: Light is off
State: Light is on (brightness: 9, color temp: 5000)
To get a fan's information and state formatted as json.
$ aiosenseme -i 192.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"
}
Issues
- There 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 Fans website says the i6 fan has SenseME technology but it uses a different app which requires Bluetooth for initial setup. There is some evidence that 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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file aiosenseme-0.6.1.tar.gz
.
File metadata
- Download URL: aiosenseme-0.6.1.tar.gz
- Upload date:
- Size: 35.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 05408f227f9bc45bb366fb330d4aec75bcd0c449f60401d38db3e67d2be56302 |
|
MD5 | 00cbbccb62e4f96970b4ccd6dfe3c04c |
|
BLAKE2b-256 | 0ce569c44d60f35adbb6dc8af967fbaf146122fb114dbc54aad66b3d0546be26 |
File details
Details for the file aiosenseme-0.6.1-py3-none-any.whl
.
File metadata
- Download URL: aiosenseme-0.6.1-py3-none-any.whl
- Upload date:
- Size: 34.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1c470dab4ed7e3a414a4feff1604a8b2048df13d87a804abf3f8e2093d6d628a |
|
MD5 | 5d8a83f28c6d37d2f754495b8b5ce033 |
|
BLAKE2b-256 | 513369eaadb4c4e560d34a76500f9c9b11799d7e2b11dfb39cb831b300a6d8ba |