MatthewIsHere / homebridge-bigassfans-old

Homebridge plugin for BigAssFan fans
Apache License 2.0
0 stars 1 forks source link

Not working... #1

Open merv2k4 opened 3 years ago

merv2k4 commented 3 years ago

Hi,

I tried this plugin and the other plugin.

It does not work. It is initialized but it is not doing anything. Hope you can assist. It was working previously then i had to reinstall it cos its suddenly not working. I have two haiku ceiling fans that need to be added in homebridge. I have no idea why it suddenly stopped working. I tried using an old version of homebridge as well.

  {
        "platform": "BigAssFans",
        "plugin_map": {
            "plugin_name": "homebridge-big-ass-fans"
        },
        "fan_count": 2
    },

I also tried using config from accessories portion. But i am getting error below.

    {
        "accessory": "BigAssFan",
        "name": "Living Room BAF",
        "fan_name": "Living Room",
        "light_exists": false,
        "fan_ip_address": "192.168.100.x",
        "fan_id": "20:F8:5E:41:xx:xx"
    }

[BigAssFan] Initializing BigAssFan accessory... [7/9/2021, 1:49:46 AM] [BigAssFan] No light exists for: BigAssFan Fan Light [7/9/2021, 1:49:46 AM] TypeError: existingAccessory.getService is not a function at new BigAssFanAccessory (/homebridge/node_modules/@miblanchard/homebridge-big-ass-fans/index.js:277:42) at /usr/local/lib/node_modules/homebridge/src/server.ts:350:50 at Array.forEach () at Server.loadAccessories (/usr/local/lib/node_modules/homebridge/src/server.t

MatthewIsHere commented 3 years ago

Hey, thanks for letting me know.

The configuration and errors you showed me don't look like anything I have come across. Could it be possible that you are using another plugin? I know there is one that has a very similar name to mine. Your log files show "[BigAssFan]" as the plugin, but the plugin name should be "[BigAssFans]"

My plugin isn't perfect, but it offers the basic haiku functions. I'm currently working on redoing the backend fan api that the homebridge plugin uses, which should be done in a few weeks.

I use this plugin everyday, so if you want any changes or would like to suggest something then let me know!

Thanks, Matthew Lyon

merv2k4 commented 3 years ago

Thanks For getting back Matthew. Sorry for the mixup, i have tried all the plugins and so far none works. How do i add the fans from the plugin?

currrently this is inside the config by default but seems it is not discovering or trying to discover the fans image

This is from the log area image

MatthewIsHere commented 3 years ago

It may be that your system or firewall is blocking incoming connections for udp port 31415. Even though all of the connections are outbound, firewalls won't let in responses to broadcast packets. The initial fan discovery requires port 31415 to allow incoming connections.

The log line that says something similar to "Outgoing: ALL;DEVICE;ID;GET => (broadcast address)" was output by the plugin. This line shows that the plugin attempted to search for any fans on its network. When it works, you will see any response from any fan show up in the logs. You will know when it works because the logs will be flooded with fan chatter. Once you get your fans working, it will probably be useful to turn that logTraffic function off.

So right now the fan responses are being blocked by your computer, are not getting there at all, or both.

One problem that I have had numerous times is that the fans just won't respond to a certain MAC address for some reason. I'm not sure what the problem is, but I'm guessing it has something to do with ARP. This is probably not your case, but it is a weird issue I have found with my fans. Cutting off the fan's power for a couple seconds fixed it every time. You probably don't have to worry about this as I believe it was because of me testing the fans so much.

I realize that I need to start maintaining this plugin as more and more people use it. I will start writing documentation tomorrow.

Best of luck, Matthew Lyon

merv2k4 commented 3 years ago

Oh i see, Im kinda using a container to run homebridge. Is the listening port fixed to 31415? That means homebridge should be listening to udp port 31415? Thanks Matthew, will check if container is not opened to listen to 31415

merv2k4 commented 3 years ago

Hi Matthew,

The fans and this homebridge is actually on the same subnet.

I have run this in the homebridge seems the port is listening to it and there is no firewall in between homebridge and the fans. (as im running multiple homebridge instances with other plugins. So far only this is not working)

Is there any ways to add fans manually in the plugin instead of auto discovery? I have the fan detail such as the IP/Mac address.

Also both my fans are having same model/Series, which is haiku I-Series. This is supported right?

/homebridge # netstat -l
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 127.0.0.11:34727 0.0.0.0: LISTEN
tcp 0 0 0.0.0.0:8581 0.0.0.0:
LISTEN
tcp 0 0 :::53286 ::: LISTEN
udp 0 0 0.0.0.0:mdns 0.0.0.0:

udp 0 0 0.0.0.0:mdns 0.0.0.0:
udp 0 0 127.0.0.11:35168 0.0.0.0:

udp 0 0 0.0.0.0:31415 0.0.0.0:*

MatthewIsHere commented 3 years ago

In the current state of the plugin, I don't have a way to manually add fans. however, the backend library does have a way to manually add a fan to the controller. I believe I could allow that manual fan info to be passed down to the controller from the configuration. I will try and add a rough version of that in in the next few days.

Right now the plugin only attempts to scan once at start for fans (something which I'm changing in the next update), so you will have to restart homebridge to check for fans again.

Matthew

merv2k4 commented 3 years ago

Okay thanks Matthew! I think i might have to wait for the manually adding of the fan cos even when restart, it is not detecting any fan. Hope 2 fans can be added without any problems

The app should support haiku I-Series right?

MatthewIsHere commented 3 years ago

Well, i have some bad news. The huge industrial fans and the I6 series fans from bigassfans don't use the same communication protocol that I have implemented in the plugin. I have had another person contact me about that, and I believe he started work on a fan plugin for the I6 series fans. I will link his GitHub when I find it.

The only fans I have are the Haiku and the Haiku-L series fans. I don't think there is an Haiku "I" series. Testing those I6 fans is out of my abilities until I can get my hands on one.

MatthewIsHere commented 3 years ago

https://github.com/oogje/homebridge-i6-bigAssFans

This plugin was made by someone who reached out to me about I6 compatability, and they made a version of their own. It's very well documented and if mine doesn't work, then his probably will.

Matthew

merv2k4 commented 3 years ago

This is quite wierd im using ythe Haiku I series as from this link. I think its different from I6 model from baf. It shd br having the same senseme technology with L series

https://www.haiku.com.sg/composite

merv2k4 commented 3 years ago

https://github.com/oogje/homebridge-i6-bigAssFans

This plugin was made by someone who reached out to me about I6 compatability, and they made a version of their own. It's very well documented and if mine doesn't work, then his probably will.

Matthew

Thanks matthew i think i tried this as well. I manually added the fans in but the functionality of the fans didnt work (it went to not responding state) . I think I6 and I series is different

MatthewIsHere commented 3 years ago

that is interesting, Ive never heard of that website, or the company Phylux. I will look into them more.

As for now, the only thing i can suggest would be to debug the fans straight from the command line. Turn on promiscuous mode for your network adapter. I use debian linux, so these commands may be a little different for you. first, I setup tcpdump to monitor all the network traffic. 'sudo tcpdump -A port 31415' From another shell, i ran 'echo "<ALL;DEVICE;ID;GET>" | nc -w 0 -u -b 255.255.255.255 31415'. Tcpdump should output a response packet from each of your fans, if they use the same messaging protocol as Haiku.

My tcpdump output look like this after the echo command: `tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth0, link-type EN10MB (Ethernet), capture size 262144 bytes 06:51:28.554426 IP 10.1.0.43.42451 > 255.255.255.255.31415: UDP, length 20 E..0..@.@.1

..+......z... X<ALL;DEVICE;ID;GET>

06:51:28.569281 IP 10.1.0.6.31415 > 10.1.0.43.42451: UDP, length 66 E..^.?..... ... ..+z....J%.(Master Bedroom Fan;DEVICE;ID;(RedactedMAC);FAN,HAIKU,HSERIES) 06:51:28.637890 IP 10.1.0.9.31415 > 10.1.0.43.42451: UDP, length 55 E..Si......p .. ..+z....?..(Bedroom One Fan;DEVICE;ID;(RedactedMAC);FAN,LSERIES) 06:51:28.641976 IP 10.1.0.8.31415 > 10.1.0.43.42451: UDP, length 52 E..Pc....... ... ..+z....<..(Bedroom Two Fan;DEVICE;ID;(RedactedMAC);FAN,LSERIES) `

merv2k4 commented 3 years ago

Thanks for getting back matthew,

i tried tcpdump but i cannot get any data from my fans' ip address. hopefully is correct below. this is from the server the ip is from one of the fan

image

i believe if i can add it in manually it should work if there is no error in the code. can we try that when you're able to do it? I think the is maybe the fan stopped sending broadcast packets, tcpdump not showing any packets from the fan even on the same network as the server.

Thanks!