Support for Somfy Connexoon and Tahoma

Use this forum to discuss possible implementation of a new feature before opening a ticket.
A developer shall edit the topic title with "[xxx]" where xxx is the id of the accompanying tracker id.
Duplicate posts about the same id. +1 posts are not allowed.

Moderators: leecollings, remb0

TheoL
Posts: 17
Joined: Tuesday 22 September 2015 18:44
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.7
Contact:

Re: Support for Somfy Connexoon and Tahoma

Post by TheoL »

Where can I find that one? And thanx for the quick response
User avatar
madpatrick
Posts: 758
Joined: Monday 26 December 2016 12:17
Target OS: Linux
Domoticz version: 2025.2
Location: Netherlands
Contact:

Re: Support for Somfy Connexoon and Tahoma

Post by madpatrick »

1. Search in this topic
2. Google
3, https://github.com/MadPatrick/somfy
-= HP server GEN11 =- ZwaveJS-=- Domoticz v2025.2 -=- Dashticz =-
-= Checkout https://github.com/MadPatrick for the plugins =-
TheoL
Posts: 17
Joined: Tuesday 22 September 2015 18:44
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.7
Contact:

Re: Support for Somfy Connexoon and Tahoma

Post by TheoL »

That is the one I installed. And I followed those instructions. Although it's weird that the logs give a different version.

I think things went wrong, because I already had installed the old one first. I did find it strange that the config was messed up.

Now I'm getting these warnings:
2025-04-29 22:24:42.876 Error: Somfy: Call to function 'onStart' failed, exception details:
2025-04-29 22:24:42.878 Error: Somfy: Traceback (most recent call last):
2025-04-29 22:24:42.878 Error: Somfy: File "/home/domoticz_root/domoticz/plugins/somfy/plugin.py", line 576, in onStart
2025-04-29 22:24:42.878 Error: Somfy: _plugin.onStart()
2025-04-29 22:24:42.878 Error: Somfy: File "/home/domoticz_root/domoticz/plugins/somfy/plugin.py", line 165, in onStart
2025-04-29 22:24:42.878 Error: Somfy: self.tahoma.activate_token(pin,self.tahoma.token)
2025-04-29 22:24:42.878 Error: Somfy: File "/home/domoticz_root/domoticz/plugins/somfy/tahoma_local.py", line 119, in activate_token
2025-04-29 22:24:42.878 Error: Somfy: raise exceptions.LoginFailure("failed to activate token")
2025-04-29 22:24:42.878 Error: Somfy: exceptions.LoginFailure: failed to activate token
2025-04-29 22:25:06.115 Error: Somfy: Failed to request data: HTTPSConnectionPool(host='2033-9273-2678%20.local', port=8443): Max retries exceeded with url: /enduser-mobile-web/1/enduserAPI/setup/devices (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f9833f5e0>: Failed to establish a new connection: [Errno -2] Name or service not known'))
2025-04-29 22:25:30.116 Error: Somfy: Failed to request data: HTTPSConnectionPool(host='2033-9273-2678%20.local', port=8443): Max retries exceeded with url: /enduser-mobile-web/1/enduserAPI/setup/devices (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f9833f4f0>: Failed to establish a new connection: [Errno -2] Name or service not known'))
2025-04-29 22:25:54.110 Error: Somfy: Failed to request data: HTTPSConnectionPool(host='2033-9273-2678%20.local', port=8443): Max retries exceeded with url: /enduser-mobile-web/1/enduserAPI/setup/devices (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f9833f640>: Failed to establish a new connection: [Errno -2] Name or service not known'))

Okay I got it. I accidently added a space character behind the PIN. The plugin didn't like that. I see my devices now. Thanx for your time.
Rik60
Posts: 141
Joined: Sunday 25 June 2023 21:54
Target OS: Raspberry Pi / ODroid
Domoticz version: 2025.2
Location: The Netherlands
Contact:

Re: Support for Somfy Connexoon and Tahoma

Post by Rik60 »

I am running the beta version of the plugin, 4.2.22. It's working fine but causes an error in the Domoticz logging (Python, key error) when one of the devices was moving. I have solved this error by modifing the plugin.py file. I have added 2 lines around line 360, see attached pictures. To use the attached file, remove the.txt extension. I am controlling 2 roller shutters, 3 screens and 1 awning, Somfy IO system. Domoticz version 2025.1 build 16675. I am running this modified plugin now for an 1/2 year without problems/ errors
Attachments
Modified_plugin.py_4.2.22.jpg
Modified_plugin.py_4.2.22.jpg (67.97 KiB) Viewed 1400 times
plugin.py_4.2.22.jpg
plugin.py_4.2.22.jpg (77.51 KiB) Viewed 1400 times
plugin.py.txt
(33.45 KiB) Downloaded 22 times
User avatar
madpatrick
Posts: 758
Joined: Monday 26 December 2016 12:17
Target OS: Linux
Domoticz version: 2025.2
Location: Netherlands
Contact:

Re: Support for Somfy Connexoon and Tahoma

Post by madpatrick »

thanks

Added to the beta 4.2.23

Tip.
Better to add text is a bracket field </> then by using a picture
You can thr easily copy the text


OLD

Code: Select all

            if dataset["deviceURL"] not in Devices:
                Domoticz.Error("device not found for URL: "+str(dataset["deviceURL"]))
                logging.error("device not found for URL: "+str(dataset["deviceURL"])+" while updating states")
                continue #no deviceURL found that matches to domoticz Devices, skip to next dataset
            if (dataset["deviceURL"].startswith("io://")):
                dev = dataset["deviceURL"]
NEW

Code: Select all

            if dataset["deviceURL"] not in Devices:
                Domoticz.Error("device not found for URL: "+str(dataset["deviceURL"]))
                logging.error("device not found for URL: "+str(dataset["deviceURL"])+" while updating states")
                continue #no deviceURL found that matches to domoticz Devices, skip to next dataset
            if (dataset["name"] == "DeviceStateChangedEvent"):
                continue #dataset does not contain correct event, skip to next dataset
            if (dataset["deviceURL"].startswith("io://")):
                dev = dataset["deviceURL"]
-= HP server GEN11 =- ZwaveJS-=- Domoticz v2025.2 -=- Dashticz =-
-= Checkout https://github.com/MadPatrick for the plugins =-
Rik60
Posts: 141
Joined: Sunday 25 June 2023 21:54
Target OS: Raspberry Pi / ODroid
Domoticz version: 2025.2
Location: The Netherlands
Contact:

Re: Support for Somfy Connexoon and Tahoma

Post by Rik60 »

Please check line 8 of the new beta file. It is still 4.2.22
User avatar
madpatrick
Posts: 758
Joined: Monday 26 December 2016 12:17
Target OS: Linux
Domoticz version: 2025.2
Location: Netherlands
Contact:

Re: Support for Somfy Connexoon and Tahoma

Post by madpatrick »

I saw it also, Thanks
The master is now 4.2.23
-= HP server GEN11 =- ZwaveJS-=- Domoticz v2025.2 -=- Dashticz =-
-= Checkout https://github.com/MadPatrick for the plugins =-
Rik60
Posts: 141
Joined: Sunday 25 June 2023 21:54
Target OS: Raspberry Pi / ODroid
Domoticz version: 2025.2
Location: The Netherlands
Contact:

Re: Support for Somfy Connexoon and Tahoma

Post by Rik60 »

madpatrick wrote: Monday 05 May 2025 15:25 I saw it also, Thanks
The master is now 4.2.23
Please check in the Master version the Utils.py file. Now the master is updated with de beta plugin.py file, use in the new master version also the Utils.py file from the beta version.
Thanks
Rik60
Posts: 141
Joined: Sunday 25 June 2023 21:54
Target OS: Raspberry Pi / ODroid
Domoticz version: 2025.2
Location: The Netherlands
Contact:

Re: Support for Somfy Connexoon and Tahoma

Post by Rik60 »

Tested the new master version 4.2.23 with the new plugin.py and utils.py files. Everyting working fine, updating without errors. Running the plugin with the new Domoticz stable 2025.1. No problems, errors.
Thanks for updating the plugin.
jcb2
Posts: 38
Joined: Wednesday 04 January 2023 7:30
Target OS: Linux
Domoticz version:
Location: Belgium
Contact:

Re: Support for Somfy Connexoon and Tahoma

Post by jcb2 »

Hello,

Tested also with 4.2.23 and 25.1 and with Debian 13 -> OK !
Thanks.
User avatar
madpatrick
Posts: 758
Joined: Monday 26 December 2016 12:17
Target OS: Linux
Domoticz version: 2025.2
Location: Netherlands
Contact:

Re: Support for Somfy Connexoon and Tahoma

Post by madpatrick »

Just released version 4.5

Added a custum refresh interval for Day and Night
This will reduced unnecessary polling during night times.
Day time is 30 before sunrise and Night time 60 minutes after sunset (hardcoded)

Also cleaned up unnecessary files and lines

Made the error logging friendlier

*****
The setup parameter order has been changed, so you need to correct this after a restart.
Some fields are no moved to a different location due to the limitation of fields.
Just re-enter the correct parameters


Have fun !
-= HP server GEN11 =- ZwaveJS-=- Domoticz v2025.2 -=- Dashticz =-
-= Checkout https://github.com/MadPatrick for the plugins =-
Rik60
Posts: 141
Joined: Sunday 25 June 2023 21:54
Target OS: Raspberry Pi / ODroid
Domoticz version: 2025.2
Location: The Netherlands
Contact:

Re: Support for Somfy Connexoon and Tahoma

Post by Rik60 »

madpatrick wrote: Tuesday 29 April 2025 22:06 1. Search in this topic
2. Google
3, https://github.com/MadPatrick/somfy
Thanks for the update, some remarks:
I think the awing will not work correctly, did not test it yet,
The remarks in the files are in Dutch, not English?
User avatar
madpatrick
Posts: 758
Joined: Monday 26 December 2016 12:17
Target OS: Linux
Domoticz version: 2025.2
Location: Netherlands
Contact:

Re: Support for Somfy Connexoon and Tahoma

Post by madpatrick »

I have no awning so can not test
Please share more info so i’ll try to help

Translation will follow
Thanks for your remarks
-= HP server GEN11 =- ZwaveJS-=- Domoticz v2025.2 -=- Dashticz =-
-= Checkout https://github.com/MadPatrick for the plugins =-
Rik60
Posts: 141
Joined: Sunday 25 June 2023 21:54
Target OS: Raspberry Pi / ODroid
Domoticz version: 2025.2
Location: The Netherlands
Contact:

Re: Support for Somfy Connexoon and Tahoma

Post by Rik60 »

I have tested the new plugin, there are some probems:
First (i think this is a typo, an "," insteat of ";"):

Code: Select all

        if not Parameters.get('Mode2') or ';' not in Parameters['Mode2']:
            Domoticz.Log("Mode2 leeg of ongeldig, instellen op standaard 300,900")
            Parameters['Mode2'] = "300,900"
has to be:

Code: Select all

        if not Parameters.get('Mode2') or ';' not in Parameters['Mode2']:
            Domoticz.Log("Mode2 leeg of ongeldig, instellen op standaard 300;900")
            Parameters['Mode2'] = "300;900"
And insert back the removed lines, you can copy/replace the complete text into the plugin:

Code: Select all

    def update_devices_status(self, Updated_devices):
        logging.debug("updating device status self.tahoma.startup = "+str(self.tahoma.startup)+" on num datasets: "+str(len(Updated_devices)))
        logging.debug("updating device status on data: "+str(Updated_devices))
        if self.local:
            eventList = utils.filter_events(Updated_devices)
        else:
            eventList = Updated_devices
        num_updates = 0
        logging.debug("checking device updates for "+str(len(eventList))+" filtered events")
        for dataset in eventList:
            #logging.debug("checking dataset for URL: "+str(dataset['deviceURL']))
            logging.debug("checking dataset: "+str(dataset))
            if dataset["deviceURL"] not in Devices:
                Domoticz.Error("device not found for URL: "+str(dataset["deviceURL"]))
                logging.error("device not found for URL: "+str(dataset["deviceURL"])+" while updating states")
                continue #no deviceURL found that matches to domoticz Devices, skip to next dataset
            if (dataset["name"] == "DeviceStateChangedEvent"):
                continue #dataset does not contain correct event, skip to next dataset
            if (dataset["deviceURL"].startswith("io://")):
                dev = dataset["deviceURL"]
                deviceClassTrig = dataset["deviceClass"] 
                level = 0
                status_num = 0
                status = None
                nValue = 0
                sValue = "0"

                states = dataset["deviceStates"]
                if not (dataset["name"] == "DeviceStateChangedEvent" or dataset["name"] == "DeviceState"):
                    logging.debug("update_devices_status: dataset['name'] != DeviceStateChangedEvent: "+str(dataset["name"])+": breaking out")
                    continue #dataset does not contain correct event, skip to next dataset

                for state in states:
                    status_num = 0
                    lumstatus_l = False

                    if ((state["name"] == "core:ClosureState") or (state["name"] == "core:DeploymentState")):
                        if (deviceClassTrig == "Awning"):
                            level = int(state["value"]) #Don't invert open/close percentage for an Awning
                            status_num = 1
                        else:
                            level = int(state["value"])
                            level = 100 - level #invert open/close percentage
                            status_num = 1
 
With these changes the plugin works for me without problems/errors, tested it with the awning and rolling shutters.
I can test the plugin if a new plugin is available
User avatar
madpatrick
Posts: 758
Joined: Monday 26 December 2016 12:17
Target OS: Linux
Domoticz version: 2025.2
Location: Netherlands
Contact:

Re: Support for Somfy Connexoon and Tahoma

Post by madpatrick »

i'd noticed them also.
Will be correct in the new version
I'm rewritting the plugin to enable more parameters

Can you try the bea branch for testing
-= HP server GEN11 =- ZwaveJS-=- Domoticz v2025.2 -=- Dashticz =-
-= Checkout https://github.com/MadPatrick for the plugins =-
Rik60
Posts: 141
Joined: Sunday 25 June 2023 21:54
Target OS: Raspberry Pi / ODroid
Domoticz version: 2025.2
Location: The Netherlands
Contact:

Re: Support for Somfy Connexoon and Tahoma

Post by Rik60 »

There is a problem in de master version, 1 line is missing

Code: Select all

            if (dataset["deviceURL"].startswith("io://")):
                dev = dataset["deviceURL"]
                level = 0
Please add the missing line:

Code: Select all

            if (dataset["deviceURL"].startswith("io://")):
                dev = dataset["deviceURL"]
                deviceClassTrig = dataset["deviceClass"] 
                level = 0
I tried to switch to the beta, for some reason i can't. Have to figure out why not.
User avatar
madpatrick
Posts: 758
Joined: Monday 26 December 2016 12:17
Target OS: Linux
Domoticz version: 2025.2
Location: Netherlands
Contact:

Re: Support for Somfy Connexoon and Tahoma

Post by madpatrick »

thanks

Did you try

Code: Select all

git checkout beta
Or just copy/paste the files
-= HP server GEN11 =- ZwaveJS-=- Domoticz v2025.2 -=- Dashticz =-
-= Checkout https://github.com/MadPatrick for the plugins =-
Rik60
Posts: 141
Joined: Sunday 25 June 2023 21:54
Target OS: Raspberry Pi / ODroid
Domoticz version: 2025.2
Location: The Netherlands
Contact:

Re: Support for Somfy Connexoon and Tahoma

Post by Rik60 »

Master version is ok for me now. No errors, erverything is working, no problems.
Switched to the beta, plugin started without errors, problems. Seems to be working ok.
Just some questions, why put some setting into a config file, for me it should be better to leave the setting in the setting screen.
In winter, or when it's dark, you can close a rolling shutter, but there is not reading back cause of the delay's, polling. Is it possible, when you sent a command to the Somfy system, there is a polling for some time to see that it's moving. Specialy when you are not at home and want to close/open a rolling shutter and like to see the actual position. Also, when you open/close a device with a handheld remote, the system is out of sync when there is no polling.
I think there is something wrong with the logging, there is no file in /var/log. I can see some logging in the somfy log file in the domoticz folder.
Thanks

Edit: Switched back to the master version, and looked a bit closer to the setting screen, the Somfy logging is in the domoticz folder. But i am missing some info, like which version is starting

And just for information, i am running domoticz version 2025.2 on Trixie on a rpi 3B+
User avatar
madpatrick
Posts: 758
Joined: Monday 26 December 2016 12:17
Target OS: Linux
Domoticz version: 2025.2
Location: Netherlands
Contact:

Re: Support for Somfy Connexoon and Tahoma

Post by madpatrick »

I've made some major adjustments since the update was not comming in anymore
Also the Awning feature caused the the plugin was blocking the polling when you don't have a Awning device

Restore the setting in Domoticz as parameter (for now)
Only the IP and port for domoticz are in de config.txt required since i ran out op free parameters
Also de Debug logging is nog working better

Implemented a feature that when a devices is activated the polling is 10 sec for 1 minute long
So even during night time it will update the devices fast and the goes back to the longer refresh time

Released it as 5.0.0
When this has no further issues i will push it to the main repository

please share your feedback
-= HP server GEN11 =- ZwaveJS-=- Domoticz v2025.2 -=- Dashticz =-
-= Checkout https://github.com/MadPatrick for the plugins =-
Rik60
Posts: 141
Joined: Sunday 25 June 2023 21:54
Target OS: Raspberry Pi / ODroid
Domoticz version: 2025.2
Location: The Netherlands
Contact:

Re: Support for Somfy Connexoon and Tahoma

Post by Rik60 »

Switched to the beta and updated it. Starts normal, without error, problems. Can control all devices, also the awning is working normal, but only the awning has no device update when it's moving. The polling is 10sec then, after 1 min it switch back to 20 sec. If a rolling shutter is moving the device is updating. If the awning is moving there is no updating. I did not change a setting.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest