当前位置: 首页 > 软件库 > 其他开源 > 物联网 >

cmd4-AdvantageAir

授权协议 MIT License
开发语言 JavaScript
所属分类 其他开源、 物联网
软件类型 开源软件
地区 不详
投 递 者 池麒
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

cmd4-AdvantageAir

Formerly: cmd-E-Zone-MyAir

Catered shell scripts to integrate air conditioner control units by Advantage Air into Homekit using the plug-in homebridge-cmd4.

No affiliation with Advantage Air or any of their products.

Supported Control Units:

How It Looks:

Installation:

Raspbian/HOOBS:

  1. Install Homebridge.
  2. Install the homebridge-cmd4 plug-in through the Homebridge web UI or via terminal command:sudo npm install -g --unsafe-perm homebridge-cmd4. NOTE: you do not need to follow the extra installation steps on cmd4's page for this.
  3. For users with only One Constant Zone (single storey home), the script is the same for users with or without Temperature Sensors. For users with Two Constant Zones you will have to navigate through 'Old Scripts' directory to find your relevant scripts (there will be two scripts for these users); upgrading the Two Constant Zones scripts is on the To-Do List.
  4. Edit AdvAir.sh with the IP address of your Advantage Air controller. If you have two constant zones, then you will need to edit your IP Address and Constant Zones at the top of ezone.sh and zones.sh (you still need to use two scripts sorry!).
  5. Copy AdvAir.sh (or ezone.sh and zones.sh for Two Constant Zone Users) to a subdirectory of your .homebridge directory; e.g. .homebridge/Cmd4Scripts/AdvAir.sh. I suggest doing this from the web UI terminal (... top, right hand corner). Mine file is located in /home/pi/AdvAir.sh.
  6. OR if you are less savvy like me, you can create the script in your homedrive (type cd in your terminal and hit enter to get there) of your Raspberry Pi using sudo nano AdvAir.sh and pasting the contents inside, then saving. Its pathway in this case to be used in our config will be /home/pi/AdvAir.sh. For HOOBS users this would create your shell scripts at the lcation: /home/hoobs/.hoobs/AdvAir.sh.
  7. Install jq; sudo apt-get install jq. Make sure curl is installed (it should already be installed).
  8. Edit your homebridge config.json using the samples included in each directory for your appropriate setup; this should be completed from the Homebridge web UI. NOTE: Two devices cannot have the exact same name in your config. A switch and temperature sensor cannot both be named 'Kitchen' for example.
  9. Restart Homebridge.

macOS

  1. Install Homebridge.
  2. Install the homebridge-cmd4 plug-in through the Homebridge web UI or via terminal command:sudo npm install -g --unsafe-perm homebridge-cmd4. NOTE: you do not need to follow the extra installation steps on cmd4's page for this.
  3. For users with only One Constant Zone (single storey home), the script is the same for users with or without Temperature Sensors. For users with Two Constant Zones you will have to navigate through 'Old Scripts' directory to find your relevant scripts (there will be two scripts for these users); upgrading the Two Constant Zones scripts is on the To-Do List.
  4. Edit AdvAir.sh with the IP address of your Advantage Air controller. If you have two constant zones, then you will need to edit your IP Address and Constant Zones at the top of ezone.sh and zones.sh (you still need to use two scripts sorry!).
  5. Copy AdvAir.sh (or ezone.sh and zones.sh for Two Constant Zone Users) to a subdirectory of your .homebridge directory; e.g. .homebridge/Cmd4Scripts/AdvAir.sh. I suggest doing this from the macOS terminal like how you installed Homebridge. When I tested this on my wife's MacBook; mine was located in /Users/hername/AdvAir.sh.
  6. OR if you are less savvy like me, you can create the script in your homedrive (type cd in your terminal and hit enter to get there) of your MacBook using sudo nano AdvAir.sh and pasting the contents inside, then saving. Its pathway in this case to be used in our config will be /Users/hername/AdvAir.sh.
  7. Install jq; brew install jq (you may need to install brew first or you may use port).
  8. Install curl; brew install curl
  9. Edit your homebridge config.json using the samples included in each directory for your appropriate setup; this should be completed from the Homebridge web UI. NOTE: Two devices cannot have the exact same name in your config. A switch and temperature sensor cannot both be named 'Kitchen' for example.
  10. Restart Homebridge.

Windows 10

I have not successfully set this up on Windows 10 Homebridge server yet. If you have and want to contribute; please reach out and let me know how you did it. Otherwise I strongly suggest you buy a dedicated Raspberry Pi.

About:

Due to the current limitations in Homekit, multi-zoned ducted air conditioners are not represented as a single accessory. Our work around here is two create multiple accessories:

  • A Thermostat with modes OFF/HEAT/COOL using the Advantage Air 'constant' zone (usually zone 1 in a one 'constant zone' setup) as the measured temperature for feedback. NOTE: AUTO mode in Homekit is not used in Advantage Air controllers, so it will set the controller to OFF. Setting DRY mode from the controller will then represent in Homekit as OFF.
  • A simple Fan with modes OFF/ON (for the time being) for the controller's FAN mode. NOTE: Turning the Fan accessory on in Homekit will turn off the Thermostat accessory, and turning the Thermostat accessory on in homekit will turn off the Fan Accessory. When the Fan is turned on in Homekit, it will also execute the AUTO mode in the respective Advantage Air app; just to keep it simple for now.
  • Temperature Sensors with feedback from each zone. These also include the FAULT status in the accessory, this is determined by the error codes produced by the controller. NOTE: According to the Advantage Air developers there is only one fault code; which is used for low battery, dead battery and loss of connection to sensor. I could not get any further information about this and have only seen one fault myself.
  • A sample version of the config.json has been added for users who do not have the Temperature Sensors.
  • Versions of the shell scripts have been added for users who have two 'constant zones' (two storey house typically). According to Advantage Air only one constant zone has to be on at any time; some logic has been added to the shell scripts for two 'constant zones' to either shut off the zone or turn off the entire controller based on if the other 'constant zone' is open or not; to make sure your air conditioner and ducting are protected.
  • Switches with feedback to open and close each zone. NOTE: I do not recommend adding your 'constant zones' (usually zone 1, but there can be a second; represented as a 'C' in the app) as a Switch in Homekit as this zone is not meant to be turned off. I am not responsible for any damage to your ducting if you do manage to shut this zone (not sure it is possible, but just in case) and run the air conditioner.

How to Keep Up-To-Date:

As this is not a typical homebridge plug-in, you will not get prompted to update when I add improvements. The best way to keep up-to-date is to click the Watch button in the top right corner and select All Activity or Custom and then Releases. This will ensure you get an email everytime I push a new release with new features or improvements! Feel free to give me a Star as well if you are happy with the work.

How You Can Help:

  • Open Issues/Tickets.
  • Report Bugs/Errors.
  • Suggest Improvements and Features you would like to see!
  • Let me know if you have a Control Unit or App that works that is not confirmed in my Supported List!
  • Let me know if you can figure out how to get this running on Windows 10 Homebridge.
  • Feel free to let me know you are loving set up!

Further Notes:

  • I have only tested this on my own E-zone Advantage Air controller, but the API is exactly the same for MyAir and the named devices at the begining of this README; that is actually where I was able to get the commands and learn how to structure them properly. The API can be found here once you have registered.
  • I am not very savvy with all of this coding work and had a lot of help and direction as I 'learn as I go'; this was a learning curve for me but I plan to keep working on this and improving it.

Potential Device Limitations:

What we have discovered from over 8 months of trying to improve performance and reduce homebridge/cmd4 log warnings:

"The air conditioner controller returns successfully incomplete system data when it is in use by the operator and also incomplete system data if any 'Set' operation is in progress. The scripts that send/receive data from the air conditioner controller must not only retry on failures, but also check the validity of the data as the incomplete system data returned presents a successful return code. Even with these features built into the scripts, Cmd4 has implemented a queuing system such that any polling or queries from HomeKit would only send a setValue when no other operation was in progress. This feature in Cmd4 is the WoRM (Write once Read many) queue. While Cmd4 can then manage all traffic to the air conditioner controller, it cannot know if someone is actually interacting with the control tablet. When interacting with the control tablet and Cmd4 is trying to send/receive data simultaneously, errors are unavoidable. Cmd4 hides these unavoidable errors in debug mode as it retries the transaction and in this way presents a clean console that otherwise would cause panic to the operator." - John Talbot.

Special Thanks:

  1. The evolution, improvements and continuously tireless work of John Talbot, who has not only improved these shell scripts beyond measure; but continues to improve homebridge-cmd4 to further cater to this work and my end users.
  2. This would never have kicked off without the patience and kindness of TimofeyK helping out a new starter.
  3. Lastly, but certainly not least is my beautiful Wife who has put up with what has become an obsession of mine to get our air conditioner and many other devices into Homekit. May she forever be misunderstood by Siri for my amusement...

LICENSE:

See LICENSE

  • 防火墙重新加载配置firewall-cmd --reload 查看开放的端口 firewall-cmd --list-ports   nano /etc/sysconfig/iptables -A IN_public_allow -p tcp -m tcp --dport 9001 -m conntrack --ctstate NEW -j ACCEPT   nano /etc/firewalld

  • Traceback (most recent call last):   File "/usr/bin/firewall-cmd", line 24, in <module>     from gi.repository import GObject ImportError: No module named 'gi 已解决===》点击打开链接

  • centos7版本对防火墙进行加强,不再使用原来的iptables,启用firewalld 简单上手(以配置8080端口为例) 输入命令查看防火墙的状态 firewall-cmd --state; 如果没有开启,输入命令 systemctl start firewalld.service; 开启8080端口,输入: firewall-cmd --zone=public --add-port=8

  •  Centos6 使用的是iptables,Centos7 使用的是filewall(-cmd) iptables 用于过滤数据包,属于网络层防火墙。 firewall 能够允许哪些服务可用,那些端口可用...属于更高一层的防火墙。 1.firewalld的基本使用 启动:  systemctl start firewalld 查看状态:systemctl status firewalld  停止

  • 一、centos7版本对防火墙进行加强,不再使用原来的iptables,启用firewalld 1.firewalld的基本使用 启动: systemctl start firewalld 查状态:systemctl status firewalld 停止: systemctl disable firewalld 禁用: systemctl stop firewalld 在开机时启用一个服

  • 近期新上一个项目,环境是Centos7,以前的iptables的经验没用了。把firewalld研究了下,粗略记录一下把。 常用命令: firewall-cmd --reload firewall-cmd --complete-reload 和上面的意思差不多,但是不会维持当前连接信息。比如,用ssh22登陆,如果不小心把ssh 22关掉了,用reload不会把当前的连接杀死。但是用 --comp

  • 前言 centos防火墙根据系统大致有2种,一种是centos6时代的iptables;一种是centos7时代的firewalld; CentOS 7中防火墙是一个非常的强大的功能,在CentOS 6.5中在iptables防火墙中进行了升级了 本文讲解的是 CentOS 7中的 firewalld 一、rich-rule实现IP端口限制访问 1、添加规则 firewall-cmd --perm

  • 永久开放80端口号:firewall-cmd --permanent --zone=public --add-port=80/tcp 多端口: firewall-cmd --zone=public --add-port=80-90/tcp --permanent 移除80端口号:firewall-cmd --permanent --zone=public --remove-port=80/tcp

  • 端口转发的概念: 它是指当访问指定的ip+端口时,可以将流量转发至指定其他指定的ip+端口。端口转发操作必须启用区域的ip伪装功能,将私有网络的ip地址隐藏并映射到一个公有ip地址。 这是地址转换的一种形式,常用于路由。由于受内核限制,端口转发功能仅可用于 IPv4。 转发的目的ip和端口,可以是本机或其他主机,协议可以为TCP或UDP。当转发时不指定ip时,则默认为转发目的ip为本机ip。当转发

  • #限制某个ip访问 firewall-cmd --permanent --add-rich-rule='rule family=ipv4 source address="10.6.1.2" drop' #查看当前zones # firewall-cmd --get-active-zones    #显示当前开放端口 # firewall-cmd --zone=public --list-ports

  • 1、启用IP转发 vim /etc/sysctl.conf net.ipv4.ip_forward = 1 sysctl -p #命令生效 2、修改网卡的zone firewall-cmd --permanent --zone=external --change-interface=ens33(出口网卡) 3、设置IP地址伪装(SNAT) firewall-cmd --zone=external

  • 宽为限 紧用功 功夫到 滞塞通 firewall-cmd Linux上新用的防火墙软件,跟iptables差不多的工具。 补充说明 firewall-cmd 是 firewalld的字符界面管理工具,firewalld是centos7的一大特性,最大的好处有两个:支持动态更新,不用重启服务;第二个就是加入了防火墙的“zone”概念。 firewalld跟iptables比起来至少有两大好处: fi

  • Centos下安装vsftpd,用windows连接时出错如下信息: 500 OOPS: cannot change directory:/home/test 500 OOPS: priv_sock_get_cmd 远程主机关闭连接。 如图: 错误原因:对方服务器开启了selinux,导致连接被阻断的情况。 解决方法:1) 关闭selinux: #setenforce 0

  • 1.基础命令 ##查看帮助: firewall-cmd --help ##查看版本: firewall-cmd --version ##默认防火墙状态(关闭后显示notrunning,开启后显示running) firewall-cmd --state ##查看所有打开的端口: firewall-cmd --zone=public --list-ports ##查看防火墙规则(只显示/et

  • 输入 ~$ rosrun turtlesim 错误 Usage: rosrun [--prefix cmd] [--debug] PACKAGE EXECUTABLE [ARGS] rosrun will locate PACKAGE and try to find an executable named EXECUTABLE in the PACKAGE tree. If it f

  • 命令格式: firewall-cmd --permanent --remove-rich-rule '规则列表' firewall-cmd --permanent --remove-rich-rule 'rule family="ipv4" source address="0.0.0.0/0" forward-port port="8077" protocol="tcp" to-port="80"

  • Windows CMD 指令–遍历文件夹 遍历文件夹 在.bat中 $ $ 代表变量,在命令行 $中代表变量 遍历某路径下所有文件夹 for /R %i in (d:*)do echo %i>>a.txt 遍历文件夹中文件运行某程序 遍历某路径下所有文件写入txt for /f %i in (D:\qyj)do echo %i>>a.txt 遍历当前路径下所有文件运行程序 for /R %i in

  • 1、开放端口 firewall-cmd --zone=public --add-port=80/tcp --permanent 2、查看某端口是否开放 firewall-cmd --query-port=80/tcp 3、查看端口开启列表 firewall-cmd --list-port 4、重启防火墙 firewall-cmd --reload 5、关闭防火墙 systemctl st