A few weeks back I also did some research and testen with the java apk.
Now I have written a simple decoder and encoder for the WF-RAC module.
(the encoder is based on yours)
The above wf-rac responses and encoded code of yours did help me create a simple python method for receiving and sending successfully data to the Airco.
Now i’m trying to make a integration for it but have little time at the moment.
This is great! Awesome!
I really like your structured approach of the program. And I like your elegant solution of setting the correct bits in the encoder.
When I have time I will try to have a look at the discovery method of the WF-RAC.
Oh man, I came across this post like two weeks ago, have been hacking away on python code on and off since then, and only just came back to find so much more activity than I expected! So awesome.
Re: the discovery, it’s pretty easy using the python ‘zeroconf’ module. This prints out the details of all my aircon devices:
def find_devices(timeout=2.0):
from zeroconf import Zeroconf, ServiceStateChange, ServiceBrowser
from typing import cast
def on_service_state_change(
zeroconf: Zeroconf, service_type: str, name: str, state_change: ServiceStateChange
) -> None:
if state_change is ServiceStateChange.Added:
info = zc.get_service_info(service_type, name)
if info:
addrs = ["%s:%d" % (addr, cast(int, info.port)) for addr in info.parsed_scoped_addresses()]
print(f"Server: {info.server}")
print("Weight: %d, priority: %d" % (info.weight, info.priority))
print("Addresses: %s" % (' '.join(addrs)))
print()
zc = Zeroconf()
browser = ServiceBrowser(zc, ['_beaver._tcp.local.'], handlers=[on_service_state_change])
until = time.time() + timeout
try:
while time.time() < until:
time.sleep(0.1)
finally:
zc.close()
I’m gonna try to find some time to get my current hacky script up on github in case it’s useful to others…
@jeatheak, both of our functions seem to contain distinct errors.
I have displayed the integer values for the base64 decoded command strings below.
The iOS app seems to add a value to the 2nd byte. I do not understand why this is happening when reading the Android decompiled code…
@awesomerob, this is great! I was planning on having a look at this today, but you already did
Perhaps we should look into working from a common repository, for example from jeatheak’s, since he seems to know how to write code.
Ok that’s weird. I also cannot find what the 2nd byte is doing. (mayby something with the atHomePressence)
Mayby I have this evening some time to look into it.
But the Airco at my home is accepting the values even without that byte so I hope it isn’t doing anything important
@mcheijink I Also added you as collaborator in my github repo @awesomerob Do you have your github username for me? than I can add you also as collaborator.
I did make a new branch on the repo to start with the hassio integration but I have never make one so it will be a challenge
My units are now ready to be used. So to me it is a brand new system.
If i can help with anything except for coding (Don’t have coding knowledge) let me know.
This is awesome. I’m about to install AC units in my home and I want Mitsubishi Heavy because I’m technically familiar with them. Something not working properly in HA is a major deal breaker for me these days so I’m hoping you guys can pull it off so I won’t have to resort to hacky solutions.
I’ve just installed a Mitsubishi AC unit (with WF-RAC of course) and I was very happy to find this thread because I would like to add it to my HA (I don’t like having a lot of apps and making it work within HA is… cool!).
Hi all,
I think we are going in the right direction with the interfacing from Python to the WF-RAC.
Does anyone that offered help, have experience with the integration in Home Assistant? That is where we could really use some help
At the moment I’m busy learning to make an integration of it but it is a lot of work and learning. And my son was born so at the moment i have little time to look into it.
I will try to work on it soon
Locally I have a simple integration running that reads the temperature only but can’t get the climate to work.
@Savage007 That code has no integration added. He only forked the code and made a loop in the code that runs seperatly from Homeassistent to reset his devices to certain settings. (the custom_component folder was already added in the feature branch I created)