Smart Air Conditioning Control With ThingsBoard

Automating Climate Control: Leveraging Dual Thermometers for Smart Air Conditioning via ThingsBoard

记录一次在thingsboard中通过同时满足两个温度计的温度条件来控制空调开关机
当然这并不是真实过程对接调式,只是通过模拟的方法来熟练一下thingsboard的ruleChain

第一步,创建一个空的规则链,名称就叫两个温度计控制空调的规则链

img_2.png

第二步,创建一个设备配置,名称就叫两个温度计控制空调的设备配置

img_3.png

第三步,分别添加三个设备温度计1温度计2空调

img_4.png

第四步,给温度计1,温度计2 设备添加关联关系

添加关系的原因是,因为温度计1,温度计2 的温度都满足了条件需要给空调发送rpc控制消息 才需创建关联空调的,这里可以理解是温度计控制空调,所以创建温度计向外的关联from)的关系 同理也可以理解,空调需要接受温度计的控制消息向内的关联to)的关系,这两个关系方向都可以 这里以from关系为例创建,但请注意,这里的关系类型一定要唯一,不能一样我这里建立了两条关系分别是relation1, relation2 img.png

Read more →

Record an Error During Node RED Deployment

记一次在docker 打包部署node red 启动报错

报错如下:

---------------------------------------------------------------------
Your flow credentials file is encrypted using a system-generated key.

If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.

You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.
---------------------------------------------------------------------

22 Feb 20:47:25 - [warn] Encrypted credentials not found
22 Feb 20:47:25 - [info] Server now running at http://127.0.0.1:3002/
22 Feb 20:47:25 - [info] Starting flows
22 Feb 20:47:25 - [info] Started flows

22 Feb 20:47:35 - [warn] Flushing file /data/nodes to disk failed : Error: EISDIR: illegal operation on a directory, rename '/data/nodes.$$$' -> '/data/nodes'
22 Feb 20:47:35 - [warn] Error saving flows: EISDIR: illegal operation on a directory, rename '/data/nodes.$$$' -> '/data/nodes'
22 Feb 20:47:35 - [warn] Error: EISDIR: illegal operation on a directory, rename '/data/nodes.$$$' -> '/data/nodes'

PM2启动信息

使用如下PM2配置文件启动Node-RED实例:

Read more →