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

Somfy plugin for Domoticz

Original script was written by Nonolk : https://github.com/nonolk/domoticz_tahoma_blind.git

Special thanks to Jan-Jaap who did the rewritting of the plugin

Domoticz plugin writen in Python to first support Somfy IO roller shutters using Tahoma/Connexoon. Basic support of RTS (Open/Close) is also included without return state (limitation due to RTS), it means for RTS the state of the device won't be updated if the device state is modified outside of domoticz. The plugin currently support the following device types: roller shutters, screens (interior/exterior), awning, pergolas, garage door, windows, luminance sensor and blinds (postions and slats control).

Important note

Version 3.x

When upgrading to version 3.x, it is required to first remove all devices attached to the Somfy hardware. This has to do with the upgrade to the Domoticz Extended Framework, which enabled the slats/orientation control for the blinds. The plugin will not upgrade when there are still devices attached to the Somfy hardware.

version 4.x

As of version 4.x the plugin supports local access to the Somfy box for both Tahoma and Connexoon. Addtional installation steps mentioned below.


Somfy currently discourages the use of the Web function So the connection to Somfy Web may not work properly in the plugin It is therefore recommended to use local mode. Refer to Somfy instructions to put your box in development mode.


Somfy login

Before installation, you need to register you Somfy products and add them to your Tahoma or Connexoon box https://www.somfy.nl/nieuw-account-aanmaken https://www.tahomalink.com/enduser-mobile-web/steer-html5-client/tahoma/

Installation

Prerequisites

The following steps need to be taken before plugin installation (generic for any plugin)

  1. Python version 3.7 or higher required & Domoticz version 2022.1 (due to extended plugin framework) or greater.
  2. follow the Domoticz guide on Using Python Plugins.
  3. install the required libraries:
    sudo apt-get update

    Check you Python version

    sudo python3 -V

    for example Python 3.9.2 Then install the libpython3.9-dev according your version

    sudo apt-get install python3 libpython3-dev libpython3.9-dev
    sudo apt-get install python3-requests

    Setup local API access

  4. First you need to enable developer mode on your box:
    • connect to the Somfy website and navigate to the My Account menu.
    • Find the different available options for your TaHoma box and activate Developer Mode.
    • Follow instructions as provided by Somfy

Activating this mode will enable a local API on your TaHoma and Connexoon box. Be aware that Somfy will not be able to provide support for usage of this API.

  1. Your Somfy box needs the traceable in your network. To do this, you need to link your Somfy Box PIN to the Somfy Box IP address. Add your Somfy Box PIN number to the IP in your local network in etc/hosts or in your DNS Server
    192.168.1.1 1234-1234-1234.local

    192.168.1.1 is the IP of your Somfy box
    1234-1234-1234 is the PIN number of your Somfy box and don't forget to add .local to the PIN number

Install the plugin

  1. Go in your Domoticz directory using a command line and open the plugins directory: cd domoticz/plugins
  2. clone the plugin: git clone https://github.com/MadPatrick/somfy
  3. Restart Domoticz: sudo systemctl restart domoticz

BETA

You can use the latstest test version (on your own risk)

cd domoticz/plugins/somfy

git checkout beta

Configure the plugin

In the Domoticz UI, navigate to the Hardware page. In the hardware dropdown list there will be an entry called "Somfy Tahoma or Connexoon plugin". Add the hardware to your Domoticz system and fill in the required fields

Domoticz - Hardware

Field Input
Username Your login name for your Somfy account
Password Your password for your Somfy account
Refresh Interval Select the time of updating the devices.
For Web login don't refresh too frequently the avoid login errors from Somfy webserver, 5 minutes interval adviced
For local login lower interval can be used
Connection Select Local or Web
Local needs the developer mode on your Somfy box
Web is the API website of Somfy
Gateway PIN PIN code of your box (see the box)
Reset token Set as default to False If you have error with the token your request a new token
Portnumber The connection port of your Somby box.
By default this is set to 8443
Log file location You can set a custom log location if you like
Debug logging Default is False
If you need some extra information in the log you can set this to True

Domoticz - Hardware2

After completing the field the devices will be created in your Devices section.

Slider status in Domoticz

The slider status of the created devices can be changed if this does not meet your requirements Some people like to heve slider with status Open at 0% and Close at 100% You can change this per devies if you edit the device and click the box "Reverse Position" (To set the position correctly move your devices a few time)

Domoticz - Devices_613_LightEdit

Update the plugin:

When there an update of the plugin you can easlily do an update by:

cd domoticz/plugins/somfy
git pull

And then either restart Domoticz or update the plugin on the Hardware page.

used information: