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

fixes #35

Closed
wants to merge 76 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
815d1f9
first code as-is
Apr 24, 2023
fbea4cc
first code as-is
Apr 24, 2023
246b3f9
updates...
CyrilP Apr 25, 2023
9a2688c
add logger
CyrilP Apr 25, 2023
6227c17
fix messages in config flox
CyrilP Apr 25, 2023
4f78fbc
async connection test
CyrilP Apr 25, 2023
d1e3c53
async connection test
CyrilP Apr 26, 2023
427942d
add some messages parsing
CyrilP Apr 26, 2023
3392062
get tydom credentials from Delta Dore
CyrilP Apr 27, 2023
0da66be
update readme
CyrilP Apr 27, 2023
38d7090
update readme
CyrilP Apr 27, 2023
de22b07
update readme
CyrilP Apr 27, 2023
2b2bd5a
update readme
CyrilP Apr 27, 2023
7b1cb1b
update readme
CyrilP Apr 27, 2023
e4e0a01
update readme
CyrilP Apr 27, 2023
5e54508
update config
CyrilP Apr 27, 2023
3884e9b
remove useless code
CyrilP Apr 27, 2023
a86b026
update docs/translations
CyrilP Apr 28, 2023
621420d
cleanup
CyrilP Apr 28, 2023
befbde8
add logs + ping
Apr 28, 2023
79a21ed
updates
May 5, 2023
7a8c03a
fix update
May 5, 2023
b40ef82
conso sensor
May 9, 2023
feaa33b
updates
May 10, 2023
c6180f5
add climate, cleanup
May 15, 2023
a43a3ff
fix
May 15, 2023
79ff66e
more functionnalities
May 16, 2023
14ec8ea
update
Jun 7, 2023
fe8a54e
update
CyrilP Aug 11, 2023
245a067
cleanup
CyrilP Aug 11, 2023
9d303e3
update readme
CyrilP Aug 11, 2023
2db1656
add areas calls
CyrilP Aug 11, 2023
6d03d7c
add cover tilt, try api mode, implement other messages
CyrilP Aug 21, 2023
cf7cb51
update documentation
CyrilP Aug 21, 2023
26d84ab
remove useless code
CyrilP Aug 21, 2023
f19cfbf
fix slope
CyrilP Aug 21, 2023
0604526
updates
CyrilP Sep 6, 2023
9555eb7
various updates
CyrilP Sep 17, 2023
e972b5a
set some sensors as DIAGNOSTIC
CyrilP Sep 18, 2023
7aa0e62
fix multiple dhcp discoveries
CyrilP Sep 19, 2023
b4bfa5d
cleanup
CyrilP Sep 24, 2023
4b9750c
add tydom bridge, various updates
CyrilP Oct 4, 2023
72e7356
cleanup
CyrilP Oct 16, 2023
d7a1272
fix gateway, rename device
CyrilP Oct 16, 2023
d5bb8e1
register conso and gateway manually
CyrilP Oct 16, 2023
b67c2ff
refactor
CyrilP Oct 17, 2023
ef31c29
update readme
CyrilP Oct 17, 2023
9d35770
update readme
CyrilP Oct 17, 2023
1d0c036
update tydom password
CyrilP Oct 17, 2023
310bdf5
cleanup logs
CyrilP Oct 22, 2023
3a5cc68
update
CyrilP Oct 22, 2023
7b41f3e
fix set boiler temperature
CyrilP Oct 22, 2023
db16922
get metadata for devices, cleanup, min/max temp for climate entity, f…
CyrilP Oct 22, 2023
b5875b0
 cleanup
CyrilP Oct 22, 2023
b9de69f
 cleanup
CyrilP Oct 22, 2023
0d36daf
 cleanup
CyrilP Oct 22, 2023
50ef37c
 fix climate, cleanup
CyrilP Oct 30, 2023
acd18ed
Merge branch 'main' into new
CyrilP Oct 30, 2023
6b2599e
 fix ruff errors
CyrilP Oct 31, 2023
f4d87b4
Merge branch 'new' of github.com:CyrilP/hass-deltadore-tydom-componen…
CyrilP Oct 31, 2023
baba5a1
 fix ruff errors
CyrilP Oct 31, 2023
4bdace3
 fix ruff errors
CyrilP Oct 31, 2023
cac989c
 fix ruff errors
CyrilP Oct 31, 2023
37d9ec9
 fix ruff errors
CyrilP Oct 31, 2023
f55bc22
 fix ruff errors
CyrilP Oct 31, 2023
210a259
 fix ruff errors
CyrilP Oct 31, 2023
80129c0
 cleanup
CyrilP Oct 31, 2023
00b64e3
 fix ruff errors
CyrilP Oct 31, 2023
1147887
 update manifest
CyrilP Oct 31, 2023
63a036c
 fix hassfest error
CyrilP Oct 31, 2023
47b0a22
 add dependencies
CyrilP Nov 7, 2023
ca06f4f
 fix order
CyrilP Nov 7, 2023
f8ec344
 fix order
CyrilP Nov 7, 2023
c4a9953
 fix local mode connection
CyrilP Nov 9, 2023
e86dbf8
 fix config flow
CyrilP Nov 9, 2023
74ca428
 fix manifest
CyrilP Nov 9, 2023
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
2 changes: 1 addition & 1 deletion .devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@
},
"remoteUser": "vscode",
"features": {
"rust": "latest"
"ghcr.io/devcontainers/features/rust:latest": {}
}
}
106 changes: 71 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,47 +1,83 @@
# Notice
# Delta Dore Tydom

The component and platforms in this repository are not meant to be used by a
user, but as a "blueprint" that custom component developers can build
upon, to make more awesome stuff.
[![License][license-shield]](LICENSE)

HAVE FUN! 😎
[![BuyMeCoffee][buymecoffeebadge]][buymecoffee]

