Skip to content

Stop blind partway down? #56

Description

@omegahm

Hi @starkillerOG

This is more of a question than an issue.

When I use the app that followed with my blinds (Motionblinds) I am able to press DOWN on a blind, then press PAUSE, then press UP. This will let the blind first close, then stop, then open again. When I try to script it, the blind doesn't seem to listen to the Stop() command. Am I doing something wrong, or is the blind not capable of listening midway in this manner?

This is my testing script.

import datetime
import time
import logging
logging.basicConfig(level=logging.DEBUG)

from motionblinds import MotionGateway, MotionDiscovery

m = MotionGateway(ip = "XXXX", key = "XXXX")

m.GetDeviceList()
m.Update()

blind1 = list(m.device_list.values())[0]
blind1.Update()

print("Closing blind...")
blind1.Close()

print("Waiting for 2 seconds...")
time.sleep(2)

print("Stopping blind...")
blind1.Stop()

print("Waiting for 2 seconds...")
time.sleep(2)

print("Opening blind...")
blind1.Open()

For full context, I am trying to integrate my blinds with my Fibaro Home. This is using Lua for scripting and my QuickApp is set up like so:

function time()
  return os.date("%Y%m%d%H%M%S000", os.time())
end

function getData(token, macAddress, state)
  return json.encode({ 
    msgType = "WriteDevice", 
    mac = macAddress,
    deviceType = "10000000",
    AccessToken = token, 
    msgID = time(), 
    data = { operation = state } -- 0 is close, 1 is open, 2 is stop, 5 is status
  })
end

function QuickApp:operate(macAddress, state)
  self.socket = net.UDPSocket()  
  self.socket:sendTo(
    getData(self.accessToken, macAddress, state), 
    '238.0.0.18',
    32100
  )
end

Here I can then use operate(macAddress, 0) to close the blind and 1 to open. The blind doesn't respond again before it's closed completely.

Do you have any tips? Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions