Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible to add My/Stop command ? #8

Closed
ab10002 opened this issue Jul 23, 2022 · 20 comments
Closed

Possible to add My/Stop command ? #8

ab10002 opened this issue Jul 23, 2022 · 20 comments
Labels
Awaiting feedback Need more information to be able to continue

Comments

@ab10002
Copy link

ab10002 commented Jul 23, 2022

No description provided.

@JanJaapKo
Copy link
Collaborator

Hi @ab10002 ,

This is too little to work with, please describe what it is that you want to have changes or is not working as expected.

@JanJaapKo JanJaapKo added the Awaiting feedback Need more information to be able to continue label Jul 23, 2022
@ab10002
Copy link
Author

ab10002 commented Jul 23, 2022 via email

@JanJaapKo
Copy link
Collaborator

OK, I do not have a Somfy thing so I need a very extensive description of what you expect as behavior then I'll see if it can be built.

@ab10002
Copy link
Author

ab10002 commented Jul 26, 2022

I'll try..
Like the Somfy remote control, the Domoticz light/switch "blinds +stop" has a stop icon.
I'v tried but the plugin/tahoma don't recognized sending "stopped".
So m.o. the pluging need a command sending stopped..

Log:
2022-07-26 11:47:25,257 - INFO - tahoma.py - Sending command to tahoma api
2022-07-26 11:47:25,298 - ERROR - tahoma.py - error during command, status: 400, possible cause:{'errorCode': 'FIELD_NOT_SET', 'error': 'Command name not set'}

@ab10002
Copy link
Author

ab10002 commented Jul 26, 2022

Add'd these "BOLD" lines;
if (str(Command) == "Off"):
commands["name"] = "close"
elif (str(Command) == "On"):
commands["name"] = "open"
elif (str(Command) == "Stop"):
commands["name"] = "my"

elif ("Set Level" in str(Command)):
commands["name"] = "setClosure"
tmp = 100 - int(Level)
params.append(tmp)
commands["parameters"] = params

And that works. Only for stop, need to change my in stop..

@MadPatrick
Copy link
Owner

MadPatrick commented Jul 26, 2022

I've tried the proposed change, but i'm getting an error

2022-07-26 16:19:50.291 Error: Somfy: (tahomaIO) failed to load 'plugin.py', Python Path used was '/var/domoticz/plugins/somfy/:/usr/lib64/python36.zip:/usr/lib64/python3.6:/usr/lib64/python3.6:/usr/lib64/python3.6/lib-dynload:/usr/local/lib64/python3.6/site-packages:/usr/local/lib/python3.6/site-packages:/usr/lib64/python3.6/site-packages:/usr/lib/python3.6/site-packages'. 2022-07-26 16:19:50.291 Error: Somfy: Module Import failed, exception: 'SyntaxError' 2022-07-26 16:19:50.291 Error: Somfy: Import detail: File: , Line: 138, offset: 4 2022-07-26 16:19:50.291 Error: Somfy: Error Line 'elif (str(Command) == "Stop"):

Which version of the plugin are you using?

@ab10002
Copy link
Author

ab10002 commented Jul 26, 2022 via email

@MadPatrick
Copy link
Owner

The plugin is not loading because of this change.
the error comes directly at start up of the script

@ab10002
Copy link
Author

ab10002 commented Jul 26, 2022

Which line (how) can i test that?

@MadPatrick
Copy link
Owner

MadPatrick commented Jul 26, 2022

I've added line as you have proposed in previous comment

elif (str(Command) == "Stop"):
commands["name"] = "my"

This change is made in plugin.py

@JanJaapKo
Copy link
Collaborator

JanJaapKo commented Jul 26, 2022

@MadPatrick it should look like this:

image

Mind that in Python the whitespace in front of the line is important. Needs to be nicely aligned. Although that does not seem to be this issue as the interpreter would have complained about indent error.

@ab10002
Copy link
Author

ab10002 commented Jul 27, 2022

@MadPatrick it should look like this:

image

Mind that in Python the whitespace in front of the line is important. Needs to be nicely aligned. Although that does not seem to be this issue as the interpreter would have complained about indent error.

yep

@MadPatrick
Copy link
Owner

I've tried it and aligned everything, but no luck
I'm still getting the error on both my testserver and production server

@berserk14350
Copy link

berserk14350 commented Jul 27, 2022

Hi,
So for my velux io system, i try this and it s work perfect:

Screenshot_20220727-222513_JuiceSSH

@MadPatrick
Copy link
Owner

MadPatrick commented Jul 28, 2022

Hi All,

I've found the error.
I used TAB for spacing instead of SPACES.

Script with the STOP addition is working.
Be aware that as default the switch is made "Blinds Percentage Inverted"
This switch is kind of dimmer without STOP function

@ab10002
Copy link
Author

ab10002 commented Jul 29, 2022

I'v reversed close/open cmd's in plugin.py. Now it's acting normal.

@ab10002
Copy link
Author

ab10002 commented Aug 2, 2022

I'm changed one more line, sending level command''s is now working okay.
Not displaying in Domoticz, that's seemed to be a bug in Domoticz..

    elif ("Set Level" in str(Command)):
        commands["name"] = "setClosure"

-# tmp = 100 - int(Level)
tmp = int(Level)

@berserk14350
Copy link

Hi
I see the same problem, what is your version of domoticz (stable or beta).

@ab10002
Copy link
Author

ab10002 commented Aug 2, 2022

Latest beta 14438

@berserk14350
Copy link

berserk14350 commented Aug 2, 2022

OK, i have testing bêta version Last week. And the buttons are inversed, and the picture open close doesnt work correctly at home.

Finaly i return to the version stable...

I think, that à good idea for adapt whith different button

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting feedback Need more information to be able to continue
Projects
None yet
Development

No branches or pull requests

4 participants