Mqtt Import Connection lost

Moderators: grovkillen, Stuntteam, TD-er

Message
Author
radebebek
New user
Posts: 5
Joined: 05 Feb 2018, 11:06

Mqtt Import Connection lost

#1 Post by radebebek » 06 Apr 2018, 20:42

Hello all,

I am developing home bridge plugin with mqtt broker for up and down blinds.
So, I want "up and down" blinds with Home App, and also I want "up and down" blinds with with a physical wall switch.
Physical wall switch connected to GPIO0 AND GPIO9 (Sonoff Dual r2, lastes firmware v2.0-20180322)
Control even is [Import#moving] that show // 0 = Stoped , 1=Moving Up , Moving Down.
When app start moving down, App publish 1, after blinds moving finished, sonoff publish 2.
So, I have problem with publish 2.
For some reason after gpio,12,0 mqtt lost connection and dont publish 2, and also mqtt import dont update state moving to 2.
A couple of times pass without problems, but every some time the connection loss is lost, and this is always on this part after gpio,12,0 or gpio,5,0.
----
I make some things easier with mqtt, and never lost connection to the same device son off dual r2. (So, The device is okay)

All Rules Code:

Code: Select all

on Import#moving=0 do 
        gpio,12,1
        Delay [Import#time]
        gpio,12,0
        Publish RoletneMalaSobaWC/currentPosition,[Import#target]
        Publish RoletneMalaSobaWC/statePosition,2
endon

on Import#moving=1 do 
        gpio,5,1
        Delay [Import#time]
        gpio,5,0
        Publish RoletneMalaSobaWC/currentPosition,[Import#target]
        Publish RoletneMalaSobaWC/statePosition,2
endon

on TipkaUp#Stanje=0 do
     if [Import#moving]=2 
        Publish RoletneMalaSobaWC/targetPosition,100
        Publish RoletneMalaSobaWC/time,10000
        Publish RoletneMalaSobaWC/statePosition,1
     endif
endon

on TipkaUp#Stanje=1 do 
     if [Import#moving]=2 
        Publish RoletneMalaSobaWC/targetPosition,100
        Publish RoletneMalaSobaWC/time,10000  
        Publish RoletneMalaSobaWC/statePosition,1
     endif
endon

on TipkaDown#Stanje=0 do
     if [Import#moving]=2 
        Publish RoletneMalaSobaWC/targetPosition,0
        Publish RoletneMalaSobaWC/time,10000
        Publish RoletneMalaSobaWC/statePosition,0
     endif
endon

on TipkaDown#Stanje=1 do 
     if [Import#moving]=2 
        Publish RoletneMalaSobaWC/targetPosition,0
        Publish RoletneMalaSobaWC/time,10000  
        Publish RoletneMalaSobaWC/statePosition,0
     endif
endon
Some picture:
You do not have the required permissions to view the files attached to this post.

Who is online

Users browsing this forum: Bing [Bot] and 15 guests