Winix Purifier C545 Integration Request

I was able to successfully obtain the API key. I’m running into the following error when I run the script.

Traceback (most recent call last):
  File "winix-02.py", line 41, in <module>
    import paho.mqtt.client as mqtt
ModuleNotFoundError: No module named 'paho'

any ideas? I installed all the prereqs and I think I have the .yaml setup correctly… but I might be wrong.

Thanks!

probably my screw up. I am using this import to get MQTT support
import paho.mqtt.client as mqtt

requires this install, which it looks like I am doing incorrectly in my ‘requirements.txt’ file…

pip3 install paho-mqtt

see if you can get paho-mqtt installed correctly and then try to run the program or launch python 3 from command prompt and look to see no errors from typing:

user@ubuntu-macmini2012:~$ python3
Python 3.8.5 (default, Jul 28 2020, 12:59:40)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import paho.mqtt.client as mqtt

then exit python and try to run program. I am not the Python coder you want to follow :wink:

Good to see that you were successful with getting key and basic API for your unit.

OK so I got all the prereqs working properly and made some progress getting the script to run. Here’s the latest error:

  File "winix-02.py", line 65, in <module>
    handler_file = logging.handlers.RotatingFileHandler(WORKING_DIRECTORY + LOG_FILENAME, backupCount=5)
  File "/usr/lib/python3.6/logging/handlers.py", line 150, in __init__
    BaseRotatingHandler.__init__(self, filename, mode, encoding, delay)
  File "/usr/lib/python3.6/logging/handlers.py", line 57, in __init__
    logging.FileHandler.__init__(self, filename, mode, encoding, delay)
  File "/usr/lib/python3.6/logging/__init__.py", line 1032, in __init__
    StreamHandler.__init__(self, self._open())
  File "/usr/lib/python3.6/logging/__init__.py", line 1061, in _open
    return open(self.baseFilename, self.mode, encoding=self.encoding)
FileNotFoundError: [Errno 2] No such file or directory: '/mike/winix-public-main/winix-02.log'

Is there in issue with my .yaml file? Here’s that:

# DEBUG    (and above)
# NOTSET   (and above)
debug_level: "INFO"
# mqtt server IP address string
mqtt: "192.168.1.40"
# base topic for status and commands
mqtt_topic: "winix"
# put empty string for no remote logging
rsyslog: ""
# period in minutes between checking status of each unit
check_interval: 5
# winix units, important values are "key" and "mac_address", remainder are currently just informational
units:
  "SB01" : {"home" : "My Home", "room" : "Bedroom",   "key" : "XXXXXX_xxxxxx", "mac_address" : "XX:XX:XX:XX:XX:XX", "ip_address" : "192.168.1.XX"}

(Xs added for security)

any thoughts?

The program tries to write errors to a log file, each time you start the program it rotates the log files so as keep the last five of them.

According to the error you showed, it is trying to store these files in the directory:

/mike/winix-public-main

but is not able to access this directory.

The directory where these files are stored and the YAML config file is stored is set in the program at this top, by this line:

WORKING_DIRECTORY = "/home/user/winix/"

adjust that to a directory that contains your winix-02.yaml file and that the program can write it’s log file to.

Everything is configured as described. It must be a permissions issue. I’ll keep at it.

I wrote a custom component for Winix based on Hunter’s library.

2 Likes

AMAZING This is what I’ve been looking for!

I’ve copied just the winix folder into custom_components, but the config.yaml changes I’ve made don’t recognize the component. I keep getting “Component error: winix - Integration ‘winix’ not found.” Anyone else having issues?

Yes. I got the same error.

I’m running hassio in docker. HA v0.118.0

Did you copy the sub-folder custom_components/winix from the repository into your local custom_components?

Restart HA regardless of the error. The GUI won’t restart because of the error, so I restarted my docker container instead. Once it started, it was working and detected.
Screenshot 2020-12-04 184829

1 Like

You’re right - I shutdown my HA virtual machine despite the error. It started right up without issue and I can now see the device. Thanks!

@kzaoaai - how did you get that awesome gui setup?

After installing the custom WINIX component, install denysdovhan’s custom Purifier Card (it’s available in HACS by default). Here is the configuration I used to match the presets to the C545 modes:

type: 'custom:purifier-card'
entity: fan.winix_XXXXXXXXXXX
show_name: true
show_state: true
show_toolbar: true
compact_view: false
stats:
  - attribute: filter_hour
    unit: Hrs
    subtitle: Filter Life
  - attribute: speed
    subtitle: Fan
  - attribute: plasma
    subtitle: Plasma
  - attribute: ambient_light
    unit: lx
    subtitle: Light
actions:
  - name: Sleep
    icon: 'mdi:weather-night'
    speed: sleep
  - name: Low
    icon: 'mdi:circle-slice-2'
    speed: low
  - name: Medium
    icon: 'mdi:circle-slice-4'
    speed: medium
  - name: High
    icon: 'mdi:circle-slice-6'
    speed: high
  - name: Turbo
    icon: 'mdi:circle-slice-8'
    speed: turbo
  - name: Auto
    icon: 'mdi:brightness-auto'
    speed: auto

2 Likes

thanks! That is really cool

This works with the Winix AM90 perfectly!

Tested successfully:

  • fan.set_speed: low, medium, high, turbo, sleep, auto
  • winix.plasmawave_off
  • winix.plasmawave_on

The only weirdness is the name of my city is misspelled in Location, which I"m assuming is Winix being weird.

Thank you!

AM90 seems to have the same specs as C545; I believe the latter is Costco specific brand.

Yes, the location seems to be some sort of abbreviation. Well at least that’s what I get.

I don’t mean to hijack the thread, but I’m very curious if anyone had any clues about this amazing plugin’s capabilities into Hubitat? I would be happy to collaborate! Thanks.

@jeanofthedead I need it in Hubitat too, and I am prepared to start over the next few weeks.

Thanks for posting your tips with regard to reboot and the Purifier Card. Worked like a charm!

One question: It seems as though I have full functionality, except I can’t toggle plasmawave on and off. The card reflects it’s state correctly, but I can’t turn it on and off from lovelace.

Any feedback on that? Maybe a better question for @leolite1