Simple Node app to automatically control your Somfy shutters based on your local day cycle.
Make sure you have Node.js v16.18.0 installed. This project uses Import Assertions and when I tested with Node v16.14.0 it did not work, so I had to upgrade to v16.18.0.
I am not a Node expert so maybe there is a cleaner way to handle JSON file import within an ES6 module but this is working for now.
- Clone the repository and open it
cd somfy-home-controller
- Add a new file
shc-config.json
at the project root:
{
"somfyUrl": "ha101-1.overkiz.com",
"pod": "XXXX-XXXX-XXXX",
"port": 8443,
"gatewaySuffix": "home",
"token": "PUT_YOUR_SUPER_SECRET_TOKEN_HERE",
"location": {
"latitude": 0.0,
"longitude": 0.0,
"altitude": 0,
"timezone": "Europe/Paris"
},
"devices": [
{
"protocol": "io",
"id": "shutter_kitchen",
"name": "Volet Cuisine",
"url": "io://XXXX-XXXX-XXXX//1111111"
},
{
"protocol": "io",
"id": "shutter_kitchen_door",
"name": "Volet Porte Cuisine",
"url": "io://XXXX-XXXX-XXXX//2222222"
},
{
"protocol": "io",
"id": "shutter_room",
"name": "Volet Chambre",
"url": "io://XXXX-XXXX-XXXX/3333333"
}
]
}
-
Set the
pod
andtoken
to link to your local Tahoma API -
Fill in the location data with (
altitude
andtimezone
are optional). But timezone is not supported yet anyway... -
Setup the devices you want to control automatically. Only shutters are supported.
-
Once your config file is all set, you can test the script with
npm start
. But if you want to have this script running all day, you might want to use actual libraries such as pm2 or forever. In case you are using pm2, you can start the script in background like this:pm2 start npm --name "my-somfy-home-controller" -- start
It is also possible to use a CLI to manually interact with the Tahoma box.
To launch the CLI, simply enter npm run cli
in your shell.
Here is what the latest version of the CLI looks like:
If you want full control over a device, you should control it via the device mode.
You can enter device mode by typing load <id>
in the general CLI.
The <id>
refers to the combination of digits after the gateway pin in the device URL.
- GitHub repo of Somfy-TaHoma-Developer-Mode
- Swagger UI for local gateway API
- Get yearly daylight cycles on: https://dev.timeanddate.com/time/