Haiku/SenseMe Smart Fan Support

@OzGav So once you install the SenseME integration with HACS and you have rebooted you then have to add the integration.

Goto Configuration -> Integrations then click the + icon at the bottom right. Type in “senseme” and then select the SenseME integration. Follow the directions from there. It should detect your fans. If you haven’t done this step then that might explain why the aiosenseme library hasn’t been installed and there are no errors in the log about it. The aiosenseme library should be installed with “pip”. If you just copied files it may not work so I recommend removing any aiosenseme files you manually copied.

There is additional information about other issues with this integration on Github.

Thanks Mike. I hate looking like a noob! :slight_smile: All working now. Thanks again for all the effort you have put into getting this to work and to answering dumb questions like mine!

Cheers!
Gav…

No worries!

First time doing stuff on github so see how I go but I have added a pull request on the logo repository to get the Haiku icon added.

That’s awesome!

Mike, loving the integration so far. Is there a way to manually trigger discovery when a device is unavailable?

Sorry there is no way to manually trigger a discovery. It might be possible to do this with integration options but I don’t think that is the intent of these settings in Home Assistant.

Discovery does run automatically every 5 minutes and should eventually detect initially undetected fans. Are you having a specific or frequent problem with missing fans?

Looks like the logo is now available! Thanks!

I noticed it after a restart. I have given it 15-30 minutes to update and nothing happens. It will be available in the app. So I restart HA and it’s available again.

Yeah turned out alright!

Hmm… not sure where I’m getting into issues here. Hope someone can point me in the right direction!

I installed the SenseME integration using HACS. It shows that it’s installed fine.

When I go to ‘Configuration - Integration - +’ I get nothing:

Not sure what I’m doing wrong here. :unamused:

You can try adding the following to your configuration yaml.

logger:
  default: warning
  logs:
    aiosenseme.discovery: debug

This will show all attempts at discovery in the log. You will see multiple attempts every 5 minutes. Look for errors.

Did you restart Home Assistant after installing Senseme? If you did check the log for errors from senseme or aiosenseme.

Yup, rebooted after installation.

In the logs I found this:

2020-07-21 18:29:14 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for senseme which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant.
2020-07-21 18:29:14 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant.
2020-07-21 18:29:24 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform senseme.light: Platform not found (No module named 'aiosenseme').
2020-07-21 18:29:24 ERROR (MainThread) [homeassistant.helpers.integration_platform] Unexpected error importing senseme/logbook.py
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/integration_platform.py", line 30, in _process
    platform = integration.get_platform(platform_name)
  File "/usr/src/homeassistant/homeassistant/loader.py", line 322, in get_platform
    f"{self.pkg_path}.{platform_name}"
  File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'custom_components.old.logbook'
2020-07-21 18:29:24 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform senseme.fan: Platform not found (No module named 'aiosenseme').

Wow I have no idea what is going wrong. The Platform not found (No module named 'aiosenseme') error indicates the Home Assistant is not able to install the aiosenseme library using pip. This is all handled by Home Assistant so I’m not sure why it’s not working. HA must have internet access to download these libraries. Do you have an unusual HA instance? Docker? VM?

The last error indicates it can’t import senseme/logbook.py. That would be correct because there is no senseme/logbook.py in either the senseme integration or aiosenseme library.

I would switch to a fresh install of Home Assistant on a Raspberry Pi without HACS and try the manual installation of the senseme integration as shown on Github.

Hmm… I’ve a pretty standard installation. Entire system is running on HassIO (or Home Assistant Operating System as it’s now called?

When is ‘aiosenseme’ installed? Is it upon adding the integration? If so, it would make sense that it’s not installed as I’ve not been able to add the integration.

By manual installation, do you mean copying and adding the folder into the custom_components folder? If so, I’ve tried that to the same result. The integration does not appear when I try to add it.

I guess I will try a fresh installation if there are no other suggestions, though I naturally dread the idea of moving everything over…

So I think Home Assistant now means everything running a Raspberry Pi. This used to be called HASSIO.

Home Assistant automatically installs the aiosenseme library but I can’t remember if it’s when the integration is detected or added by the GUI. Either way this is a function of Home Assistant and not the integration. Your error messages look like it can’t figure out where get aiosenseme. Does your Home Assistant have access to the internet?

Manual installation is as you described.

You could test a fresh install on a separate Raspberry Pi. Running multiple Home Assistant instances is possible on one network.

I will be back home Friday and can do some additional testing if you haven’t figured it out by then.

I was digging around the logs and realised where the log entries I had were originating from. I had ‘senseme’ defined in the configuration.yaml to test.

I also looked at some documentation on components and your code (i’m no means a competent programmer!). It seems like that aiosenseme library is added after the integration is added in the GUI.

I’ve edited the configuration file and all the above logs i pasted above have disappeared. I guess that kind of makes sense since the integration is never added.

As i was typing the above, i had a ‘doh’ moment. It’s solved. I had your (really) old component (0.1.5) in the custom_component folder. I had renamed the folder… BUT i just realised that I needed to remove the folder as both use the same “senseme” domain! :zipper_mouth_face:

Leaving this here so others do not make the same mistake! :crazy_face:

Thank you for you patience!

That is definitely not one of my test cases. Glad it’s working for you now! :smiley:

Is there a recommended Lovelace card to use with this? I’ve had a pretty good search, but all the fan cards I found seem to be “low, medium, high” rather than the seven speeds of the Haiku.

Thanks for the integration!