Haiku/SenseMe Smart Fan Support

Have to go to work for five days so will look at this again when I get back. Will keep you posted. Thanks!

OK I have updated to 0.74.2 and all appears to be working. Not that I use it at the moment but is the “Whoosh” function supported? I just see “oscillate” and “direction” and “speed” when i click on it?

Thanks so much for getting this up and running!

Also it is unfortunate that it doesn’t seem like the temperature and motion sensor status in the fan can be read?

Ya I used Oscillate to control Whoosh. If you know a better way to handle whoosh let me know.

It may be possible to get motion information from the fan but I don’t know how it would work especially with status updates occurring every minute or so.

Since this custom component downloads a required library via PIP, can this be used with Hass.io? If so, are there any special steps required, as I’m not having any success after adding your custom components, updating my configuration.yaml file and rebooting. I see nothing related to my Haiku fans in Home Assistant.

I’m using it with Hass.io without issue (other than than the mentioned issue of the library failing to communicate with the fan/light). Many components require additional packages and Hass.io would be pretty limited if those requirements couldn’t be met.

claytonnj is correct, Hass.io will also automatically install the required third party library (SenseMe). I’ve modified the original post to mention Hass.io.

@lawr1000 as of HA 0.81.2 lines 96-97 need to be changed to:

    load_platform(hass, 'fan', DOMAIN, {}, config)
    load_platform(hass, 'light', DOMAIN, {}, config)

(* Pass hass_config to load_platform (@balloob - #17952))

In my testing this change should be backwards compatible. I can add an issue in GitHub or submit a pull request if you’d like but it seemed silly for such a minor change.

@claytonjn Thanks for fixing the problem! I’ve added your changes to the GitHub repository.

I am quite proud of myself and have manged to get my three fans (with lights and wall control) working from home assistant. Thanks so much for all the info above it have been very handy.
Spooling through the SenseMe library I can see some references to occupancy at least but my Python is too poor to do much more than that.:grinning:
I was wondering if anybody had been able to draw back the temperature, humidity, and occupancy sensors data into Home Assistant?

As far as I am aware “temperature, humidity, and occupancy sensors” are only available to the fan. That is, they aren’t broadcast out. You will notice none of that info is available in the native app.

Thanks @OzGav thats kind of what I was fearing about temp and humidity.

I will see if I can make the anything from the occupancy sensor code in the library.
@property
def motionmode_occupied_status(self):
"""Returns if the room is currently OCCUPIED or UNOCCUPIED based on the motion sensor in the fan."""
return self._query("<%s;SNSROCC;STATUS;GET>" % self.name)

Great. Please let me know if you have any success!

It appears this component has stopped working in 0.88 and later

Working for me, 0.88.1

How did you arrange your senseme.py files in the new custom_components structure?

See post below

Home Assistant seems to require a second restart to get the SenseMe library working for my sensme custom component. I didn’t investigate why.

The new organization of files for hub custom component has been fixed on Github. But it is not required by Home Assistant yet so the old version will still continue to work for a while.

Where to get the Sensme custom component is in this post:

I have created…/custom_components/senseme now instead of separate fan and light directories. Seems to be working except I am now getting this recurring error. Pretty sure it wasn’t happening before. V0.88.2

019-03-03 17:26:42 ERROR (MainThread) [homeassistant.helpers.entity] Update for fan.alfresco_fan fails
Traceback (most recent call last):
File “/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity.py”, line 221, in async_update_ha_state
await self.async_device_update()
File “/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity.py”, line 349, in async_device_update
await self.hass.async_add_executor_job(self.update)
File “/usr/local/lib/python3.7/concurrent/futures/thread.py”, line 57, in run
result = self.fn(*self.args, **self.kwargs)
File “/config/custom_components/senseme/fan.py”, line 177, in update
self._hub.update()
File “/usr/local/lib/python3.7/site-packages/homeassistant/util/init.py”, line 224, in wrapper
result = method(*args, **kwargs)
File “/config/custom_components/senseme/init.py”, line 282, in update
self._light_on = self._device.get_attribute(“LIGHT;PWR”) == ‘ON’
File “/config/deps/lib/python3.7/site-packages/senseme/senseme.py”, line 478, in get_attribute
return response_dict[attribute]
KeyError: ‘LIGHT;PWR’

Is this a regression of a problem that was fixed before? I don’t have a light on mine. Haiku/SenseMe Smart Fan Support - #17 by OzGav

There were some changes a while back to handle the light better. Trying to detect the light when Home Assistant was initializing was hit or miss. So I changed the component to assume there is a light and to use the config to stop that. Add an “include:” section to the “senseme:” section and set “has_light:” to false. Be sure to change the name to match your fan.

# enable Haiku with SenseMe ceiling fans
senseme:
  max_number_fans: 2
  # used to include only specific fans
  include:
    - name: "Studio Vault Fan"
      friendly_name: "Studio Fan"
      has_light: false

I edited the Github README to make the fact the light is added by default clearer.

Yeah thanks I should have read the manual sooner. I am just adding that in and hopefully will be back up!