node-red-crestron的使用教程
2021-12-05 本文已影响0人
Songzh
Node-RED is a programming tool for wiring together hardware devices, APIs and online services in new and interesting ways.
Node red Crestron is a plug-in of node red.
Through this plug-in, you can realize the conversion between many protocols on node red.
For example, mqtt, HTTP, TCP, UDP, RS485, RS232, KNX, BACnet, OPC, etc
In addition, you can also connect the device to homekit, Amazon Alex, google.xiaomi, etc
![](https://img.haomeiwen.com/i3246153/89d235acd14e07df.png)
Demo
node-red&Crestron&Husqvarna Automower
- install node-red in raspberry
Running on Raspberry Pi : Node-RED (nodered.org)
-
install node-red-crestron
image.png
![](https://img.haomeiwen.com/i3246153/a046e24bfc9601d1.png)
![](https://img.haomeiwen.com/i3246153/f5f86b30b868c699.png)
- Download Crestron module in GitHub and add it to Crestron SIMPL
songzh96/node-red-contrib-crestron: node-red-contrib-crestron (github.com)
image.png
- Register and obtain Husqvarna's agreement
Husqvarna Group Cloud - Developer Portal
![](https://img.haomeiwen.com/i3246153/bad4515fe3e07ad8.png)
- Programming in node-red
5.1 add an HTTP node and fill the URL of "https://api.amc.husqvarna.dev/v1+{your authorizations}+{function}"
image.png
5.2 request the data
image.png
5.3 Parse JSON data to get valid data
5.4 Send valid data to Crestron
add a Crestron Professor(need IP and Port)
image.png
![](https://img.haomeiwen.com/i3246153/a9385d33c2dad5c6.png)
5.5 Get Data from Crestron
![](https://img.haomeiwen.com/i3246153/d10c1600835bdc3b.png)
Summary
The implementation principle of this project is very simple. It mainly uses the node red programming platform to establish communication between Crestron and Automower.
Crestron - TCP - Node-red - Http - Automower