Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Somfy open api #9625

Merged
merged 9 commits into from
Jun 18, 2019
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions source/_components/cover.somfy.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
layout: page
title: "Somfy Cover"
description: "Instructions on how to integrate Somfy covers into Home Assistant."
date: 2019-01-02 12:00
sidebar: true
comments: false
sharing: true
footer: true
logo: somfy.png
ha_category: Cover
ha_release: 0.95
---

The `somfy` cover platform lets you control covers added to your Tahoma or Connexoon Box in Home Assistant.

Covers will be added automatically. Please refer to the [component](/components/somfy/) configuration on how to setup Somfy.

### Potential duplicate with the Tahoma component
If you use the [tahoma](/component/tahoma) component, you will have to exclude the covers added by this one. Otherwise they will be added twice.

```yaml
# Example configuration.yaml entry
tahoma:
username: YOUR_USERNAME
password: YOUR_PASSWORD
exclude: ['rts:RollerShutterRTSComponent','rts:CurtainRTSComponent','rts:BlindRTSComponent','rts:VenetianBlindRTSComponent','rts:DualCurtainRTSComponent','rts:ExteriorVenetianBlindRTSComponent','io:ExteriorVenetianBlindIOComponent','io:RollerShutterUnoIOComponent','io:RollerShutterWithLowSpeedManagementIOComponent','io:RollerShutterVeluxIOComponent','io:RollerShutterGenericIOComponent','io:WindowOpenerVeluxIOComponent','io:VerticalExteriorAwningIOComponent','io:HorizontalAwningIOComponent']
```
51 changes: 51 additions & 0 deletions source/_components/somfy.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
layout: page
title: "Somfy"
description: "Instructions on how to setup the Somfy hub within Home Assistant."
date: 2019-06-07 12:00
sidebar: true
comments: false
sharing: true
footer: true
logo: somfy.png
ha_category: Hub
ha_iot_class: "Cloud Polling"
ha_release: 0.95
ha_qa_scale: gold
Copy link
Member

@frenck frenck Jun 18, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The quality scale index is incorrect IMHO. For a gold standard, there should be tests between HA & the integration. Currently, I only see tests for the configuration flow. (which are excluded from the code coverage, which it should NOT have been btw...)

See: https://developers.home-assistant.io/docs/en/integration_quality_scale_index.html

For now, I suggest removing this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you talking about this:

Tests for reading data from/controlling the integration (docs)

What do you think to replace by Silver 🥈 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the coverage, I will see how include my tests.

Copy link
Member

@frenck frenck Jun 18, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well for silver it should:

✅ Connection/configuration is handled via a component.
❌ Set an appropriate SCAN_INTERVAL (if a polling integration)
❌ Raise PlatformNotReady if unable to connect during platform setup (if appropriate)
❓ Handles expiration of auth credentials. Refresh if possible or print correct error and fail setup.
❓ If based on a config entry, should trigger a new config entry flow to re-authorize.
❓ Handles internet unavailable. Log a warning once when unavailable, log once when reconnected.
❓ Handles device/service unavailable. Log a warning once when unavailable, log once when reconnected.
❌ Set available property to False if appropriate (docs)
✅ Entities have unique ID (if available) (docs)

Even though I haven't checked on the question marks, I still see missing things for a silver 🥈

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right. I will remove it. I have still a lot of stuff to do it seems.
Sadly, it seems that existing component with qa scale don't respect these rules. Do you know a good one?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The QA scale should be correct in the documentation. If you feel like one is incorrect, feel free to raise an issue or open a PR.

Hue & deCONZ are probably good examples.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the information.

---

The Somfy component will allow users to integrate their Somfy devices into Home Assistant using the [official API](https://developer.somfy.com/somfy-open-api/apis), unlike the [tahoma](/components/tahoma/) component.

Check the related components pages for actual devices that are supported.

### {% linkable_title Setting up developer account %}
To connect Somfy, you need to setup a developer account.

1. Vist [https://developer.somfy.com](https://developer.somfy.com)
2. Login using your Somfy credentials
3. Open the *My Apps* menu
4. Add a new App
- App Name: Home Assistant
- Callback URL: `<YOUR_HOME_ASSISTANT_URL>/auth/somfy/callback`
- Description: Home Assistant instance
- Product: Somfy Open API
5. Once Home Assistant restarted, a notification will ask you to log into your Somfy account.

### {% linkable_title Configuration %}
```yaml
# Example configuration.yaml entry
somfy:
client_id: CONSUMER_KEY
client_secret: CONSUMER_SECRET
```

{% configuration %}
client_id:
description: Your Somfy consumer key.
required: true
type: string
client_secret:
description: Your Somfy consumer secret.
required: true
type: string
{% endconfiguration %}
Binary file added source/images/supported_brands/somfy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.