nonolk / domoticz_tahoma_blind

Domoticz plugin writen in Python to support Velux blinds using Tahoma/Connexoon
GNU General Public License v3.0
17 stars 10 forks source link

Somfy Connexoon Blind Plugin not saving state after refresh #13

Closed captainmojo1981 closed 3 years ago

captainmojo1981 commented 3 years ago

Hi,

I have noticed an issue with the Connexoon IO plugin whereby the state of my device is not saved after refreshing the Domoticz web page. The state of my device always reverts back to 'Closed' even though the state should stay as 'Open' after I have opened my sun shade. Same applies to using the slider...the percentage state is not saved after refreshing the web page. Hope you can help resolve this issue?

Regards, Mo

nonolk commented 3 years ago

Hello,

Could you please tell me if your devices are RTS or IO devices ?

Best regards

captainmojo1981 commented 3 years ago

Hi,

It's an IO device.

Regards, Mo

nonolk commented 3 years ago

Hi,

So could you please provide some information like:

Please also activate debug in the plugin configuration. Could you also tell me which browser you are using and if the problem occur on all browser (it's to check if it's not cache issue).

Regards,

captainmojo1981 commented 3 years ago

Hi,

I'm running Domoticz version: 2020.2 on Rasbian 5.4.51.v7+. Python version is 2.7.16.

I have tried running this on Microsoft Edge, Chrome and also Safari on iPad and iPhone and all have the issue. I have cleared all cache on all browsers for testing purposes as well.

Thanks for checking out this issue!

Regards, Mo

nonolk commented 3 years ago

Could you please double check your Python version? For me python 2.7 is not supported and should not work.

And could you be a bit more precise on the domoticz version please ? Which build ?

captainmojo1981 commented 3 years ago

Just checked and it is version 2.7:

2.7.16 (default, Oct 10 2019, 22:02:15)

What version do you believe I need to be on? I can perhaps try this?

nonolk commented 3 years ago

Hello again,

Please read and apply carefully this article: https://www.domoticz.com/wiki/Using_Python_plugins

Let’s see if it helps

captainmojo1981 commented 3 years ago

Hi,

So Python is now the correct version.

Domoticz 'about' shows the following:

Version: 2020.2 Build Hash: b63341bc0 Compile Date: 2020-04-26 13:47:55 dzVents Version: 3.0.2 Python Version: 3.7.3 (default, Jul 25 2020, 13:03:44) [GCC 8.3.0]

nonolk commented 3 years ago

Ok, good and what is the actual status, does it help ?

If not please activate debug in the plugin configuration and provide the log after device change and after refresh.

captainmojo1981 commented 3 years ago

Hi. It didn't work unfortunately.

I have enabled Debug under the hardware plugin as requested. Can you help me and let me know where this log file is kept so I can provide this to you please?

nonolk commented 3 years ago

In fact just copy and paste the content of the log page, when moving your blind and when refreshing the page.

I have more questions:

captainmojo1981 commented 3 years ago

It's been raining alot where I am in NL so once I get the chance to open and close my sun shade to create a log file for you, then I will reply back with the information you have requested :)

captainmojo1981 commented 3 years ago

Finally had the chance to open my sun shade.

So the sun shade does work when using your plugin.

When using the slider, my Domoticz immediately shows 'Closed' even though it does open.

When using the normal switch button to open, then as long as I don't refresh the page or go to another part of Domoticz then it will show as 'Open' and not 'Closed'.

The log you requested is below:

edited ;-)

nonolk commented 3 years ago

Thank you for your feedback sadly it didn't help. I don't see the command processing in the log neither a status update.

I will try to provide you a link to the somfy rest api to collect more information.

nonolk commented 3 years ago

Ok any way, I think I found the reason of this issue, It seems Somfy's changed something in their api for awning devices. They reverted the open and closed value. The good news is that I'm testing a beta version right now, and I at least tried to address this issue.

Stay tuned.

captainmojo1981 commented 3 years ago

Hi. Good news! :)

Well done for finding the possible issue. Let me know if you require me to test any further.

Thanks for spending the time on this.

Regards, Mo

nonolk commented 3 years ago

@captainmojo1981 could you please so the following : Logon here: with your login info (just fill in userid and Password) https://tahomalink.com/enduser-mobile-web/enduserAPI/doc/test/3f0b5a478191e514cff8efbaf82545c2a2ce94d1b5b21347463261e6fbd88631

Then launch the following link: https://tahomalink.com/enduser-mobile-web/enduserAPI/doc/test/706df574b0e21fd04e7e4325f2957c3cc678ae66d9d61e4e05985295f4a26f80

In the last link result search for your sun shade and provide the value of core:ClosureState and core:OpenClosedState, also tell me what is the actual status of your sun shade.

I just want to be sure of what I'm doing.

captainmojo1981 commented 3 years ago

Hi,

Thanks for the follow up.

I could only fine the following in the REST API Test Page:

  {
    "name": "core:OpenClosedState",
    "type": 3,
    "value": "closed"
  },

