Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


  • 1

Sonoff basic


wiesiekr

Question

Hello.

Does anyone have an idea how to make a virtual device to control Sonoff Basic with the loaded espeasy or other software so that you can switch on and off the device with the HCL.
  Is it possible to read states in the HCL or is switched on or off.

Link to comment
Share on other sites

Recommended Posts

  • 0

LUA. :(

 

NMm7n3r5aS.png

but as I can see HCL can send "telnet" command.

so you can send 

/cm?cmnd=Power1%20ON or /cm?cmnd=Power1%20OFF

command as "string"

Edited by 10der
Link to comment
Share on other sites

  • 0

Yes by send GET command via http in VD button

Please login or register to see this code.

(in VD IP zone write IP address of remote server and in PORT remote http port ex. 80)

Link to comment
Share on other sites

  • 0
  • Inquirer
  • Wpisałem w VD IP sonoffa oraz port 80, w przycisku wpisałem 

     

    cm? Cmnd = GPIO12.1Moc1% 20OFF 
    HTTP / 1.10x0D0x0A0x0D0x0A 

     

    lecz dalej nie działa

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  •  

    Wpisałem w VD IP sonoffa oraz port 80, w tym wpisie 

     

    cm? Cmnd = GPIO12.1Moc1% 20OFF  
    HTTP / 1.10x0D0x0A0x0D0x0A 

     

    lecz dalej nie działa

     
    Edited by wiesiekr
    Link to comment
    Share on other sites

    • 0
    30 minutes ago, wiesiekr said:

    Czy masz może gotowe VD do HCL pod Sonoffa ?

    witam. nie. ja mam HC2. LUA VD :(

    Link to comment
    Share on other sites

    • 0
    32 minutes ago, wiesiekr said:

    Czy masz może gotowe VD do HCL pod Sonoffa ?

    witam. nie. ja mam HC2. LUA VD :(

     

     

    Please login or register to see this attachment.

    Please login or register to see this attachment.

    to forum blad :(

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • The device is working properly

    GET /control?cmd=GPIO,12,1 HTTP/1.1
    Host: 192.168.1.xxx
    0x0D0x0A0x0D0x0A

     

    Thank you very much for help.
     

    Link to comment
    Share on other sites

    • 0

    witam.

    Próbowałem  uruchomić podane przez Ciebie VD 

    Please login or register to see this link.

      i mi to nie działa. Co należy uzupełnić lub zmienić

    w zakładce ogólne adres IP i port 80 oraz w ikonki 

     

    Link to comment
    Share on other sites

    • 0

    Witam 

    działa z najnowszymi wersjami flash firmware (json response)

    Please login or register to see this link.

    Link to comment
    Share on other sites

    • 0
    32 minutes ago, ptactwo said:

    Czyli wgrać najnowsze oprogramowanie ESPEasy_v2.0-20180316

    ¯ \ _ (ツ) _ / ¯

    Link to comment
    Share on other sites

    • 0

    Can I get more help here. This is my first time adding a VD on my HCL and I have added the code above but still it is not working.

     

    I wonder what is the reason and I also feel it is strange to work without username and password!

     

    Appreciate your help friends...

    Link to comment
    Share on other sites

    • 0
    11 hours ago, 10der said:

    No. HCL does not support LUA.

    but you can call via HTTP 

     

    Thanks, but how to do that? :roll:

    Link to comment
    Share on other sites

    • 0

    Any idea? HTTP Call did not work with me even directly through the browser. I'm using Sonoff S20 

    Please login or register to see this link.

     

    Link to comment
    Share on other sites

    • 0

    Hi,

     

    did anyone have any success with http command.....? I would really like to add the sonoff switches to HCL.... 

     

    Thanks

    Link to comment
    Share on other sites

    • 0
    1 hour ago, BIPUK said:

    did anyone have any success with http command

     

    Assuming you have flashed the device with Tasmota , adjust IP to suit

    note: there is a space in the command string that is represented by the typical %20 representation

     

    Sonoff basic

    On - http://192.168.1.153/cm?cmnd=Power%20On

    Off - http://192.168.1.153/cm?cmnd=Power%20Off

    Dim - http://192.168.1.153//cm?cmnd=Power%20TOGGLE

     

    http://192.168.1.153/cm?cmnd=status%200 (full status in in browser or HC2)

     

    Please login or register to see this code.

    MagicHome 

    same as above but also has dimmer

    x is dim value between 0 and 100

     

    http://192.168.1.153/cm?cmnd=dimmer%20"..x 

     

    Dimmer with slider in VD

    Please login or register to see this code.

    Fade off VD button

    Please login or register to see this code.

    Fade off button

    Same as above but replace 

    Please login or register to see this code.

    with

    Please login or register to see this code.

    100 - start value, 0 - end value, 1 - decrement value

     

     

    Magichome

    Counter Lights VD  (this controls 2 RGB modules, colors displayed by the presets may vary with your led strip)

    Please login or register to see this attachment.

     

    Sonoff basic

    running a lamp

    Please login or register to see this attachment.

     

    Sonoff TH16 with Temp/Humidity sensor

    Running a bathroom extractor fan (sensor above fan in extractor tube)

    Please login or register to see this image.

    /monthly_2018_09/image.png.ecdbb2652a9cac1a750b91d788ebea36.png" alt="image.png.ecdbb2652a9cac1a750b91d788ebea36.png" />

     

    Please login or register to see this attachment.

     

     

     

     

     

     

     

     

     

     

     

     

    Edited by AutoFrank
    • Like 1
    Link to comment
    Share on other sites

    • 0

    Hi, I try the 

    Please login or register to see this link.

    .

    But don't work. Are you sure that it's ok?

    I know that Magic Home use port 5577.

    Link to comment
    Share on other sites

    • 0
    On 9/25/2018 at 9:16 PM, AutoFrank said:

     

    Assuming you have flashed the device with Tasmota , adjust IP to suit

    note: there is a space in the command string that is represented by the typical %20 representation

     

    Sonoff basic

    On - http://192.168.1.153/cm?cmnd=Power%20On

    Off - http://192.168.1.153/cm?cmnd=Power%20Off

    Dim - http://192.168.1.153//cm?cmnd=Power%20TOGGLE

     

    http://192.168.1.153/cm?cmnd=status%200 (full status in in browser or HC2)

     

    Please login or register to see this code.

    MagicHome 

    same as above but also has dimmer

    x is dim value between 0 and 100

     

    http://192.168.1.153/cm?cmnd=dimmer%20"..x 

     

    Dimmer with slider in VD

    Please login or register to see this code.

    Fade off VD button

    Please login or register to see this code.

    Fade off button

    Same as above but replace 

    Please login or register to see this code.

    with

    Please login or register to see this code.

    100 - start value, 0 - end value, 1 - decrement value

     

     

    Magichome

    Counter Lights VD  (this controls 2 RGB modules, colors displayed by the presets may vary with your led strip)

    Please login or register to see this attachment.

     

    Sonoff basic

    running a lamp

    Please login or register to see this attachment.

     

    Sonoff TH16 with Temp/Humidity sensor

    Running a bathroom extractor fan (sensor above fan in extractor tube)

    Please login or register to see this link.

     

    Please login or register to see this attachment.

     

     

     

     

     

     

     

     

     

     

     

     

    Since a while there is a new Sonoff firmware available, that provides a so called "inching" feature, this would have the effect of a pushbutton, so it only closes the pins of the relay for a time equal or greater than 0,5 seconds. This is a perfect solution to open/close a garage door.

    On the other side I was disappointed to see, that Tasmota will not provide such functionality, yet there might be a command for that which in turn could be adapted so that Fibaro HC2 could send a pulse only to the Sonoff.

     

    Is there such a command available that I could use? How would you solve my issue?

    Link to comment
    Share on other sites

    • 0

     

    Hello. I have a script adapted by @Auto Frank "Extractor_Fan.vfib". The problem is that it does not change my status from On to Off in the module. Please help. I am enclosing the script from the main loop.

    Please login or register to see this attachment.

     

     

    Hello. I have a script adapted by @Auto Frank "Extractor_Fan.vfib". The problem is that it does not change my status from On to Off in the module. Please help. I am enclosing the script from the main loop.

     

     

    local device    = fibaro:getSelfId()
    local zone         = fibaro:getName(device)
    local ipaddress = fibaro:getValue(device, "IPAddress")
    local port         = fibaro:getValue(device, "TCPPort")

    s = Net.FHttp(ipaddress, port)
    rS1 = s:GET("/cm?cmnd=Status")
    rS2 = s:GET("/cm?cmnd=Status%2010")

    if rS1 ~= nil and rS1 ~= "" then
          jS = json.decode(rS1)
          if jS.Status.Power == 0 then
               fibaro:call(device,"setProperty","ui.extfan.value", "Off")
          fibaro:call(device, "setProperty", "currentIcon", 1085)
            fibaro:setGlobal("SonoffFanGuestEns", 0) 
            fibaro:debug("fan is off")
        
           elseif jS.Status.Power == 1 then
              fibaro:call(device,"setProperty","ui.extfan.value", "On")
            fibaro:call(device, "setProperty", "currentIcon", 1006)
            fibaro:setGlobal("SonoffFanGuestEns", 1) 
               fibaro:debug("fan is on")
        end
    else
      fibaro:debug("Sonoff appears to be offline")
      fibaro:call(device,"setProperty","ui.status.value", "OFFLINE")
    end
    if rS2 ~= nil and rS2 ~= "" then
          jS = json.decode(rS2)
          local Temp = jS.StatusSNS.DHT11.Temperature
          local Humidity = jS.StatusSNS.DHT11.Humidity
          fibaro:setGlobal("SonoffFanGuestEnsT", Temp) 
          fibaro:setGlobal("SonoffFanGuestEnsH", Humidity) 
           fibaro:call(device,"setProperty","ui.temp.value", Temp.." C")
        fibaro:call(device,"setProperty","ui.humidity.value", Humidity.." RH")
          local fanState = fibaro:getGlobalValue("SonoffFanGuestEns")
          if fanState == "1" then fanStat = "Off" else fanStat = "On" end
        status = ""..fanStat.." / "..Temp.." C / "..Humidity.." RH"
          fibaro:debug(status)
          fibaro:call(device,"setProperty","ui.status.value",status)


    end

    local upt = ""..os.date("%d").." "..os.date("%b").." @ "..os.date("%H:%M")..""
    fibaro:log("Updated: "..upt)    

    fibaro:sleep(5000)

    Link to comment
    Share on other sites

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Answer this question...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.

    ×
    ×
    • Create New...