Page 2 of 2

Re: Soma Smart Shades - Wazombi python script

Posted: Wednesday 31 May 2017 9:30
by najtram
Thanks for your update! I just couldn't get the sh script working, giving me a 512 error. This same error code suggests lua won't work either. So before I started with your solution I tried the blockly events, and that worked!

Thinking in this direction, it should also be possible with % slider in stead of open/closed.

See image attached...
Schermafdruk 2017-05-31 09.23.30.png
Schermafdruk 2017-05-31 09.23.30.png (58.4 KiB) Viewed 1239 times

Re: Soma Smart Shades - Wazombi python script

Posted: Wednesday 31 May 2017 10:11
by EdddieN
Well that looks more elegant than my solution!

Re: Soma Smart Shades - Wazombi python script

Posted: Wednesday 31 May 2017 21:52
by najtram
Here a integrated closed and open blockly. (WORKING :D )

Re: Soma Smart Shades - Wazombi python script

Posted: Wednesday 31 May 2017 22:32
by EdddieN
I guess for the slider it would be something similar...

Re: Soma Smart Shades - Wazombi python script

Posted: Wednesday 31 May 2017 23:07
by najtram
I also thought so. I created a nice test percentage blind switch, the value of the blind percentage dummy switch contains open/close value, not the percentage. The percentage is in the Svalue and the sad news is: "Reading sValues (temperatures etc) does not work either." According to the wiki: https://www.domoticz.com/wiki/Events

Sorry if this is correct... (because I'm note sure, maybe there is another way/workaround).

Re: Soma Smart Shades - Wazombi python script

Posted: Thursday 01 June 2017 22:17
by EdddieN
Not sure about blocky, I know from LUA I could access the svalues. Probably it has to do with not being able to do maths with it...

Re: Soma Smart Shades - Wazombi python script

Posted: Thursday 01 June 2017 22:20
by EdddieN
Oh! just released that on the LUA code I pasted earlier, there's a line commented that should not be commented! Basically I commented out the execution of the shell command while I was debugging it! :roll: also removed the debug info now

Code: Select all

local val_shades = otherdevices_svalues['Shades']
local status_shades = otherdevices['Shades']

commandArray = {}

    if status_shades ~= nil then
        val_shades = otherdevices_svalues['Shades']
        cmd = "/usr/bin/python  /home/pi/domoticz/scripts/python/control.py  -t ED:3D:C0:F7:07:FB -c move_target -a "..val_shades
        os.execute(cmd)
    end 

return commandArray