Skip to content

Commit

Permalink
Merge branch 'charlesomer-master' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
asantaga committed Jun 17, 2021
2 parents fca3c71 + 2895d9a commit f1bca89
Show file tree
Hide file tree
Showing 7 changed files with 147 additions and 25 deletions.
32 changes: 17 additions & 15 deletions Readme.Md
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
# Wiser Home Assistant Platform v2.6 dev
# Wiser Home Assistant Platform v2.6beta

This repository contains a Home Assistant component + platforms, for the awesome Drayton Wiser Heating solution.

For the latest version of the Wiser Home Assistant Platform please use the `master` branch or better still install via HACS. if you want bleeding edge then checkout the `dev` branch, or look out for beta releases via HACS. Depending on what you choose you may need to use the **Manual Code Installation** described below.


For the latest version of the Wiser Home Assistant Platform please use the `master` branch or better still install via HACS.

if you want bleeding edge then checkout the `dev` branch, or look out for beta releases via HACS.

Depending on what you choose you may need to use the **Manual Code Installation** described below.
For more information checkout the AMAZING community thread available on https://community.home-assistant.io/t/drayton-wiser-home-assistant-integration/80965



Expand Down Expand Up @@ -83,8 +79,6 @@ Depending on what you choose you may need to use the **Manual Code Installation*

We highly recommend using [HACS Home Assistant Community Store](https://github.com/hacs), for more information on how to install HACS please see their documentation website at https://hacs.xyz/



## Manual Code Installation

This method is best used when you want to play with the "latest and greatest" from the repository. Moving forward (post 1.9) , the github repository will contain two primary branches, **master** and dev. Master is the latest released, and hopefully most stable branch, whereas **dev** is the branch that we're currently working on.
Expand Down Expand Up @@ -150,6 +144,8 @@ Before you can use the component you need to find the HeatHub secret key, this i

```boost_time``` is the time (in seconds) for which a boost should be active for, default is 30mins

```setpoint_mode``` modifies the way setpoint works. If left to default the n the functionality is the same as the Wiser app, if set to 'boost' then when you set a new setpoint it will only take affect for the normal "boost" time.

10. When added, you should something like see this in integrations
![](Z:\src\ha_dev\venv_wiser\homeassistant\src\docs\add_configuration_image3.png)

Expand Down Expand Up @@ -375,11 +371,11 @@ An obvious ideal candidate for a Home Assistant automation to remind you to chan

Note : If you power cycle your HomeHub, with more than a minute or so when it is off, we've noticed that the devices will not have the battery info for a short period of time (maybe 30mins to 1hr) , just wait and the battery values will appear.

# Community Recipes
# Community

I've been totally amazed at the community which has sprung up contributing and supporting this component. The [recipes](Recipes.md) following page contains some community contributed ideas / YAML files for Home Assistant.


Checkout the community thread on https://community.home-assistant.io/t/drayton-wiser-home-assistant-integration/80965 for loads of input, comment and participate in our community

# Run, Play

Expand All @@ -393,20 +389,27 @@ Angelo and Team

Special thanks to all the contributors to this project. Special shout to

- @msp1974 : Animated graphics showing which rooms are being heated, Display Presets, support boost (PR38), Async Mode rewrite and loads more! Mark is now part of the core team helping me out whilst I deal with screaming babies wanting food :-)
- @angrycamel : Home/Away Sensor
- @jchasey : Doc changes and support for custom component updater
- @sjtbham : Debugging
- @djbanks : Home/Away switch (v 1.31)
- @msp1974 : Animated graphics showing which rooms are being heated, Display Presets, support boost (PR38), Async Mode rewrite and loads more!
- @nofuse : Constantly helping people out on the community thread



Moving forward (post 1.9) there will be two primary branches, `master` and `dev` . Master will be the primary "production" branch and "dev" will be the branch used for development. Other branches will likely exist where we build code into and then merge into dev, which in turn gets merged into master when all is good and dandy.

# Change log
- 2.6
- 2.6beta
* Added version to manifest.json
* When cancelling boost the setpoint is returned correctly
* New setpoint mode added (thanks @charlesomer)
- 2.5
* Added water scheduling support
* Fixed wiserhub doesnt update on server start
* Upgraded to wiserapi 1.0.10
* Added some new recipies to docs
- 2.4
* Fixed deprecated devices
* code changes to support publishing as a native HA component
Expand All @@ -426,7 +429,7 @@ Moving forward (post 1.9) there will be two primary branches, `master` and `dev`
* Implemented what we think is correct battery percentages depending on device (itrv or roomstat)
* Regression of itrv sensors not having battery voltage fixed
- 2.1

