Project

General

Profile

Mqtt » History » Revision 6

Revision 5 (Frédéric Blanc, 2020-01-17 13:28) → Revision 6/7 (Frédéric Blanc, 2020-01-17 13:40)

h1. Mqtt 

 h2. Controleur Mqtt 

 !mqtt001.png! 

 Controller Subscribe: 

 <pre><code> 
 %sysname%/+/+/set 
 </code></pre> 

 Controller Publish: 

 <pre><code> 
 %sysname%/%tskname%/%valname% 
 </code></pre> 

 Controller LWT Topic: 

 <pre><code> 
 %sysname%/$state 
 </code></pre> 

 h2. publication directement par le device 

 !mqtt003.png! 

 Dans le device cocher la case Send to Controller 
 h2. publication par les règles en json 

 !mqtt002.png! 


 <pre><code> 
 On System#Boot do     
  Publish fb/%sysname%/IP,%ip% 
   timerSet,1,60       
 endon 

 On Rules#Timer=1 do   
  Publish fb/%sysname%/json,'{"rssi":%rssi%,"temp65CF":[temp65CF#Temperature]}' 
   timerSet,1,60        
 endon 
 </code></pre>