Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Insteon: Support FanLinc device #174

Closed
pork13 opened this issue Apr 30, 2013 · 17 comments
Closed

Insteon: Support FanLinc device #174

pork13 opened this issue Apr 30, 2013 · 17 comments

Comments

@pork13
Copy link

pork13 commented Apr 30, 2013

The FanLinc is a control device for ceiling fans. Messages to group (1) control the light, and group (2) are the fan. Documentation from smarthome is limited: http://www.smarthome.com/manuals/2475f.pdf

It looks like it supports the normal set of commands and flags, with certain on-levels corresponding to the various fan speeds.

@krkeegan
Copy link
Collaborator

In the interim, you may want to try setting this as a keypadlinc. The on_level for group (2) should control the fan speed.

@pork13
Copy link
Author

pork13 commented May 1, 2013

Good thinking, and that's what I tried initially, but got the same result I'm getting out of my new class, which is that attempting to set group two throws the "you need to make a surrogate" error. I didn't bother trying that, since the surrogate can really only be on or off. If I work around that and try to have mh set the level anyway, the program crashes outright.
I'll keep debugging and see if I can get it sorted.

@krkeegan
Copy link
Collaborator

krkeegan commented May 1, 2013

Ahh, yeah I forgot about that. OK, well this shouldn't be too tough to add as a new object

@krkeegan
Copy link
Collaborator

krkeegan commented May 1, 2013

One more idea. Try setting it up as a switchlinc like so:

INSTEON_SWITCHLINC, DE.AD.BE:01,  fan_light, All_Lights
INSTEON_SWITCHLINC, DE.AD.BE:02,  fan_fan,  All_Fans

@pork13
Copy link
Author

pork13 commented May 2, 2013

Well, it was worth a try, but nothing's ever that easy. ;)

For clarity, I will post my actual config:
INSTEON_SWITCHLINC, 21.e0.d1:01, Master_Light, All_Lights|Upper|Master,
INSTEON_SWITCHLINC, 21.e0.d1:02, Master_Fan, Fan|Upper|Master,

Controlling the light is no problem, but (same as my new object) attempts to control group 02 crash mh. There's nothing fancy in my object code.. it's pretty much a copy of switchlinc anyway.

Here's the log... looks clean, and no indication of why mh just dies. Whatever it is, it happens before any of the Insteon classes log anything. (The restart is manual).

05/01/2013 22:06:59 Running: Master Light on
05/01/2013 22:06:59 [Insteon::BaseObject] $Master_Light::set(on, $Master_Light_v)
05/01/2013 22:06:59 [Insteon::BaseObject] received command/state acknowledge from $Master_Light: on and data: ff
05/01/2013 22:07:05 Running: Master Fan on
05/01/2013 22:07:15 ---------- Restart ----------

@krkeegan
Copy link
Collaborator

krkeegan commented May 4, 2013

OK, a think I have a decent draft of support for FanLinc. It is here:
https://github.com/krkeegan/misterhouse/tree/insteon_fanlinc

It is based off of the pending i2_aldb branch, it may have a bug as to X10 devices, but should otherwise work fine.

If you have a chance, please test it out. The configuration is what you would expect:

INSTEON_FANLINC, DE.AD.BE:01, fan_linc_light, fan_linc_group
INSTEON_FANLINC, DE.AD.BE:02, fan_linc_fan, fan_linc_group

Setting the fan speed, requesting the fan status, linking to the PLM, and linking scenes all appear to be working for me, but I don't have a fanlinc, so I have to fake it a bit.

@pork13
Copy link
Author

pork13 commented May 7, 2013

