Mqtt » History » Version 6
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 | 5 | Frédéric Blanc | h2. publication par les règles en json |
31 | |||
32 | !mqtt002.png! |
||
33 | |||
34 | |||
35 | <pre><code> |
||
36 | On System#Boot do |
||
37 | Publish fb/%sysname%/IP,%ip% |
||
38 | timerSet,1,60 |
||
39 | endon |
||
40 | |||
41 | On Rules#Timer=1 do |
||
42 | Publish fb/%sysname%/json,'{"rssi":%rssi%,"temp65CF":[temp65CF#Temperature]}' |
||
43 | timerSet,1,60 |
||
44 | endon |
||
45 | </code></pre> |