Skip to content

Commit

Permalink
Merge pull request #130 from grimmpp/feature-branch
Browse files Browse the repository at this point in the history
Feature branch
  • Loading branch information
grimmpp authored Sep 10, 2024
2 parents f342e8e + d935928 commit f8d4e7d
Show file tree
Hide file tree
Showing 25 changed files with 492 additions and 74 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/hassfest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ jobs:
validate:
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v4"
- uses: "home-assistant/actions/hassfest@master"
- uses: "actions/checkout@v4"
- uses: "home-assistant/actions/hassfest@master"
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,37 +24,38 @@ Elatko devices are exemplarily mentioned. You can find [here](https://www.eltako
* A5-30-01, A5-30-03 (Digital Input - used for water sensor FSM60B)
* F6-02-01 ([Rocker switch](https://github.com/grimmpp/home-assistant-eltako/tree/main/docs/rocker_switch/readme.md), FTS14EM)
* F6-02-02 ([Rocker switch](https://github.com/grimmpp/home-assistant-eltako/tree/main/docs/rocker_switch/readme.md))
* F6-10-00 (Window handle, classic switches or contacs via FTS14EM, window and door contacts like FTKE, supported states: open, closed)
* F6-10-00 (Window handle, classic switches or contacs via FTS14EM, window and door contacts like FTKE, FFTE, supported states: open, closed)
* D5-00-01 ([Contact sensor](https://github.com/grimmpp/home-assistant-eltako/tree/main//docs/window_sensor_setup_FTS14EM.md), FTS14EM) incl. signal inverter
* Sensor
* A5-04-01 (Temperature and Humidity Sensor)
* A5-04-02 (Temperature and Humidity Sensor e.g.: FLGTF, FLT58, FFT60)
* A5-04-03 (Temperature and Humidity Sensor e.g.: FFT60)
* A5-06-01 (Light - Twilight and daylight in one sensor value)
* A5-07-01 (Occupancy sensor)
* A5-07-01 (Occupancy sensor e.g.: FB55EB)
* A5-08-01 (Light-, Temperature-, Occupancy Sensor e.g.: FABH65S, FBH65, FBH65S, FBH65TF)
* A5-09-0C (Air Quality / VOC⁠ (Volatile Organic Compounds) e.g. [FLGTF](https://github.com/grimmpp/home-assistant-eltako/tree/main/docs/flgtf_temp_humidity_air_quality/readme.md))
* A5-10-03 (Temperature Sensor and Controller e.g. FTR78S)
* A5-10-06 (Temperature Sensor and Controller e.g. FUTH)
* A5-10-12 (Temperature Sensor and Controller and Humidity Sensor e.g. FUTH)
* A5-12-01 (Automated meter reading - electricity, FSDG14)
* A5-12-01 (Automated meter reading - electricity, FWZ12, FSDG14, [FSR14M-2x](https://github.com/grimmpp/home-assistant-eltako/tree/main/docs/relays-and-switches/readme.md))
* A5-12-02 (Automated meter reading - gas, F3Z14D)
* A5-12-03 (Automated meter reading - water, F3Z14D)
* A5-13-01 (Weather station, FWG14)
* F6-10-00 (Window handle, classic switches or contacs via FTS14EM, window and door contacts like FTKE, supported states: open, closed, tilt)
* [Light](https://github.com/grimmpp/home-assistant-eltako/tree/main/docs/lights-tutorial/readme.md)
* A5-38-08 (Dimmable Light: Central command - gateway, FUD14)
* M5-38-08 (Switchable Light: Eltako relay, FSR14)
* Switch
* [Switch](https://github.com/grimmpp/home-assistant-eltako/tree/main/docs/relays-and-switches/readme.md)
* M5-38-08 (Eltako relay, FSR14)
* F6-02-01 and F6-02-02
* Cover
* G5-3F-7F (Eltako cover, FSB14)
* G5-3F-7F (Eltako cover, FSB14, FSB61, FSB71, FJ62)

**Supported sender EEPs**
* [Light](https://github.com/grimmpp/home-assistant-eltako/tree/main/docs/lights-tutorial/readme.md)
* A5-38-08 (Central command - gateway, FUD14) PREFERRED!!!
* F6-02-01 and F6-02-02 (Rocker switch - function 02 'direct pushbutton top on' default left) / (only as switch not for dimmable lights.)
* Switch
* [Switch](https://github.com/grimmpp/home-assistant-eltako/tree/main/docs/relays-and-switches/readme.md)
* A5-38-08 (Central command) PREFERRED!!!
* F6-02-01 and F6-02-02 (Rocker switch - function 02 'direct pushbutton top on' default left)
* Cover
Expand Down
2 changes: 2 additions & 0 deletions backlog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

* raise warning if base id of gateway differs for those where base id can be detected.
16 changes: 16 additions & 0 deletions changes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Changes and Feature List

## Version 1.5.8
* Fixed dependency incompatibility with HA 2024.9

## Version 1.5.7
* Tested new devices: FB55EB, FWZ12
* Added EEP F6-01-01 and tested FMH1W

## Version 1.5.6 Added EEP A5-10-03 for current and target temperature
* Only for sensors available

## Version 1.5.5 Added message-delay for GWs as config parameter
* Added argument `message_delay` to config distance of bulk messages being translated in the gateway so that buffer overflows can be prevented.

## Version 1.5.4 Cover motion fixed
* changed min movement time from 0 to 1 so that covers won't move completely up or down.

## Version 1.5.3 Added auto-reconnect for GWs as config parameter
* Added argument `auto_reconnect` to disable auto-reconnect for all Gateways

Expand Down
24 changes: 24 additions & 0 deletions custom_components/eltako/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,30 @@ def value_changed(self, msg: ESP2Message):
self.schedule_update_ha_state()

return

elif self.dev_eep in [F6_01_01]:

# fire event
switch_address = config_helpers.format_address((msg.address, None))
event_id = config_helpers.get_bus_event_type(self.gateway.dev_id, EVENT_BUTTON_PRESSED, AddressExpression((msg.address, None)))
event_data = {
"id": event_id,
"data": int.from_bytes(msg.data, "big"),
"switch_address": switch_address,
"pressed": decoded.button_pushed,
}
LOGGER.debug("[%s %s] Send event: %s, pushed down: %s", Platform.BINARY_SENSOR, str(self.dev_id), event_id, str(decoded.button_pushed))
self.hass.bus.fire(event_id, event_data)

# Show status change in HA. It will only for the moment when the button is pushed down.
if not self.invert_signal:
self._attr_is_on = decoded.button_pushed
else:
self._attr_is_on = not ( decoded.button_pushed )
self.schedule_update_ha_state()

return

elif self.dev_eep in [F6_10_00]:
# LOGGER.debug("[Binary Sensor][%s] Received msg for processing eep %s telegram.", b2s(self.dev_id[0]), self.dev_eep.eep_string)

Expand Down
17 changes: 13 additions & 4 deletions custom_components/eltako/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class EltakoFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
"""Handle the Eltako config flows."""

VERSION = 1
MINOR_VERSION = 1
MANUAL_PATH_VALUE = "Custom path"

def __init__(self) -> None:
Expand All @@ -34,14 +35,17 @@ def is_input_available(self, user_input) -> bool:
async def async_step_user(self, user_input=None):
"""Handle an Eltako config flow start."""
# is called when adding a new gateway
LOGGER.debug("config_flow user step started.")
return await self.async_step_detect()

async def async_step_detect(self, user_input=None):
"""Propose a list of detected gateways."""
LOGGER.debug("config_flow detect step started.")
return await self.manual_selection_routine(user_input)

async def async_step_manual(self, user_input=None):
"""Request manual USB gateway path."""
LOGGER.debug("config_flow manual step started.")
return await self.manual_selection_routine(user_input, manual_setp=True)

async def manual_selection_routine(self, user_input=None, manual_setp:bool=False):
Expand All @@ -54,6 +58,7 @@ async def manual_selection_routine(self, user_input=None, manual_setp:bool=False

# ensure data entry is set
if DATA_ELTAKO not in self.hass.data:
LOGGER.debug("No configuration available.")
self.hass.data.setdefault(DATA_ELTAKO, {})

# goes recursively ...
Expand All @@ -74,6 +79,7 @@ async def manual_selection_routine(self, user_input=None, manual_setp:bool=False
g_list = list([g for g in g_list_dict.values() if g not in self.hass.data[DATA_ELTAKO]])
LOGGER.debug("Available gateways to be added: %s", g_list)
if len(g_list) == 0:
LOGGER.debug("No gateways are configured in the 'configuration.yaml'.")
errors = {CONF_GATEWAY_DESCRIPTION: ERROR_NO_GATEWAY_CONFIGURATION_AVAILABLE}

# add manually added serial paths and ip addresses from configuration
Expand All @@ -88,25 +94,28 @@ async def manual_selection_routine(self, user_input=None, manual_setp:bool=False
device_registry = dr.async_get(self.hass)
serial_paths_of_registered_gateways = await gateway.async_get_serial_path_of_registered_gateway(device_registry)
serial_paths = list(set([sp for sp in serial_paths if sp not in serial_paths_of_registered_gateways]))
LOGGER.debug("Available serial paths: %s", serial_paths)
LOGGER.debug("Available serial paths/IP addresses: %s", serial_paths)

if manual_setp or len(serial_paths) == 0:
# errors = {CONF_SERIAL_PATH: ERROR_NO_SERIAL_PATH_AVAILABLE}
LOGGER.debug("No usb port or any manually configured address available.")
errors = {CONF_SERIAL_PATH: ERROR_NO_SERIAL_PATH_AVAILABLE}

return self.async_show_form(
step_id="manual",
data_schema=vol.Schema({
vol.Required(CONF_GATEWAY_DESCRIPTION, msg="EnOcean Gateway", description="Gateway to be initialized."): vol.In(g_list),
vol.Required(CONF_SERIAL_PATH, msg="Serial Port", description="Serial path for selected gateway."): str
vol.Required(CONF_SERIAL_PATH, msg="Serial Port/IP Address", description="Serial path/IP address for selected gateway."): str
}),
errors=errors,
)


# show form in which gateways and serial paths are displayed so that a mapping can be selected.
return self.async_show_form(
step_id="detect",
data_schema=vol.Schema({
vol.Required(CONF_GATEWAY_DESCRIPTION, msg="EnOcean Gateway", description="Gateway to be initialized."): vol.In(g_list),
vol.Required(CONF_SERIAL_PATH, msg="Serial Port", description="Serial path for selected gateway."): vol.In(serial_paths),
vol.Required(CONF_SERIAL_PATH, msg="Serial Port/IP Address", description="Serial path/IP address for selected gateway."): vol.In(serial_paths),
}),
errors=errors,
)
Expand Down
4 changes: 2 additions & 2 deletions custom_components/eltako/config_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ def __init__(self, config: ConfigType, extra_keys:list[str]=[]):
if ek in config:
setattr(self, ek, config.get(ek))

def get(self, key: str):
return super().get(key, None)
def get(self, key: str, default = None):
return super().get(key, default)

def get_device_conf(config: ConfigType, key: str, extra_keys:list[str]=[]) -> DeviceConf:
if config is not None:
Expand Down
3 changes: 3 additions & 0 deletions custom_components/eltako/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@
CONF_DEVICE_TYPE: Final = "device_type"
CONF_SERIAL_PATH: Final = "serial_path"
CONF_GATEWAY_ADDRESS: Final = "address"
CONF_GATEWAY_MESSAGE_DELAY: Final = "message_delay"

CONF_GATEWAY_AUTO_RECONNECT: Final = "auto_reconnect"
CONF_GATEWAY_PORT: Final = "port"
CONF_CUSTOM_SERIAL_PATH: Final = "custom_serial_path"
Expand All @@ -57,6 +59,7 @@
CONF_METER_TARIFFS: Final = "meter_tariffs"
CONF_TIME_CLOSES: Final = "time_closes"
CONF_TIME_OPENS: Final = "time_opens"
CONF_TIME_TILTS: Final = "time_tilts"
CONF_INVERT_SIGNAL: Final = "invert_signal"
CONF_VOC_TYPE_INDEXES: Final = "voc_type_indexes"

Expand Down
Loading

0 comments on commit f8d4e7d

Please sign in to comment.