Kevin (It's Kevin, right?): Getting close!
Firstly, thanks for taking a stab at this, it works better out of the box than the shot I'd taken locally.
The group 1 stuff (light) works precisely as expected:
05/06/2013 20:21:22 Running: Master Light on
05/06/2013 20:21:22 [Insteon::BaseObject] $Master_Light::set(on, $Master_Light_v)
05/06/2013 20:21:22 [Insteon::BaseObject] received command/state acknowledge from $Master_Light: on and data: ff
05/06/2013 20:22:01 Running: Master Light off
05/06/2013 20:22:01 [Insteon::BaseObject] $Master_Light::set(off, $Master_Light_v)
05/06/2013 20:22:01 [Insteon::BaseObject] received command/state acknowledge from $Master_Light: off and data: 00

Attempting to set the fan no longer crashes mh, but it just kinda does nothing (and the BaseObject returns a log of the light status):
05/06/2013 20:21:27 Running: Master Fan off
05/06/2013 20:21:27 [Insteon::FanLinc] $Master_Fan::set(off, $Master_Fan_v)
05/06/2013 20:21:28 [Insteon::FanLinc] received command/state acknowledge from $Master_Fan
05/06/2013 20:21:28 [Insteon::BaseObject] received command/state acknowledge from $Master_Light: on and data: 00
05/06/2013 20:21:45 Running: Master Fan on
05/06/2013 20:21:45 [Insteon::FanLinc] $Master_Fan::set(on, $Master_Fan_v)
05/06/2013 20:21:45 [Insteon::FanLinc] received command/state acknowledge from $Master_Fan
05/06/2013 20:21:45 [Insteon::BaseObject] received command/state acknowledge from $Master_Light: on and data: 00

Curiously, these are the PLM links in the FanLinc's link table, but I'll be damned if I can remember how I got them this way.

05/06/2013 20:27:35 [Insteon::AllLinkDatabase] [0x0fef] rspndr(02) record to $PLM (01): onlevel=off and ramp=none (d3:02)
05/06/2013 20:27:35 [Insteon::AllLinkDatabase] [0x0ff7] rspndr(01) record to $PLM (01): onlevel=100% and ramp=0.5s (d3:01)

@peloy
Copy link
Collaborator

peloy commented May 7, 2013

On 05/06/2013 08:31 PM, pork13 wrote:

Kevin (It's Kevin, right?): Getting close!
Firstly, thanks for taking a stab at this, it works better out of the
box than the shot I'd taken locally.
The group 1 stuff (light) works precisely as expected:
05/06/2013 20:21:22 Running: Master Light on
05/06/2013 20:21:22 [Insteon::BaseObject] $Master_Light::set(on,
$Master_Light_v)
05/06/2013 20:21:22 [Insteon::BaseObject] received command/state
acknowledge from $Master_Light: on and data: ff
05/06/2013 20:22:01 Running: Master Light off
05/06/2013 20:22:01 [Insteon::BaseObject] $Master_Light::set(off,
$Master_Light_v)
05/06/2013 20:22:01 [Insteon::BaseObject] received command/state
acknowledge from $Master_Light: off and data: 00

Attempting to set the fan no longer crashes mh, but it just kinda does
nothing (and the BaseObject returns a log of the /light/ status):
05/06/2013 20:21:27 Running: Master Fan off
05/06/2013 20:21:27 [Insteon::FanLinc] $Master_Fan::set(off, $Master_Fan_v)
05/06/2013 20:21:28 [Insteon::FanLinc] received command/state
acknowledge from $Master_Fan
05/06/2013 20:21:28 [Insteon::BaseObject] received command/state
acknowledge from $Master_Light: on and data: 00
05/06/2013 20:21:45 Running: Master Fan on
05/06/2013 20:21:45 [Insteon::FanLinc] $Master_Fan::set(on, $Master_Fan_v)
05/06/2013 20:21:45 [Insteon::FanLinc] received command/state
acknowledge from $Master_Fan
05/06/2013 20:21:45 [Insteon::BaseObject] received command/state
acknowledge from $Master_Light: on and data: 00

Curiously, these are the PLM links in the FanLinc's link table, but I'll
be damned if I can remember how I got them this way.

05/06/2013 20:27:35 [Insteon::AllLinkDatabase] [0x0fef] rspndr(02)
record to $PLM (01): onlevel=off and ramp=none (d3:02)
05/06/2013 20:27:35 [Insteon::AllLinkDatabase] [0x0ff7] rspndr(01)
record to $PLM (01): onlevel=100% and ramp=0.5s (d3:01)

You probably created these links manually, following the directions in
the FanLinc Quick Start Guide. The onlevel=off in the responder link for
the fan (group 02) looks suspicious.

What device are you using to control the fan? I think it would be
helpful (though Kevin might have a different suggestion) if you can
manually program the four speed (off, low, medium, high) and then scan
the link table of the fan to see what it looks like (plus scan the link
tables of the controllers).

Cheers,

Eloy Paris.-

@pork13
Copy link
Author

pork13 commented May 7, 2013

You're right, they were probably created manually because the FanLinc is an I2CS device and wouldn't play nice with the PLM until manually linked. And I must've linked it with the fan off. Trouble is that it's a pain to access the fanlinc now to fix that (would have to take the fan down).

Here's the full link table from the fanlinc. I can't scan the controller because it's a wireless remote (8-button).

05/07/2013 09:26:42 Running: Master Light log links
05/07/2013 09:26:42 [Insteon::AllLinkDatabase] Link table for $Master_Light health: good
05/07/2013 09:26:42 [Insteon::AllLinkDatabase] [0x0faf] is empty
05/07/2013 09:26:42 [Insteon::AllLinkDatabase] [0x0fb7] contlr(02) record to $PLM (01), (d1:ff, d2:00, d3:00)
05/07/2013 09:26:42 [Insteon::AllLinkDatabase] [0x0fbf] contlr(01) record to $PLM (01), (d1:ff, d2:00, d3:00)
05/07/2013 09:26:42 [Insteon::AllLinkDatabase] [0x0fc7] rspndr(01) record to $Master_Light_Slave (01): onlevel=100% and ramp=0.5s (d3:01)
05/07/2013 09:26:42 [Insteon::AllLinkDatabase] [0x0fcf] rspndr(02) record to $rmt_btn_B (03): onlevel=on and ramp=none (d3:02)
05/07/2013 09:26:42 [Insteon::AllLinkDatabase] [0x0fd7] rspndr(02) record to $rmt_btn_B (06): onlevel=on and ramp=none (d3:02)
05/07/2013 09:26:42 [Insteon::AllLinkDatabase] [0x0fdf] rspndr(02) record to $rmt_btn_B (04): onlevel=on and ramp=none (d3:02)
05/07/2013 09:26:42 [Insteon::AllLinkDatabase] [0x0fe7] rspndr(01) record to $rmt_btn_B (01): onlevel=100% and ramp=0.5s (d3:01)
05/07/2013 09:26:42 [Insteon::AllLinkDatabase] [0x0fef] rspndr(02) record to $PLM (01): onlevel=off and ramp=none (d3:02)
05/07/2013 09:26:42 [Insteon::AllLinkDatabase] [0x0ff7] rspndr(01) record to $PLM (01): onlevel=100% and ramp=0.5s (d3:01)
05/07/2013 09:26:42 [Insteon::AllLinkDatabase] [0x0fff] rspndr(01) record to $rmt_btn_B (08): onlevel=100% and ramp=0.5s (d3:01)

@peloy
Copy link
Collaborator

peloy commented May 7, 2013

On 05/07/2013 09:30 AM, pork13 wrote:

Trouble is that it's a
pain to access the fanlinc now to fix that (would have to take the fan
down).

Tell me about it... I went through a similar experience with a fan over
the weekend, but it was an In-LineLinc, not a FanLinc.

Here's the full link table from the fanlinc. I can't scan the controller
because it's a wireless remote (8-button).

[...]

Can you control the fan just fine with the remote? I am not sure but for
the PLM to control the fan like the remote does I would think that links
similar to the ones for the remote are necessary for the PLM. I am not
very sure about this, nor how to create those links, though.

Cheers,

Eloy Paris.-

@krkeegan
Copy link
Collaborator

krkeegan commented May 7, 2013

Kevin (It's Kevin, right?): Getting close!
Yup, its Kevin. Cool.

The group 1 stuff (light) works precisely as expected:
Good.

Attempting to set the fan no longer crashes mh, but it just kinda does nothing (and the BaseObject returns a log of the light status):
05/06/2013 20:21:27 Running: Master Fan off
05/06/2013 20:21:27 [Insteon::FanLinc] $Master_Fan::set(off, $Master_Fan_v)
05/06/2013 20:21:28 [Insteon::FanLinc] received command/state acknowledge from $Master_Fan
05/06/2013 20:21:28 [Insteon::BaseObject] received command/state acknowledge from $Master_Light: on and data: 00

That log "looks" right. Don't worry about that last line, because of the way i hijacked the routines in MH, you will continue to get that log printout from the BaseObject which references the light. The BaseObject uses the device ID to identify the light, but doesn't realize that the message comes from a different "group"

However the fact that "data: 00" is contained in that message leads me to believe I have an error in the code, it should read ff. If you can and if you want to, try setting the on level to a percentage, like "80%" i would hope that would work.

05/06/2013 20:27:35 [Insteon::AllLinkDatabase] [0x0fef] rspndr(02) record to $PLM (01): onlevel=off and ramp=none (d3:02)
05/06/2013 20:27:35 [Insteon::AllLinkDatabase] [0x0ff7] rspndr(01) record to $PLM (01): onlevel=100% and ramp=0.5s (d3:01)

Those are fine, the don't really do anything since PLM group 01 is not used, but for i2cs devices, links like those are very common and MH will just let them be.

MH generally doesn't control a device using a link, rather it sends a direct command to the device, which is how you are able to dim a light to a level that was not previously defined.

However, you are missing 2 control links on the device. They would "control" the PLM. These links would cause the device to notify MH if you ever manually changed the device state. But since the only way to control the device is with a remote this doesn't matter much. But you would want to make sure that the links for the remote are defined in MH and that the PLM is linked to the remote so that MH will know the state of the fan when you use the remote.

The remote can be put into linking mode by holding the set button until it beeps. It should stay in that state for a minute or more. During that time, MH can communicate directly with the remote.

@pork13
Copy link
Author

pork13 commented May 7, 2013

Yes, works just fine with the remote. The links in the PLM just need to be addressed to group (02) on the fanlinc, but there's no way to do that at present. That's an mh problem, because it doesn't like creating links to anything but group 1 on devices. That seems to be fundamentally built in, and might be related to having to make surrogates to control the lights on a KPL. Direct commands to anything but group 1 seem to be taboo.

@krkeegan
Copy link
Collaborator

krkeegan commented May 7, 2013

I don't think they are taboo, there just are not very many items that have such things. But MH will properly create group links for KeypadLincs, Remotelincs, IOLincs (at least the draft version i have).

But again, when controlling devices, MH generally does not use links. Instead it sends a direct command to the device. The only time links are used by MH to control a device is when you create and use a PLM Scene.

If you want to create a PLM Scene, you could do so as follows

INSTEON_ICONTROLLER, 10, master_scene, all_scenes
SCENE_MEMBER, Master_Light, master_scene
SCENE_MEMBER, Master_Fan, master_scene, 50%

That would create a "master_scene" that when turned on would turn on the light to 100% and the fan to 50%. (Although the fan only appears to have 3 speeds, so it likely results in the medium speed). This would create links in the PLM addressed to group (02).

However, this would not solve your issue of selecting "on" for the Master_Fan without anything happening. That looks like it may be an issue with the code.

@krkeegan
Copy link
Collaborator

krkeegan commented May 8, 2013

Ok, I fixed the bug, the code should work fine now.

@pork13
Copy link
Author

pork13 commented May 8, 2013

Looks like it works with the live device, but I am not at home to physically look at the fan. I will check it out tonight!

@krkeegan
Copy link
Collaborator

Is this still working out for you?  Any issues?

@pork13
Copy link
Author

pork13 commented May 17, 2013

Oops. Forgot that I hadn't followed up. Yes, this works and has been great!

@pork13 pork13 closed this as completed May 17, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants