MadPatrick / somfy

Tahoma/Conexoon plugin for IO blinds, this plugin require internet connexion and a Somfy account
GNU General Public License v3.0
14 stars 3 forks source link

Inverted issue in Domoticz #13

Closed ab10002 closed 1 year ago

ab10002 commented 1 year ago

Regarding this issue https://github.com/domoticz/domoticz/issues/5288 I'v done some mods:

#        if (str(Command) == "Off"):
#            commands["name"] = "close"
#        elif (str(Command) == "On"):
#            commands["name"] = "open"
        if (str(Command) == "Off"):
            commands["name"] = "open"
        elif (str(Command) == "On"):
            commands["name"] = "close"
        elif (str(Command) == "Stop"):
            commands["name"] = "stop"
        elif ("Set Level" in str(Command)):
            commands["name"] = "setClosure"
#            tmp = 100 - int(Level)
            tmp = int(Level)
            params.append(tmp)
            commands["parameters"] = params

                  if ((state["name"] == "core:ClosureState") or (state["name"] == "core:DeploymentState")):
                    level = int(state["value"])
                    # Delete# level = 100 - level
                    status_l = True
MadPatrick commented 1 year ago

Thanks for the post. I've quickly tested the mod, but then you must change the Switch type from "Blinds Inverted" to "Blinds" Also the Blinds Percentage does not work.

ab10002 commented 1 year ago

Thanks for the post. I've quickly tested the mod, but then you must change the Switch type from "Blinds Inverted" to "Blinds" Also the Blinds Percentage does not work.

That was the coal.. odd the blind/percentage device doesn't work for you. Did you delete the line in the second part ?? ( # Delete# level = 100 - level)

I'm using now blind/percentage+stop image

MadPatrick commented 1 year ago

I've tested it bit better and with several devices and the slider works indeed.

Also the heartbeat function of the script is giving an error and therefor the devices not updated Do you also get an error in your log ?

`2022-08-30 14:16:23.174 Error: Somfy Tahoma: 'onHeartbeat' failed 'NameError':'name 'Tr' is not defined'.

2022-08-30 14:16:23.174 Error: Somfy Tahoma: Exception traceback:

2022-08-30 14:16:23.174 Error: Somfy Tahoma: ----> Line 292 in '/var/domoticz/plugins/somfy_tahoma_blind/plugin.py', function onHeartbeat

2022-08-30 14:16:23.174 Error: Somfy Tahoma: ----> Line 201 in '/var/domoticz/plugins/somfy_tahoma_blind/plugin.py', function onHeartbeat

2022-08-30 14:16:23.174 Error: Somfy Tahoma: ----> Line 243 in '/var/domoticz/plugins/somfy_tahoma_blind/plugin.py', function update_devices_status `

ab10002 commented 1 year ago

No, maybe somewhere a fault line?

MadPatrick commented 1 year ago

I doubt. It is a complete different call and i used copy/paste Which version are you using ? Master or AddNewRollerShutter

ab10002 commented 1 year ago

Master.

Sometimes i'v got a somfy API error, due to many connections. That's set very low by Somfy

MadPatrick commented 1 year ago

I've created a new Branch "Beta" Please check if this is working

ab10002 commented 1 year ago

I've created a new Branch "Beta" Please check if this is working

Tested. Works perfect👍

MadPatrick commented 1 year ago

Ok. The only thing now is to make the Switch type different when created

ab10002 commented 1 year ago

Ok. The only thing now is to make the Switch type different when created

+stop😎

ab10002 commented 1 year ago

I'v a Sunis (Somfy lux sensor) i see it in the log. Is there a way to build in?

MadPatrick commented 1 year ago

Ok. The only thing now is to make the Switch type different when created

+stop😎

Changed "Stop" to "My"

please check

ab10002 commented 1 year ago

Ok. The only thing now is to make the Switch type different when created

+stop😎

Changed "Stop" to "My"

please check

Pse no, i'v test that.. And then stop does'nt work. So i'v changed that back to stop. And for MY, you can send levels ##

MadPatrick commented 1 year ago

My bad..... i though the command in the script needed a change. Corrected it back

Also Switch type is change to Normal. Can you check if you make/add a new device if the switch type is now good.

ab10002 commented 1 year ago

Also Switch type is change to Normal. Can you check if you make/add a new device if the switch type is now good. Mm, what do you mean?

MadPatrick commented 1 year ago

if you install the plugin and no devices are yet in Domoticz it will create the Somfy devices Since you maybe already have the devices added to Domoticz it will skip this When you remove a device and restart the plugin it will add the device again Only now as different switch type

ab10002 commented 1 year ago

The wrong device is created image

Must be blind+stop image

MadPatrick commented 1 year ago

I noticed it also ;-) Now changed, but device will be "Blinds Percentage"

ab10002 commented 1 year ago

No, should be blinds+stop. that is with percentage

MadPatrick commented 1 year ago

No, should be blinds+stop. that is with percentage

This devices is not working with Dashticz. The percentage will disappear and will become a On?off button

ab10002 commented 1 year ago

New subtype for blind+stop (with percentage) is 21 https://www.domoticz.com/wiki/Domoticz_API/JSON_URL%27s