* Minor bug fixes and documentation fixes
- 2.0
* Now supports Home Assistant Config Flow (credit @msp1974)
Expand Down Expand Up @@ -483,4 +486,3 @@ Moving forward (post 1.9) there will be two primary branches, `master` and `dev`
* Added ability to set temperature
* Added ability to set room mode (auto,boost,manual)


108 changes: 105 additions & 3 deletions Recipes.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
# Home Assistant Recipe's

This page documents some Home Assistant recipe's collected from the community - Thank you all
This page documents some Home Assistant recipe's collected from the community, many from this thread on the Home Assistant community website (https://community.home-assistant.io/t/drayton-wiser-home-assistant-integration/80965)

Thank you all

* Collection of Sensors (@phixion)
* Custom Lovelace Card (@phixion)
* Renaming Element names in History Graphs (@DrJohnT & @msp1974)
* Renaming History Graphs Element Names in (@DrJohnT & @msp1974)
* Interacting with custom schedules using the Lovelace UI (@nofuse)
* Linking 3rd Party TRVs/Sensors to Wiser Heating (@carloneb)

## Collection of Sensors ( **[phixion](https://github.com/phixion)**)

------

Following files assume you are separating out you configuration.yaml file into separate files (e.g. sensor.yaml,binary_sensor.yaml etc) as per https://www.home-assistant.io/docs/configuration/splitting_configuration/. if you want you can put these all in a single `configuration.yaml`.


