Skip to content

Commit

Permalink
Added EEPs A5-30-01 and A5-30-03
Browse files Browse the repository at this point in the history
  • Loading branch information
grimmpp committed Apr 10, 2024
1 parent 469f4d2 commit 31bb31a
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 7 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ Elatko devices are exemplarily mentioned. You can find [here](https://www.eltako

**Supported sensor EEPs**
* Binary sensor
* A5-07-01 (Occupancy sensor)
* 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)
* D5-00-01 ([Contact sensor](https://github.com/grimmpp/home-assistant-eltako/tree/main//docs/window_sensor_setup_FTS14EM.md), FTS14EM) incl. signal inverter
* A5-07-01 (Occupancy sensor)
* Sensor
* A5-04-01 (Temperature and Humidity Sensor)
* A5-04-02 (Temperature and Humidity Sensor e.g.: FLGTF, FLT58, FFT60)
Expand Down
3 changes: 3 additions & 0 deletions changes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changes and Feature List

## Version 1.4.2 Added EEPs A5-30-01 and A5-30-03
* Added EEPs for digital input with is used in water sensor (FSM60B)

## Version 1.4.1 Support for sending arbitrary messages
* Added Service for sending arbitrary EnOcean (ESP2) messages. Intended to be used in conjunction with [Home Assistant Automations](https://www.home-assistant.io/getting-started/automation/).
* 🐞 Fix for TargetTemperatureSensor (EEP: A5-10-06 and A5-10-12)
Expand Down
60 changes: 56 additions & 4 deletions custom_components/eltako/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,31 @@ async def async_setup_entry(
try:
dev_conf = config_helpers.DeviceConf(entity_config, [CONF_DEVICE_CLASS, CONF_INVERT_SIGNAL])
if dev_conf.eep.eep_string in CONF_EEP_SUPPORTED_BINARY_SENSOR:
entities.append(EltakoBinarySensor(platform_id, gateway, dev_conf.id, dev_conf.name, dev_conf.eep,
dev_conf.get(CONF_DEVICE_CLASS), dev_conf.get(CONF_INVERT_SIGNAL)))
if dev_conf.eep == A5_30_03:
entities.append(EltakoBinarySensor(platform_id, gateway, dev_conf.id, dev_conf.name, dev_conf.eep,
dev_conf.get(CONF_DEVICE_CLASS), dev_conf.get(CONF_INVERT_SIGNAL),
description_key="0"))
entities.append(EltakoBinarySensor(platform_id, gateway, dev_conf.id, dev_conf.name, dev_conf.eep,
dev_conf.get(CONF_DEVICE_CLASS), dev_conf.get(CONF_INVERT_SIGNAL),
description_key="1"))
entities.append(EltakoBinarySensor(platform_id, gateway, dev_conf.id, dev_conf.name, dev_conf.eep,
dev_conf.get(CONF_DEVICE_CLASS), dev_conf.get(CONF_INVERT_SIGNAL),
description_key="2"))
entities.append(EltakoBinarySensor(platform_id, gateway, dev_conf.id, dev_conf.name, dev_conf.eep,
dev_conf.get(CONF_DEVICE_CLASS), dev_conf.get(CONF_INVERT_SIGNAL),
description_key="3"))
entities.append(EltakoBinarySensor(platform_id, gateway, dev_conf.id, dev_conf.name, dev_conf.eep,
dev_conf.get(CONF_DEVICE_CLASS), dev_conf.get(CONF_INVERT_SIGNAL),
description_key="wake"))
elif dev_conf.eep == A5_30_01:
entities.append(EltakoBinarySensor(platform_id, gateway, dev_conf.id, dev_conf.name, dev_conf.eep,
dev_conf.get(CONF_DEVICE_CLASS), dev_conf.get(CONF_INVERT_SIGNAL)))
entities.append(EltakoBinarySensor(platform_id, gateway, dev_conf.id, dev_conf.name, dev_conf.eep,
dev_conf.get(CONF_DEVICE_CLASS), dev_conf.get(CONF_INVERT_SIGNAL),
description_key="low_battery"))
else:
entities.append(EltakoBinarySensor(platform_id, gateway, dev_conf.id, dev_conf.name, dev_conf.eep,
dev_conf.get(CONF_DEVICE_CLASS), dev_conf.get(CONF_INVERT_SIGNAL)))

except Exception as e:
LOGGER.warning("[%s] Could not load configuration for platform_id %s", platform, platform_id)
Expand Down Expand Up @@ -86,11 +109,12 @@ class EltakoBinarySensor(AbstractBinarySensor):
- D5-00-01
"""

def __init__(self, platform: str, gateway: EnOceanGateway, dev_id: AddressExpression, dev_name:str, dev_eep: EEP, device_class: str, invert_signal: bool):
def __init__(self, platform: str, gateway: EnOceanGateway, dev_id: AddressExpression, dev_name:str, dev_eep: EEP, device_class: str, invert_signal: bool, description_key: str=None):
"""Initialize the Eltako binary sensor."""
super().__init__(platform, gateway, dev_id, dev_name, dev_eep)
super().__init__(platform, gateway, dev_id, dev_name, dev_eep, description_key)
self.invert_signal = invert_signal
self._attr_device_class = device_class
self._channel = description_key

if device_class is None or device_class == '':
if dev_eep in [A5_07_01, A5_08_01]:
Expand Down Expand Up @@ -237,6 +261,34 @@ def value_changed(self, msg: ESP2Message):
if self.invert_signal:
self._attr_is_on = not self._attr_is_on

elif self.dev_eep in [A5_30_01]:

if self.description_key == "low_battery":
self._attr_is_on = decoded.low_battery
else:
self._attr_is_on = decoded._contact_closed

if self.invert_signal:
self._attr_is_on = not self._attr_is_on

elif self.dev_eep in [A5_30_03]:

if self.description_key == "0":
self._attr_is_on = decoded.digital_input_0
elif self.description_key == "1":
self._attr_is_on = decoded.digital_input_1
elif self.description_key == "2":
self._attr_is_on = decoded.digital_input_2
elif self.description_key == "3":
self._attr_is_on = decoded.digital_input_3
elif self.description_key == "wake":
self._attr_is_on = decoded.status_of_wake
else:
raise Exception("[%s %s] EEP %s Unknown description key for A5-30-03", Platform.BINARY_SENSOR, str(self.dev_id), A5_30_03.eep_string)

if self.invert_signal:
self._attr_is_on = not self._attr_is_on

else:
LOGGER.warn("[%s %s] EEP %s not found for data processing.", Platform.BINARY_SENSOR, str(self.dev_id), self.dev_eep.eep_string)
return
Expand Down
9 changes: 8 additions & 1 deletion custom_components/eltako/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,14 @@
CONF_LANGUAGE,
)

CONF_EEP_SUPPORTED_BINARY_SENSOR = [F6_02_01.eep_string, F6_02_02.eep_string, F6_10_00.eep_string, D5_00_01.eep_string, A5_07_01.eep_string, A5_08_01.eep_string]
CONF_EEP_SUPPORTED_BINARY_SENSOR = [F6_02_01.eep_string,
F6_02_02.eep_string,
F6_10_00.eep_string,
D5_00_01.eep_string,
A5_07_01.eep_string,
A5_08_01.eep_string,
A5_30_01.eep_string,
A5_30_03.eep_string]
CONF_EEP_SUPPORTED_SENSOR_ROCKER_SWITCH = [F6_02_01.eep_string, F6_02_02.eep_string]

def _get_sender_schema(supported_sender_eep) -> vol.Schema:
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
aiocoap
pyserial-asyncio
eltako14bus==0.0.49
eltako14bus==0.0.51
enocean==0.60.1
homeassistant
termcolor
Expand Down

0 comments on commit 31bb31a

Please sign in to comment.