I couldn't find anything for core:ClosureState.

The current actual state of my sun shade is Closed at this moment.

Hope this helps?

Regards, Mo

nonolk commented 3 years ago

Hello,

Could you please test this version ? https://github.com/nonolk/domoticz_tahoma_blind/tree/Test

you must either delete the sun shade or change the type to Blind percentage (instead of Blind percentage inverted)

And tell me if it's better.

If it’s not’ then provide me the complete output of the rest api, like I request above (the 2 links)

captainmojo1981 commented 3 years ago

Hi,

I just copied the test plugin.py file needed into my /domoticz/plugin/domoticz_tahoma_blind/ directory and now the hardware cannot find "Tahoma or conexoon IO blind plugin" anymore.

Is there a way I should install your test plugin.py file into Domoticz?

Regards, Mo

nonolk commented 3 years ago

Realy strange, I'm using this new version since at least a week.

Did you restarted domoticz ? Did you saw any error ?

captainmojo1981 commented 3 years ago

Yes I restarted Domoticz. Perhaps I installed this wrong?

Can you tell me the best way to install the new test plugin.py file so I can do the same and check please?

nonolk commented 3 years ago

Here is the command to install the test version: git clone -b Test https://github.com/nonolk/domoticz_tahoma_blind.git

And that's all, I sugest to remove first all trace from older versions, in the plugin directory

captainmojo1981 commented 3 years ago

OK. Your git clone install guide helped.

Now...the issue is still there though unfortunatly.

Here is the complete rest api output to help you:

edited ;-)

nonolk commented 3 years ago

Yes but now I got it, I will push a new test version this evening. I edited your log to hide your data to others ;-), But I picked what I need. the solution is core:Deploymentstate, which is the actul state of the device ;-)

captainmojo1981 commented 3 years ago

Ah thanks for hiding...I forgot this was public to others :)

Looks like you have found the issue this time.

Let me know when ready for testing and also let me know how to install via git clone so I can install properly :)

Thanks, Mo

nonolk commented 3 years ago

Ok, so I pushed a new version, could you please try it by issuing this command: git clone -b Test https://github.com/nonolk/domoticz_tahoma_blind.git

Then change the device type of your awning to Blind percentage (instead of Blind percentage inverted).

Keep in mind the followings:

captainmojo1981 commented 3 years ago

Hi, so an update for you.

The new beta seems to work much better than before! The state is saved even after refreshing so this is a good sign. It's a shame that 'Open' means not deployed and 'Close' means deployed but perhaps there is a way around this?

1 bug I have found is when using the percentage/slider to Open and Close the sun shade.

Example: When moving the slider to 10%, then the sun shade is deployed (Closed state for Domoticz) to 90%. The slider then refreshes itself to 90% on the device. Same thing applies to moving the slider to 40% then the sun shade deploys to 60% and then refreshes the device to 60% as well. A little confusing.

Thanks for all the effort so far!

nonolk commented 3 years ago

@captainmojo1981

SO yes it's a good news. Could you update again using this command git clone -b Test https://github.com/nonolk/domoticz_tahoma_blind.git

I hope this will solve the percentage mismatch issue.

For the open/close keep in mind that the device type is always blind in domoticz there is no awning or sun shade type, so it means open: you can see through, closed: you can't see through, it's a blind.

captainmojo1981 commented 3 years ago

Hi,

I had the chance to test the slider option this morning and this isn't solved completely.

Example:

I moved the slider to 10% and the sun screen does open but then after a few seconds (refresh) then the percentage is no longer showing.

nonolk commented 3 years ago

@captainmojo1981 in fact after a few second it's just not enough, remember this is a cloud based solution, therefor you must wait at least 10s before having the correct state reported and moving again. I mean if within 10s you first deploy the awing of 10% and then close it again, you will see nothing.

The status update is only done every 10s and this is something I could not change, this is the smaller heartbeat value for domoticz.

Could you please try again and deploy the shade for lets say one minute, then run the following request again: Logon here: with your login info (just fill in userid and Password) https://tahomalink.com/enduser-mobile-web/enduserAPI/doc/test/3f0b5a478191e514cff8efbaf82545c2a2ce94d1b5b21347463261e6fbd88631

Then launch the following link: https://tahomalink.com/enduser-mobile-web/enduserAPI/doc/test/706df574b0e21fd04e7e4325f2957c3cc678ae66d9d61e4e05985295f4a26f80

And post the result, and only at this time close your shade again.

Sadly if we are not able to get rid of this, I will remove awning/sun shade support from the plugin.

Best regards,

nonolk commented 3 years ago

@captainmojo1981 any news on this topic ?

nonolk commented 3 years ago

@captainmojo1981 could you please tell me, what is the actual status of your issue ? Will you be able to provide all the needed logs ??

captainmojo1981 commented 3 years ago

Hi,

Sorry haven't had the time to come back to you and comment yet. Will message you back asap.

nonolk commented 3 years ago

No feedback so closing the issue for now.