Expand Down Expand Up @@ -93,6 +99,8 @@ sensor.yaml: history_stats spits out unitof measuerment in hours, so here is a s
## Custom Lovelace Card (https://gist.github.com/phixion)
------
![](docs/phixion-card-graphic.png)
Expand Down Expand Up @@ -156,7 +164,9 @@ filter:
state: <101
type: 'custom:auto-entities'
```
# Renaming Element names in History Graphs
# Renaming History Graphs Element Names
------
If you want to rename element names in the history graphs you can. There are two ways you can do this.
Expand Down Expand Up @@ -208,9 +218,101 @@ sensor:
```
if these are added to the history graphs, elements will be named as per the friendly names above.
# Interacting with custom schedules using the Lovelace UI
------
One question popped on the thread was how to switch between different schedules using the UI. This pattern shows how this can be implemented so that you have different schedules and can switch between them in an instant!
Alas there is no way to view the schedules in HomeAssistant, a PR for this would be very welcome!
1. Create a script in Home Assistant
![Script](https://community-assets.home-assistant.io/original/3X/0/3/03716500e28a8e06fef0b82904e0a3e2736588be.png)
2. Create a card in lovelace
![Lovelace](https://community-assets.home-assistant.io/original/3X/c/5/c51c75bd5b22ab993d4ef1b69884ecbc6e319d01.png)
3. Which will eventually look like this on lovelace
![Lovelace2](https://community-assets.home-assistant.io/optimized/3X/7/e/7ec752e6f36f9552fe594fc6ca81f5820a771e50_2_690x317.png)
# Linking 3rd Party TRVs/Sensors to Wiser Heating
------
@carloneb had the following scenario
He has a Drayton Wiser Basic Kit one thermostat in the kitchen but he doesnt have a Wiser TRV in the main room, he does however have a SONOFF Zibbee temperature sensor which is already integrated with Home Assistant. Can he get the heating to trigger the request for heat when the main room is cold? without purchasing a new TRV?
YES YES YES!
## How
Definitions:
In `Configuration.yaml`, defined a new generic thermostat entity for the kitchen: “cucina”. This thermostat is commanding a switch (defined later) which is then triggering the Wiser’s commands. Also, the generic thermostat is linked to the Sonoff Temperature sensor (sensor.t_cucina_temperature).

```yaml
climate:
- platform: generic_thermostat
name: cucina
heater: switch.switch_t_cucina
target_sensor: sensor.t_cucina_temperature
min_temp: 5
max_temp: 30
ac_mode: false
target_temp: 20
cold_tolerance: 0.3
hot_tolerance: 0
initial_hvac_mode: "heat"
```

The switch used by the above thermostat is as follows. It calls the wiser.boost_heating service when on (demanding heat) and sets the wiser to auto when triggered off (target T reached).

```yaml
switch:
- platform: template
switches:
switch_t_cucina:
turn_on:
service: wiser.boost_heating
data:
entity_id: climate.wiser_soggiorno
time_period: 30
temperature: 21
temperature_delta: 1
turn_off:
service: climate.set_hvac_mode
data:
entity_id: climate.wiser_soggiorno
hvac_mode: "auto"
```

Because the main temperature scheduling is owned by the wiser (it’s the master), I’ve created an automation that “copy” the scheduled temperature from the wiser to the Sonoff thermostat at any change.

```yaml
- alias: Set target T cucina
description: Setta la T target di climate.cucina quando la T schedulata wiser cambia, tranne se in boost
condition:
condition: numeric_state
entity_id: climate.wiser_soggiorno
attribute: boost_remaining
below: 1
trigger:
- platform: state
entity_id: sensor.target_t
action:
- service: climate.set_temperature
data:
entity_id: climate.cucina
temperature: "{{ (states('sensor.target_t') | float) }}"
```

In this way I can have both rooms heat following the scheduling set in the Wiser.

![sensors](D:\My\Src\Home\HA Stuff\wiserHomeAssistantPlatform\docs\nonwisersensor_image.jpg)

3 changes: 3 additions & 0 deletions custom_components/wiser/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
from homeassistant.util import ruamel_yaml as yaml, Throttle

from .const import (
CONF_SETPOINT_MODE,
DEFAULT_SETPOINT_MODE,
_LOGGER,
CONF_BOOST_TEMP,
CONF_BOOST_TEMP_TIME,
Expand Down Expand Up @@ -311,6 +313,7 @@ def __init__(self, hass, config_entry):
self.boost_time = config_entry.options.get(
CONF_BOOST_TEMP_TIME, DEFAULT_BOOST_TEMP_TIME
)
self.setpoint_mode = config_entry.options.get(CONF_SETPOINT_MODE, DEFAULT_SETPOINT_MODE)

def connect(self):
"""Connect to Wiser Hub."""
Expand Down
19 changes: 12 additions & 7 deletions custom_components/wiser/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,15 +421,20 @@ async def async_set_temperature(self, **kwargs):
if target_temperature is None:
return False

_LOGGER.info("Setting temperature for %s to %s", self.name, target_temperature)
if self.data.setpoint_mode == "boost":
_LOGGER.info("Setting temperature for %s to %s using boost method.", self.name, target_temperature)

await self.hass.async_add_executor_job(
partial(
self.data.wiserhub.setRoomTemperature, self.room_id, target_temperature,
await self.set_room_mode(self.room_id, "boost", target_temperature)
else:
_LOGGER.info("Setting temperature for %s to %s", self.name, target_temperature)

await self.hass.async_add_executor_job(
partial(
self.data.wiserhub.setRoomTemperature, self.room_id, target_temperature,
)
)
)
self._force_update = True
await self.async_update_ha_state(True)
self._force_update = True
await self.async_update_ha_state(True)

return True

Expand Down
8 changes: 8 additions & 0 deletions custom_components/wiser/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@
_LOGGER,
CONF_BOOST_TEMP,
CONF_BOOST_TEMP_TIME,
CONF_SETPOINT_MODE,
DEFAULT_BOOST_TEMP,
DEFAULT_BOOST_TEMP_TIME,
DEFAULT_SCAN_INTERVAL,
DEFAULT_SETPOINT_MODE,
DOMAIN,
)

Expand Down Expand Up @@ -152,6 +154,12 @@ async def async_step_init(self, user_input=None):
CONF_SCAN_INTERVAL, DEFAULT_SCAN_INTERVAL
),
): int,
vol.Optional(
CONF_SETPOINT_MODE,
default=self.config_entry.options.get(
CONF_SETPOINT_MODE, DEFAULT_SETPOINT_MODE
),
): vol.In([DEFAULT_SETPOINT_MODE, "boost"]),
}
)
return self.async_show_form(step_id="init", data_schema=data_schema)
Expand Down
2 changes: 2 additions & 0 deletions custom_components/wiser/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,12 @@
DEFAULT_BOOST_TEMP = 2
DEFAULT_BOOST_TEMP_TIME = 60
DEFAULT_SCAN_INTERVAL = 30
DEFAULT_SETPOINT_MODE = "normal"

# Custom Configs
CONF_BOOST_TEMP: str = "boost_temp"
CONF_BOOST_TEMP_TIME = "boost_time"
CONF_SETPOINT_MODE = "setpoint_mode"


WEEKDAYS = ["monday", "tuesday", "wednesday", "thursday", "friday"]
Expand Down
Binary file added docs/nonwisersensor_image.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit f1bca89

Please sign in to comment.