## Why?
This a *custom component* for [Home Assistant](https://www.home-assistant.io/).

This is simple, by having custom_components look (README + structure) the same
it is easier for developers to help each other and for users to start using them.
The `Delta Dore Tydom` integration allows you to observe and control [Delta Dore Tydom smart home gateway](https://www.deltadore.fr/).

If you are a developer and you want to add things to this "blueprint" that you think more
developers will have use for, please open a PR to add it :)
This integration can work in local mode or cloud mode depending on how the integration is configured (see Configuration part)
The Delta Dore gateway can be detected using dhcp discovery.

## What?
![GitHub release](https://img.shields.io/github/release/CyrilP/hass-deltadore-tydom-component)
[![hacs_badge](https://img.shields.io/badge/HACS-Default-orange.svg)](https://github.com/hacs/integration)

This repository contains multiple files, here is a overview:
**This integration will set up the following platforms.**

File | Purpose | Documentation
-- | -- | --
`.devcontainer.json` | Used for development/testing with Visual Studio Code. | [Documentation](https://code.visualstudio.com/docs/remote/containers)
`.github/ISSUE_TEMPLATE/*.yml` | Templates for the issue tracker | [Documentation](https://help.github.com/en/github/building-a-strong-community/configuring-issue-templates-for-your-repository)
`.vscode/tasks.json` | Tasks for the devcontainer. | [Documentation](https://code.visualstudio.com/docs/editor/tasks)
`custom_components/integration_blueprint/*` | Integration files, this is where everything happens. | [Documentation](https://developers.home-assistant.io/docs/creating_component_index)
`CONTRIBUTING.md` | Guidelines on how to contribute. | [Documentation](https://help.github.com/en/github/building-a-strong-community/setting-guidelines-for-repository-contributors)
`LICENSE` | The license file for the project. | [Documentation](https://help.github.com/en/github/creating-cloning-and-archiving-repositories/licensing-a-repository)
`README.md` | The file you are reading now, should contain info about the integration, installation and configuration instructions. | [Documentation](https://help.github.com/en/github/writing-on-github/basic-writing-and-formatting-syntax)
`requirements.txt` | Python packages used for development/lint/testing this integration. | [Documentation](https://pip.pypa.io/en/stable/user_guide/#requirements-files)
Platform | Description
-- | --
`binary_sensor` | Show something `True` or `False`.
`sensor` | Show info.
`switch` | Switch something `True` or `False`.
`cover` | controls an opening or cover.
`climate` | controls temperature, humidity, or fans.
`light` | controls a light.
`lock` | controls a lock.
`alarm_control_panel` | controls an alarm.
`update` | firmware update

## How?
**This integration has been tested with the following hardware.**

1. Create a new repository in GitHub, using this repository as a template by clicking the "Use this template" button in the GitHub UI.
1. Open your new repository in Visual Studio Code devcontainer (Preferably with the "`Dev Containers: Clone Repository in Named Container Volume...`" option).
1. Rename all instances of the `integration_blueprint` to `custom_components/<your_integration_domain>` (e.g. `custom_components/awesome_integration`).
1. Rename all instances of the `Integration Blueprint` to `<Your Integration Name>` (e.g. `Awesome Integration`).
1. Run the `scrtipts/develop` to start HA and test out your new integration.
- Cover (Up/Down/Stop)
- Tywatt 5400
- Tyxal+ DFR
- K-Line DVI (windows, door)
- Typass ATL (zones temperatures, target temperature, mode (Auto mode is used for antifrost), water/heat power usage) with Tybox 5101

## Next steps
Some other functions may also work or only report attributes.

These are some next steps you may want to look into:
- Add tests to your integration, [`pytest-homeassistant-custom-component`](https://github.com/MatthewFlamm/pytest-homeassistant-custom-component) can help you get started.
- Add brand images (logo/icon) to https://github.com/home-assistant/brands.
- Create your first release.
- Share your integration on the [Home Assistant Forum](https://community.home-assistant.io/).
- Submit your integration to the [HACS](https://hacs.xyz/docs/publish/start).
## Installation

The preferred way to install the Delta Dore Tydom integration is by addig it using HACS.

Add your device via the Integration menu

[![Open your Home Assistant instance and start setting up a new integration.](https://my.home-assistant.io/badges/config_flow_start.svg)](https://my.home-assistant.io/redirect/config_flow_start/?domain=deltadore-tydom)

Manual method :

1. Using the tool of choice open the directory (folder) for your HA configuration (where you find `configuration.yaml`).
1. If you do not have a `custom_components` directory (folder) there, you need to create it.
1. In the `custom_components` directory (folder) create a new folder called `deltadore-tydom`.
1. Download _all_ the files from the `custom_components/deltadore-tydom/` directory (folder) in this repository.
1. Place the files you downloaded in the new directory (folder) you created.
1. Restart Home Assistant
1. In the HA UI go to "Configuration" -> "Integrations" click "+" and search for "Delta Dore Tydom"

## Configuration is done in the UI

<!---->
The hostname/ip can be :
* The hostname/ip of your Tydom (local mode only). An access to the cloud is done to retrieve the Tydom credentials
* mediation.tydom.com. Using this configuration makes the integration work through the cloud

The Mac address is the Mac of you Tydom

Email/Password are you Dela Dore credentials

The alarm PIN is optional and used to set your alarm mode

## Contributions are welcome!

If you want to contribute to this please read the [Contribution guidelines](CONTRIBUTING.md)

***

[integration_blueprint]: https://github.com/CyrilP/hass-deltadore-tydom-component
[buymecoffee]: https://www.buymeacoffee.com/cyrilp
[buymecoffeebadge]: https://img.shields.io/badge/buy%20me%20a%20coffee-donate-yellow.svg?style=for-the-badge
[exampleimg]: example.png
[forum]: https://community.home-assistant.io/
[license-shield]: https://img.shields.io/github/license/CyrilP/hass-deltadore-tydom-component.svg?style=for-the-badge
59 changes: 0 additions & 59 deletions README_EXAMPLE.md

This file was deleted.

4 changes: 3 additions & 1 deletion config/configuration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ default_config:
logger:
default: info
logs:
custom_components.integration_blueprint: debug
custom_components.deltadore-tydom: debug

# demo:
72 changes: 72 additions & 0 deletions custom_components/deltadore-tydom/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
"""The Detailed Delta Dore Tydom Push integration."""
from __future__ import annotations

from homeassistant.const import CONF_HOST, CONF_MAC, CONF_PIN, Platform
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import ConfigEntryNotReady

from . import hub
from .const import DOMAIN, CONF_TYDOM_PASSWORD

# List of platforms to support. There should be a matching .py file for each,
# eg <cover.py> and <sensor.py>
PLATFORMS: list[str] = [
# Platform.ALARM_CONTROL_PANEL,
Platform.CLIMATE,
Platform.COVER,
Platform.SENSOR,
Platform.LOCK,
Platform.LIGHT,
Platform.UPDATE,
]


async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Set up Delta Dore Tydom from a config entry."""
# Store an instance of the "connecting" class that does the work of speaking
# with your actual devices.
pin = None
if CONF_PIN in entry.data:
pin = entry.data[CONF_PIN]

tydom_hub = hub.Hub(
hass,
entry.data[CONF_HOST],
entry.data[CONF_MAC],
entry.data[CONF_TYDOM_PASSWORD],
pin,
)
hass.data.setdefault(DOMAIN, {})[entry.entry_id] = tydom_hub

try:
connection = await tydom_hub.connect()
entry.async_create_background_task(
target=tydom_hub.setup(connection), hass=hass, name="Tydom"
)
entry.async_create_background_task(
target=tydom_hub.ping(), hass=hass, name="Tydom ping"
)
entry.async_create_background_task(
target=tydom_hub.refresh_all(), hass=hass, name="Tydom refresh metadata and data"
)

except Exception as err:
raise ConfigEntryNotReady from err

# This creates each HA object for each platform your device requires.
# It's done by calling the `async_setup_entry` function in each platform module.
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
return True


async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Unload a config entry."""
# This is called when an entry/configured device is to be removed. The class
# needs to unload itself, and remove callbacks. See the classes for further
# details
unload_ok = await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
if unload_ok:
hass.data[DOMAIN].pop(entry.entry_id)

return unload_ok
86 changes: 86 additions & 0 deletions custom_components/deltadore-tydom/alarm_control_panel.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
"""Platform for alarm control panel integration."""
from __future__ import annotations

import datetime

from homeassistant.components.manual.alarm_control_panel import ManualAlarm
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
CONF_ARMING_TIME,
CONF_DELAY_TIME,
CONF_TRIGGER_TIME,
STATE_ALARM_ARMED_AWAY,
STATE_ALARM_ARMED_CUSTOM_BYPASS,
STATE_ALARM_ARMED_HOME,
STATE_ALARM_ARMED_NIGHT,
STATE_ALARM_ARMED_VACATION,
STATE_ALARM_DISARMED,
STATE_ALARM_TRIGGERED,
)
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType


async def async_setup_platform(
hass: HomeAssistant,
config: ConfigType,
async_add_entities: AddEntitiesCallback,
discovery_info: DiscoveryInfoType | None = None,
) -> None:
"""Set up the Demo alarm control panel platform."""
async_add_entities(
[
ManualAlarm( # type:ignore[no-untyped-call]
hass,
"Security",
"1234",
None,
True,
False,
{
STATE_ALARM_ARMED_AWAY: {
CONF_ARMING_TIME: datetime.timedelta(seconds=5),
CONF_DELAY_TIME: datetime.timedelta(seconds=0),
CONF_TRIGGER_TIME: datetime.timedelta(seconds=10),
},
STATE_ALARM_ARMED_HOME: {
CONF_ARMING_TIME: datetime.timedelta(seconds=5),
CONF_DELAY_TIME: datetime.timedelta(seconds=0),
CONF_TRIGGER_TIME: datetime.timedelta(seconds=10),
},
STATE_ALARM_ARMED_NIGHT: {
CONF_ARMING_TIME: datetime.timedelta(seconds=5),
CONF_DELAY_TIME: datetime.timedelta(seconds=0),
CONF_TRIGGER_TIME: datetime.timedelta(seconds=10),
},
STATE_ALARM_ARMED_VACATION: {
CONF_ARMING_TIME: datetime.timedelta(seconds=5),
CONF_DELAY_TIME: datetime.timedelta(seconds=0),
CONF_TRIGGER_TIME: datetime.timedelta(seconds=10),
},
STATE_ALARM_DISARMED: {
CONF_DELAY_TIME: datetime.timedelta(seconds=0),
CONF_TRIGGER_TIME: datetime.timedelta(seconds=10),
},
STATE_ALARM_ARMED_CUSTOM_BYPASS: {
CONF_ARMING_TIME: datetime.timedelta(seconds=5),
CONF_DELAY_TIME: datetime.timedelta(seconds=0),
CONF_TRIGGER_TIME: datetime.timedelta(seconds=10),
},
STATE_ALARM_TRIGGERED: {
CONF_ARMING_TIME: datetime.timedelta(seconds=5)
},
},
)
]
)


async def async_setup_entry(
hass: HomeAssistant,
config_entry: ConfigEntry,
async_add_entities: AddEntitiesCallback,
) -> None:
"""Set up the Demo config entry."""
await async_setup_platform(hass, {}, async_add_entities)
19 changes: 19 additions & 0 deletions custom_components/deltadore-tydom/climate.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
"""Platform for sensor integration."""
from __future__ import annotations

from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback

from .const import DOMAIN


async def async_setup_entry(
hass: HomeAssistant,
config_entry: ConfigEntry,
async_add_entities: AddEntitiesCallback,
) -> None:
"""Add climate for passed config_entry in HA."""
hub = hass.data[DOMAIN][config_entry.entry_id]
hub.add_climate_callback = async_add_entities

Loading