Support for Modern Forms Ceiling Fan Control

Thanks! I was able to get the rule setup with motion and have it working for our Patio. This is what I ended up doing for the fan during the day:

At night I have another rule setup for the lights since I was able to connect the fan receiver light wires to some recessed lights I installed!

Hi,

I just implemented this, but not having much luck. I installed driver code, added virtual device, selected modern form as device type, then added the fan IP addess.

But cant turn it on or off (fan or light).

How can I troubleshoot this?

Thank you

This is what I see in logs, FYI

dev:7472020-06-09 05:23:06.695 pm errorgroovy.lang.MissingMethodException: No signature of method: user_driver_gjunky_Simple_Form_Fan_738.checkHttpResponse() is applicable for argument types: (org.codehaus.groovy.runtime.GStringImpl, groovyx.net.http.HttpResponseDecorator) values: [error in lightOn, groovyx.net.http.HttpResponseDecorator@109cf50] on line 71 (LightOff)

dev:7472020-06-09 05:23:06.653 pm debugsomething went wrong: groovyx.net.http.ResponseParseException: Server Error

dev:7472020-06-09 05:23:06.550 pm debugparams: [uri:http://192.168.7.251, path:/mf, contentType:application/json, headers:[something:abc], body:{'lightOn' : false}]

dev:7472020-06-09 05:23:06.546 pm infoFan IP : 192.168.7.251, command: lightOn, commandValue: false

Hi Sal,

Can you control the fan from the ModernForms app? I noticed in your info above and an email I received that the IP addresses are different. It might be they updated something in the software as well. I don't update my Fans so I might not have seen that if that is the case.
Another question: Are you using the combined fan+light driver or one of the separate ones?

Update: I made sure I was on the latest firmware and apparently I am.

Hi,

thanks for your reply.

yes I can control the fan and light from the MF app.

The IP was different in APP because had it changed, was part of my testing - I had it changed, then updated HE.

The firmware version reported on the app is 02.00.0007 / 02.06.0000

What version are you on?

From logs it does seem it is getting to the fan, because when I change the IP but didnt update HE with the new IP instead of the pasted error from previous post, I would rightfully get a timeout.

Not sure how I can test this out to see what the fan responds with, can I replicate this from a command line on my computer to the fan? I use mac and windows. At least to see what the response the fan comes with, which may point in some direction. I dont know if that is a proper approach,

Any pointers would help, and thank you!

Hi Sal,

It looks like you might have a newer Fan with newer firmware. Mine, now about a year old, are running version 1.xx.xx firmware even though it shows they are on the last one. It looks like Modern Forms updated their (non-published) API. Unfortunately, until I get access to a new fan with new firmware, it might be hard to find out what they changed (unlikely for me to get a new fan). I will try to contact them for more information but they have not been very forthcoming in the past.

Understood, thanks. I'll use it from ST. I was hoping to get rid of ST.

So I just spoke to MF and Hubitat is now on their roadmap, Theres no timelime, but its on their roadmap!

1 Like

That is pretty fantastic. I would still prefer they publish their API and actually work to get it supported as a hubitat device.

It would also be nice if we could do the fan registration without getting it connected to the cloud.

But Modern Forms supporting this in Hubitat would be nice.

Sal: not sure if you do any programming but I could work with you to see what your fan is looking for in the calls I am making. Just need to debug it with you on your end.

I Agree. I dont know why they are against publishing API.

Thats said, I would be happy to help. I am a network engineer, not a developer so dont know how I can help. if its something I can follow instructions with I would be willing to try, I work in mac primarily but also have windows if needed, and could always give you teamviewer if you want to see on your own,

Sal

Thanks @1info for sharing your device driver for Modern Forms fans. We have an outside fan that I am now able to control via Hubitat, and it's pretty awesome.

However, I just bought a Modern Forms fan for the inside, and it appears it doesn't like to be controlled the same way. Sharing info from the logs, here is what it looks like when I switch on the outside fan:

dev:24652020-08-16 15:15:31.820 debugShow Status: [clientId:MF_C89346844FA7, lightOn:false, fanOn:true, lightBrightness:99, fanSpeed:2, fanDirection:forward, rfPairModeActive:false, resetRfPairList:false, factoryReset:false, awayModeEnabled:false, fanSleepTimer:0, lightSleepTimer:0, decommission:false, schedule:, adaptiveLearning:false]
dev:24652020-08-16 15:15:31.803 debugresponse contentType: application/json
dev:24652020-08-16 15:15:31.798 debugresp.data: [clientId:MF_C89346844FA7, lightOn:false, fanOn:true, lightBrightness:99, fanSpeed:2, fanDirection:forward, rfPairModeActive:false, resetRfPairList:false, factoryReset:false, awayModeEnabled:false, fanSleepTimer:0, lightSleepTimer:0, decommission:false, schedule:, adaptiveLearning:false]
dev:24652020-08-16 15:15:31.775 debugContent-Length : 310
dev:24652020-08-16 15:15:31.771 debugContent-Type : application/json
dev:24652020-08-16 15:15:31.490 debugparams: [uri:http://10.9.0.111, path:/mf, contentType:application/json, headers:[something:abc], body:{'fanOn' : true}]
dev:24652020-08-16 15:15:31.479 infoFan IP : 10.9.0.111, command: fanOn, commandValue: true
dev:24652020-08-16 15:15:31.473 debug------- in sendCommand --------
dev:24652020-08-16 15:15:31.459 debugSending Fan On Command

In comparison, I get an error in the logs when attempting to switch on the inside fan:

dev:25932020-08-16 15:20:30.299 errorgroovy.lang.MissingMethodException: No signature of method: user_driver_gjunky_Modern_Form_Fan_705.checkHttpResponse() is applicable for argument types: (org.codehaus.groovy.runtime.GStringImpl, groovyx.net.http.HttpResponseDecorator) values: [error in fanOn, groovyx.net.http.HttpResponseDecorator@a39fe7] on line 71 (FanOn)
dev:25932020-08-16 15:20:29.295 debugsomething went wrong: groovyx.net.http.ResponseParseException: Server Error
dev:25932020-08-16 15:20:29.097 debugparams: [uri:http://10.9.0.127, path:/mf, contentType:application/json, headers:[something:abc], body:{'fanOn' : true}]
dev:25932020-08-16 15:20:29.088 infoFan IP : 10.9.0.127, command: fanOn, commandValue: true
dev:25932020-08-16 15:20:29.083 debug------- in sendCommand --------
dev:25932020-08-16 15:20:29.078 debugSending Fan On Command

The error is probably related to the firmware version: the outside fan is running firmware 01.03.0021. The inside fan is on 02.00.0009.

It looks like they changed the access methods for the newer fans and I don't have access to one of these. I will take a look at the log later on and see if I can figure out what it is looking for. No promises

OK I got one of my fans set up as a virtual device with the Fan Only driver. Trying to get control of the fan in Rule Machine. While I can turn the fan off and on with the speed control setting using On or OFF, I am not having any luck getting the fan states into a condition. Everything I try returns a (null). Any help on what I should be picking to test whether the fan is already running or not?

Thanks

Maybe you can fool it with a virtual device? Iā€™m having to do that for my ZEN30 fan switch for now.

Thanks. But it's already a virtual device based on the Modern Forms Driver discussed here. For some reason I don't seem to be able to expose the attributes in rule conditions. I have been trying every combination I can come up with and they all show (null) when in the conditions section of RM. I however can turn the fans ON and OFF and change speeds with a rule. Just can not direct flow of rule based on conditions.
@1info any thoughts?

The way the fan is and the way the driver is written, it only gets the current state of the fan if you send it a command. This can either be a change in settings or a request to get the status. I haven't tried it yet but that is probably why you can't seem to access them in the RM

BTW: If anyone wants to let me borrow a V2 of the WiFi control unit from one of the newer fans, I will try to see if I can get those working (and then send it back of course). I also reached out to Modern Forms again to see if I can get more information about their software changes and/or a new controller.

V2 appears to be quote sensitive: replace body: "{'$command' : $commandValue}" with body: "{\"$command\" : $commandValue}" and also fix sendCommand("fanDirection", "\"$direction\"")
fanSleepTimer (etc.) is now fanTimer in v2.

Hi jhaustin,

Thank you for the information!

I uploaded a V2 version of the Fan driver
https://github.com/gjunky/hubitat-ModernForms/blob/master/drivers/ModernFormsFan_V2.groovy

Can you please give this a try? I changed the nesting of the single and double quotes (nesting double quotes inside double quotes is not allowed). I have no way to try this but if this one works I can create an updated versions, perhaps even make it so it works on both V1 and V2.

Hi 1info, thanks for the code push. I was using escaped double quotes \" and that works fine.

I should be able to test your code soon, but it looks mostly OK at first diff ā€” the exception is that lightSleepTimer should also be lightTimer (like fanTimer).

Likely unrelated, I seem to have crashed the controller by using automation rules ā€” for example, I have a trigger to turn the fan on and off (using Rule Machine). However, there appears to be no way to determine (in a condition) whether a fan is actually running or not ā€” capability "FanControl" does not provide a status. I may need to use some other virtual switch to store the fan status. Do you know of any way to provide this via the driver capability?

Thank you.
lightSleepTimer changed to lightTimer