Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
ab4d1db
Lets give it a try
CoMPaTech Sep 21, 2020
c289125
Spacing
CoMPaTech Sep 21, 2020
30a38cc
Mark todos and early config_flow attempt
CoMPaTech Sep 21, 2020
439d1c7
Attempt at integrating config_flows
CoMPaTech Sep 27, 2020
4532167
Quickfix
CoMPaTech Sep 27, 2020
6c7bb81
Flow improvements (working discovery and manual)
CoMPaTech Sep 27, 2020
9b0e80b
Update translations
CoMPaTech Sep 27, 2020
08f7978
Remove flow_type when selected, correct JSON of translations
CoMPaTech Sep 27, 2020
e0ab2a3
Revert to POLL
CoMPaTech Sep 27, 2020
fd440b6
Merge in switch
CoMPaTech Oct 3, 2020
638bd9d
Fix clash when adding USB when (older configged) Smile(s) present
CoMPaTech Oct 3, 2020
6c66263
Cleanup init, fix missing CONST
CoMPaTech Oct 3, 2020
2cfd599
Fix rebase error (tnx @bouwew) and default choose (as per core)
CoMPaTech Oct 9, 2020
54d8d60
Import missing core
bouwew Oct 9, 2020
e0a2cb1
Fix showing ": flow_network"
bouwew Oct 9, 2020
969a69e
Show USB/Network selection
bouwew Oct 9, 2020
9ba0a85
Don't use common-keys in translation file
bouwew Oct 9, 2020
0413bd2
Change USB-device title to "Stick"
bouwew Oct 9, 2020
a540676
Fix NL translation
bouwew Oct 9, 2020
005ce77
Fix unloading
bouwew Oct 9, 2020
2efd584
Make Options "work" for Stick
bouwew Oct 9, 2020
1e71811
Bump python-plugwise to 2.0.0
brefra Oct 9, 2020
b89f5f7
usb: update to stick-v2.0.0-code
bouwew Oct 10, 2020
447919f
switch: update to stick-v2.0.0-code
bouwew Oct 10, 2020
05e1b7d
strings: use one more common-key
bouwew Oct 10, 2020
e99ccb8
Add stick-services
bouwew Oct 10, 2020
3635037
sensor: integrate stick-code
bouwew Oct 10, 2020
3947438
const: update to stick-v2.0.0-code
bouwew Oct 10, 2020
b6abb6b
binary_sensor: integrate stick-code
bouwew Oct 10, 2020
cd5cbf9
README.md: update w.r.t. adding support for the Stick
bouwew Oct 10, 2020
89e2421
Fix text not shown
bouwew Oct 10, 2020
a854884
Make entry unload and reload work
brefra Oct 11, 2020
a917ceb
config_flow: organize code
bouwew Oct 11, 2020
a54e190
config_flow: clean-up placeholders
bouwew Oct 11, 2020
a15dc62
Use const CONF_BASE
bouwew Oct 11, 2020
8345659
Simplify errors
bouwew Oct 11, 2020
0670bb7
Remove unneeded code
bouwew Oct 12, 2020
62294cf
Use the unique_id-related functions
bouwew Oct 13, 2020
1fe1945
Generalize abort-message
bouwew Oct 13, 2020
8afb527
Copy username-detection from master
bouwew Oct 13, 2020
2f934bd
Copy latest climate-changes from master
bouwew Oct 13, 2020
8d9d151
Revert plugwise_stick_entries-check, change unique_id
bouwew Oct 13, 2020
58c3646
Link to python-plugwise v2.0.2
bouwew Oct 13, 2020
5d1c5a6
Remove unusable device_feature service
brefra Oct 13, 2020
ec47d3a
Apply black formatting
brefra Oct 13, 2020
248db41
Update README.md
brefra Oct 13, 2020
d9d14a8
Bug fixes, clean-up
bouwew Oct 13, 2020
340e29b
Include other translation-file
bouwew Oct 13, 2020
3befe27
Add "already_configured" to error-messages
bouwew Oct 13, 2020
7254d41
Suggestions for README
CoMPaTech Oct 13, 2020
88ff440
Bump because of 115 changes
CoMPaTech Oct 13, 2020
d207f8c
Flake8 cleanup
CoMPaTech Oct 13, 2020
e64b2ff
Pylint, revealing one TODO item and some missing inits
CoMPaTech Oct 13, 2020
a1479cb
Pydocstyle findings
CoMPaTech Oct 13, 2020
6be6f59
Merge branch 'master' into plugwise-stick
bouwew Oct 14, 2020
c49a283
Re-add empty line
bouwew Oct 14, 2020
dc771d5
Remove/optimize notes
bouwew Oct 14, 2020
be721a1
Formatting and small changes
CoMPaTech Oct 14, 2020
ee0d441
No raise_on_progress needed
bouwew Oct 15, 2020
3726ba6
README: small improvements
bouwew Oct 15, 2020
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
58 changes: 42 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@ Our main usage for this module is supporting [Home Assistant](https://www.home-a
[![Generic badge](https://img.shields.io/github/v/release/plugwise/plugwise-beta)](https://github.com/plugwise/plugwise-beta)
[![HASSfest](https://img.shields.io/badge/HASSfest%3F-view-blue.svg)](https://github.com/plugwise/plugwise-beta/actions)

A fully asynchronous approach to supporting Plugwise devices. This repository is **meant** for use of beta-testing.
A fully asynchronous approach to supporting Plugwise devices. This repository is **meant** for use of beta-testing.

## NEW Sept 2020 ##
## NEW Oct 2020 ##
The developer of the Plugwise Stick integration, @brefra, has joined the team. As a result we have added support for the Plugwise Stick.

## Sept 2020 ##
- Add a service: plugwise.delete_notification, this allows you to dismiss a Plugwise Notification from HA Core.
- Support for switching groups created on the Plugwise App has been added, these are available on the Adam with Plugs and on the Stretch.
- Support for the Plugwise Stretch v2 and v3 has been added.
Expand All @@ -27,14 +30,18 @@ PLEASE NOTE: ~~at the moment you will need to remove the existing Core Plugwise
[![Build Status](https://travis-ci.org/plugwise/Plugwise-Smile.svg?branch=master)](https://travis-ci.org/plugwise/Plugwise-Smile)
[![codecov](https://codecov.io/gh/plugwise/Plugwise-Smile/branch/master/graph/badge.svg)](https://codecov.io/gh/plugwise/Plugwise-Smile)
[![PyPI version fury.io](https://badge.fury.io/py/Plugwise-Smile.svg)](https://pypi.python.org/pypi/Plugwise-Smile/)
[![PyPI version fury.io](https://badge.fury.io/py/python-plugwise.svg)](https://pypi.org/pypi/python-plugwise/)

## What do we support (in short)?

- Adam (firmware 2.3 + 3.0) and the accompanying Lisa's, Tom's, Floor's, Koen's and Plugs.
- Smile & Anna (firmware 1.8, 3.1 and 4.0)
- Plugwise Notifications from the Adam and the Anna
- Smile P1 (firmware 2.1, 2.5, 3.3 and 4.0)
- Stretch (firmware 2.3 and 3.1)
- Thermostats
- Adam (firmware 2.x and 3.x) and the accompanying Lisa's, Tom's, Floor's, Koen's and Plugs.
- Anna (firmware 1.x, 3.x and 4.x)
- Notifications for both types
- Power-related
- Smile P1 (firmware 2.x, 3.x and 4.x)
- Stretch (firmware 2.x and 3.x, legacy Circle's and Stealth's)
- Stick (legacy Circle's, Stealth's and Scan's)

## What can I expect in HA Core from this component

Expand All @@ -52,38 +59,52 @@ The `water_heater`-device present in previous releases has been replaced by an A

## How to add the integration to HA Core

For each Plugwise Smile (i.e. gateway) you will have to add it as an integration. For instance if you have an Adam and a Smile P1, you have to add them individually. If you have an Anna and an Adam, do not add the Anna, only add the Adam.
For each Plugwise Smile (i.e. gateway) you will have to add it as an integration. For instance if you have an Adam and a Smile P1, you have to add them individually. If you have an Anna and an Adam, **do not add the Anna**, only add the Adam.

- [ ] In Home Assitant click on `Configuration`
- [ ] Click on `Integrations`
- [ ] You should see one or more discovered Smiles
- [ ] Click the `Configure` button and enter the Smile ID
- [ ] Click Add to see the magic happens

If there is no discovered Smile present:
If there is no discovered Smile present or you are using the USB stick:

- [ ] Hit the `+` button in the right lower corner
- [ ] Search or browse for 'Plugwise beta' and click it
- [ ] Enter your Smile IP-address and the 8 character ID of the smile
- [ ] Click Add and hopefully the magic happens
- [ ] Repeat this process to add more Smiles
- [ ] Select the type of integration: Network or USB

- For the Network-selection:

- [ ] Enter your Smile IP-address and the 8 character ID of the smile
- [ ] Click SUBMIT and FINISH and hopefully the magic happens
- [ ] Repeat this process to add more Smiles

HA Core wil continue to ask you if you want to put your Smile and detected other devices in area's and presto, things should be available to configure in lovelace.
- For the USB-selection:

- [ ] Select or enter the USB-path
- [ ] Click SUBMIT and FINISH

The config flow will then continue to ask you if you want to put your Smile and detected other devices in area's and presto, things should be available to configure in lovelace.

## Options ##

Using the OPTIONS-button, the default Smile-data refresh-interval can be modified.
Using the OPTIONS-button, the default Smile-data refresh-interval can be modified. There are no OPTIONS available for the Stick.

# I don't like the name of the sensor or the icon

You can adjust these in `Configuration`, `Integration` -> `Entities` (e.g. `https://{Your HA address}/config/entities`)

Just click on the device and adjust accordingly!

Please note that you can also click the cogwheel right top corner to rename all entities of a device at once.

# It doesn't work

If you notice issuess, we are on discord and on the Community. You can also create an Issue in these repos:
If you notice issuess, we are on Discord and on the (Community forums)[https://community.home-assistant.io/t/plugwise-smile-custom-component-beta/183560]. You can also create an Issue in these repos:

- [plugwise-beta](https://github.com/plugwise/plugwise-beta) - the `custom_component` for HA Core
- [Plugwise-Smile](https://github.com/plugwise/Plugwise-Smile) - the python module interfacing between the plugwise component and your Smile
- [python-plugwise](https://github.com/plugwise/python-plugwise) - the python module interfacing with the plugwise USB-stick

# Smile?

Expand All @@ -97,8 +118,13 @@ Results of our tests are checked by Travis, click the left button (the one that

# ~~There is Anna support in HA Core already~~ Replaced by the new Plugwise component, based on this beta-version.

And from the original sources by @laetificat it was improved upon and upstreamed by @CoMPaTech and improved and maintained by @bouwew
From the original sources by @laetificat it was improved upon and upstreamed by @CoMPaTech. Right after that @bouwew joined to improve and help maintain the code. As of 2020 @brefra joined so we have a full range of Plugwise products supported.

As things like async were in high demand from HA Core, desired by the original author and a great challenge for us we rewrote it largely. The Plugwise Smile Beta repository (accompanying the Plugwise-Smile python module) is intended for development purposes, just as `anna-ha` was for `haanna` (respectively the original before upstreaming and original python module).

With the three combined forces we now support, maintain and improve on:
- `plugwise-beta` (this repository) for beta-testing new features to go into the `plugwise`-integration for HA
- `Plugwise-Smile` for connectivity with the Smile (Adam, Anna and P1) and Stretch products (i.e. the new Plugs)
- `python-plugwise` for connectivity with the Stick (USB-device) (i.e. the old Plugs: Circle(+), Stealths and Scans)

And yes anna-ha with haanna (to some degree) support Anna v1.8 - but they don't support Adam nor the Smile P1
37 changes: 17 additions & 20 deletions custom_components/plugwise/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Plugwise platform for Home Assistant Core."""

import asyncio
import logging

import voluptuous as vol
Expand All @@ -9,8 +8,13 @@
from homeassistant.const import CONF_HOST
from homeassistant.core import HomeAssistant

from .const import ALL_PLATFORMS, DOMAIN, UNDO_UPDATE_LISTENER
from .gateway import async_setup_entry_gw
from .const import (
CONF_USB_PATH,
DOMAIN,
)

from .gateway import async_setup_entry_gw, async_unload_entry_gw
from .usb import async_setup_entry_usb, async_unload_entry_usb

CONFIG_SCHEMA = vol.Schema({DOMAIN: vol.Schema({})}, extra=vol.ALLOW_EXTRA)

Expand All @@ -21,27 +25,20 @@ async def async_setup(hass: HomeAssistant, config: dict):
"""Set up the Plugwise platform."""
return True


async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Set up Plugwise components from a config entry."""
if entry.data.get(CONF_HOST):
return await async_setup_entry_gw(hass, entry)
# PLACEHOLDER USB entry setup
if entry.data.get(CONF_USB_PATH):
return await async_setup_entry_usb(hass, entry)
return False


async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry):
"""Unload a config entry."""
unload_ok = all(
await asyncio.gather(
*[
hass.config_entries.async_forward_entry_unload(entry, component)
for component in ALL_PLATFORMS
]
)
)

hass.data[DOMAIN][entry.entry_id][UNDO_UPDATE_LISTENER]()

if unload_ok:
hass.data[DOMAIN].pop(entry.entry_id)

return unload_ok
"""Unload the Plugwise components."""
if entry.data.get(CONF_HOST):
return await async_unload_entry_gw(hass, entry)
if entry.data.get(CONF_USB_PATH):
return await async_unload_entry_usb(hass, entry)
return False
Loading