Mqtt » History » Version 7
Frédéric Blanc, 2020-01-17 13:40
1 | 1 | Frédéric Blanc | h1. Mqtt |
---|---|---|---|
2 | |||
3 | 6 | Frédéric Blanc | h2. Controleur Mqtt |
4 | |||
5 | 1 | Frédéric Blanc | !mqtt001.png! |
6 | 2 | Frédéric Blanc | |
7 | Controller Subscribe: |
||
8 | 3 | Frédéric Blanc | |
9 | <pre><code> |
||
10 | 4 | Frédéric Blanc | %sysname%/+/+/set |
11 | </code></pre> |
||
12 | |||
13 | Controller Publish: |
||
14 | |||
15 | <pre><code> |
||
16 | %sysname%/%tskname%/%valname% |
||
17 | </code></pre> |
||
18 | |||
19 | Controller LWT Topic: |
||
20 | |||
21 | <pre><code> |
||
22 | %sysname%/$state |
||
23 | 3 | Frédéric Blanc | </code></pre> |
24 | 5 | Frédéric Blanc | |
25 | 6 | Frédéric Blanc | h2. publication directement par le device |
26 | |||
27 | !mqtt003.png! |
||
28 | |||
29 | Dans le device cocher la case Send to Controller |
||
30 | 7 | Frédéric Blanc | |
31 | 5 | Frédéric Blanc | h2. publication par les règles en json |
32 | |||
33 | !mqtt002.png! |
||
34 | |||
35 | |||
36 | <pre><code> |
||
37 | On System#Boot do |
||
38 | Publish fb/%sysname%/IP,%ip% |
||
39 | timerSet,1,60 |
||
40 | endon |
||
41 | |||
42 | On Rules#Timer=1 do |
||
43 | Publish fb/%sysname%/json,'{"rssi":%rssi%,"temp65CF":[temp65CF#Temperature]}' |
||
44 | timerSet,1,60 |
||
45 | endon |
||
46 | </code></pre> |