Skip to content

Commit

Permalink
Bump hahomematic to 2024.10.17 (#751)
Browse files Browse the repository at this point in the history
* Bump hahomematic to 2024.10.17

* Add issue messages

* Update test_recorder.py
  • Loading branch information
SukramJ authored Oct 29, 2024
1 parent 6c66b45 commit ecc1d6d
Show file tree
Hide file tree
Showing 20 changed files with 210 additions and 244 deletions.
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,18 @@ The `ERROR*` parameters are evaluated for this event type in the backend.
Go to the devices page of the integration and select a device. Click the three-dot menu at the button and press Delete.
This will only delete the device from Home Assistant and not from the CCU.

### What is the meaning of `XmlRPC-Server received no events`?
### What is the meaning of `Error fetching initial data` / `Fehler beim Abrufen der Anfangsdaten`?

This integration uses a [REGA script](https://github.com/danielperna84/hahomematic/blob/devel/hahomematic/rega_scripts/fetch_all_device_data.fn) to fetch as much data in a single call as possible, to avoid multiple request to get the required initial data.
In rare cases the output of the script can be invalid, so a further processing is not possible, and the fallback solution is to fetch all required data with individual calls, that cause a higher duty cycle during the start phase of the integration.

This problem can be analysed by executing the [REGA script](https://github.com/danielperna84/hahomematic/blob/devel/hahomematic/rega_scripts/fetch_all_device_data.fn) in the CCU. The parameter ##interface## (line 17) must be replaced with the interface mention from the poped-up issue. The expected result is a valid json.
Search (search for GET_ALL_DEVICE_DATA) within the issue tracker and discussion forum for related items.

Please don't create an issue, because this is not an issue with the integration.
Use an existing discussion or start a new one, and attach the result of the executed REGA script.

### What is the meaning of `XmlRPC-Server received no events` / `XmlRPC-Server empfängt keine Ereignisse`?

This integration does not fetch new updates from the backend, it **receives** state changes and new values for devices from the backend by the XmlRPC server.

Expand All @@ -546,7 +557,7 @@ This persistent notification is only displayed in HA if the received PONG events

So the message means there is a problem in the communication from the backend to HA that was **identified** by the integration but not **caused**.

### What is the meaning of `Ping/Pong Mismatch on Interface`?
### What is the meaning of `Pending Pong mismatch on interface` / `Austehende Pong Ereignisse auf Interface`?

Only relevant for CCU.

Expand Down
5 changes: 4 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# Version 1.69.0 (2024-10-27)
- Bump hahomematic to 2024.10.16
- Bump hahomematic to 2024.10.17
- Fire interface event, if data could not be fetched with script from CCU
- Optimize MASTER data load
- Rename model to better distinguish from HA
- Use enum for json/event keys
- Add missing action icons
- Follow backend changes
- Use enum for services

# Version 1.68.1 (2024-10-26)
- Bump hahomematic to 2024.10.14
Expand Down
36 changes: 12 additions & 24 deletions custom_components/homematicip_local/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,7 @@
from homeassistant.helpers.entity_platform import AddEntitiesCallback

from . import HomematicConfigEntry
from .const import (
SERVICE_COPY_SCHEDULE,
SERVICE_COPY_SCHEDULE_PROFILE,
SERVICE_DISABLE_AWAY_MODE,
SERVICE_ENABLE_AWAY_MODE_BY_CALENDAR,
SERVICE_ENABLE_AWAY_MODE_BY_DURATION,
SERVICE_GET_SCHEDULE_PROFILE,
SERVICE_GET_SCHEDULE_PROFILE_WEEKDAY,
SERVICE_SET_SCHEDULE_PROFILE,
SERVICE_SET_SCHEDULE_PROFILE_WEEKDAY,
SERVICE_SET_SCHEDULE_SIMPLE_PROFILE,
SERVICE_SET_SCHEDULE_SIMPLE_PROFILE_WEEKDAY,
)
from .const import HmipLocalServices
from .control_unit import ControlUnit, signal_new_data_point
from .generic_entity import HaHomematicGenericEntity, HaHomematicGenericRestoreEntity

Expand Down Expand Up @@ -143,7 +131,7 @@ def async_add_climate(data_points: tuple[BaseCustomDpClimate, ...]) -> None:
platform = entity_platform.async_get_current_platform()

platform.async_register_entity_service(
name=SERVICE_ENABLE_AWAY_MODE_BY_CALENDAR,
name=HmipLocalServices.ENABLE_AWAY_MODE_BY_CALENDAR,
schema={
vol.Optional(ATTR_AWAY_START): cv.datetime,
vol.Required(ATTR_AWAY_END): cv.datetime,
Expand All @@ -154,7 +142,7 @@ def async_add_climate(data_points: tuple[BaseCustomDpClimate, ...]) -> None:
func="async_enable_away_mode_by_calendar",
)
platform.async_register_entity_service(
name=SERVICE_ENABLE_AWAY_MODE_BY_DURATION,
name=HmipLocalServices.ENABLE_AWAY_MODE_BY_DURATION,
schema={
vol.Required(ATTR_AWAY_HOURS): cv.positive_int,
vol.Required(ATTR_AWAY_TEMPERATURE, default=18.0): vol.All(
Expand All @@ -164,21 +152,21 @@ def async_add_climate(data_points: tuple[BaseCustomDpClimate, ...]) -> None:
func="async_enable_away_mode_by_duration",
)
platform.async_register_entity_service(
name=SERVICE_DISABLE_AWAY_MODE,
name=HmipLocalServices.DISABLE_AWAY_MODE,
schema={},
func="async_disable_away_mode",
)

platform.async_register_entity_service(
name=SERVICE_COPY_SCHEDULE,
name=HmipLocalServices.COPY_SCHEDULE,
schema={
vol.Required(ATTR_SOURCE_ENTITY_ID): cv.string,
},
func="async_copy_schedule",
)

platform.async_register_entity_service(
name=SERVICE_COPY_SCHEDULE_PROFILE,
name=HmipLocalServices.COPY_SCHEDULE_PROFILE,
schema={
vol.Optional(ATTR_SOURCE_ENTITY_ID): cv.string,
vol.Required(ATTR_SOURCE_PROFILE): cv.string,
Expand All @@ -189,7 +177,7 @@ def async_add_climate(data_points: tuple[BaseCustomDpClimate, ...]) -> None:
)

platform.async_register_entity_service(
name=SERVICE_GET_SCHEDULE_PROFILE,
name=HmipLocalServices.GET_SCHEDULE_PROFILE,
schema={
vol.Required(ATTR_PROFILE): cv.string,
},
Expand All @@ -198,7 +186,7 @@ def async_add_climate(data_points: tuple[BaseCustomDpClimate, ...]) -> None:
)

platform.async_register_entity_service(
name=SERVICE_GET_SCHEDULE_PROFILE_WEEKDAY,
name=HmipLocalServices.GET_SCHEDULE_PROFILE_WEEKDAY,
schema={
vol.Required(ATTR_PROFILE): cv.string,
vol.Required(ATTR_WEEKDAY): cv.string,
Expand All @@ -208,7 +196,7 @@ def async_add_climate(data_points: tuple[BaseCustomDpClimate, ...]) -> None:
)

platform.async_register_entity_service(
name=SERVICE_SET_SCHEDULE_PROFILE,
name=HmipLocalServices.SET_SCHEDULE_PROFILE,
schema={
vol.Required(ATTR_PROFILE): cv.string,
vol.Required(ATTR_PROFILE_DATA): dict,
Expand All @@ -217,7 +205,7 @@ def async_add_climate(data_points: tuple[BaseCustomDpClimate, ...]) -> None:
)

platform.async_register_entity_service(
name=SERVICE_SET_SCHEDULE_PROFILE_WEEKDAY,
name=HmipLocalServices.SET_SCHEDULE_PROFILE_WEEKDAY,
schema={
vol.Required(ATTR_PROFILE): cv.string,
vol.Required(ATTR_WEEKDAY): cv.string,
Expand All @@ -227,7 +215,7 @@ def async_add_climate(data_points: tuple[BaseCustomDpClimate, ...]) -> None:
)

platform.async_register_entity_service(
name=SERVICE_SET_SCHEDULE_SIMPLE_PROFILE,
name=HmipLocalServices.SET_SCHEDULE_SIMPLE_PROFILE,
schema={
vol.Required(ATTR_PROFILE): cv.string,
vol.Required(ATTR_BASE_TEMPERATURE): cv.positive_float,
Expand All @@ -237,7 +225,7 @@ def async_add_climate(data_points: tuple[BaseCustomDpClimate, ...]) -> None:
)

platform.async_register_entity_service(
name=SERVICE_SET_SCHEDULE_SIMPLE_PROFILE_WEEKDAY,
name=HmipLocalServices.SET_SCHEDULE_SIMPLE_PROFILE_WEEKDAY,
schema={
vol.Required(ATTR_PROFILE): cv.string,
vol.Required(ATTR_WEEKDAY): cv.string,
Expand Down
103 changes: 37 additions & 66 deletions custom_components/homematicip_local/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

DOMAIN: Final = "homematicip_local"
HMIP_LOCAL_MIN_HA_VERSION: Final = "2024.10.0dev0"
HMIP_LOCAL_HAHOMEMATIC_VERSION: Final = "2024.10.16"
HMIP_LOCAL_HAHOMEMATIC_VERSION: Final = "2024.10.17"

DEFAULT_DEVICE_FIRMWARE_CHECK_ENABLED: Final = True
DEFAULT_DEVICE_FIRMWARE_CHECK_INTERVAL: Final = 21600 # 6h
Expand Down Expand Up @@ -56,71 +56,42 @@
EVENT_TITLE: Final = "title"
EVENT_UNAVAILABLE: Final = "unavailable"

SERVICE_CLEAR_CACHE: Final = "clear_cache"
SERVICE_COPY_SCHEDULE: Final = "copy_schedule"
SERVICE_COPY_SCHEDULE_PROFILE: Final = "copy_schedule_profile"
SERVICE_CREATE_CENTRAL_LINKS: Final = "create_central_links"
SERVICE_DISABLE_AWAY_MODE: Final = "disable_away_mode"
SERVICE_ENABLE_AWAY_MODE_BY_CALENDAR: Final = "enable_away_mode_by_calendar"
SERVICE_ENABLE_AWAY_MODE_BY_DURATION: Final = "enable_away_mode_by_duration"
SERVICE_EXPORT_DEVICE_DEFINITION: Final = "export_device_definition"
SERVICE_FETCH_SYSTEM_VARIABLES: Final = "fetch_system_variables"
SERVICE_FORCE_DEVICE_AVAILABILITY: Final = "force_device_availability"
SERVICE_GET_DEVICE_VALUE: Final = "get_device_value"
SERVICE_GET_LINK_PARAMSET: Final = "get_link_paramset"
SERVICE_GET_LINK_PEERS: Final = "get_link_peers"
SERVICE_GET_PARAMSET: Final = "get_paramset"
SERVICE_GET_SCHEDULE_PROFILE: Final = "get_schedule_profile"
SERVICE_GET_SCHEDULE_PROFILE_WEEKDAY: Final = "get_schedule_profile_weekday"
SERVICE_LIGHT_SET_ON_TIME: Final = "light_set_on_time"
SERVICE_PUT_LINK_PARAMSET: Final = "put_link_paramset"
SERVICE_PUT_PARAMSET: Final = "put_paramset"
SERVICE_REMOVE_CENTRAL_LINKS: Final = "remove_central_links"
SERVICE_SET_COVER_COMBINED_POSITION: Final = "set_cover_combined_position"
SERVICE_SET_DEVICE_VALUE: Final = "set_device_value"
SERVICE_SET_INSTALL_MODE: Final = "set_install_mode"
SERVICE_SET_SCHEDULE_PROFILE: Final = "set_schedule_profile"
SERVICE_SET_SCHEDULE_PROFILE_WEEKDAY: Final = "set_schedule_profile_weekday"
SERVICE_SET_SCHEDULE_SIMPLE_PROFILE: Final = "set_schedule_simple_profile"
SERVICE_SET_SCHEDULE_SIMPLE_PROFILE_WEEKDAY: Final = "set_schedule_simple_profile_weekday"
SERVICE_SET_VARIABLE_VALUE: Final = "set_variable_value"
SERVICE_SWITCH_SET_ON_TIME: Final = "switch_set_on_time"
SERVICE_TURN_ON_SIREN: Final = "turn_on_siren"
SERVICE_UPDATE_DEVICE_FIRMWARE_DATA: Final = "update_device_firmware_data"

HMIP_LOCAL_SERVICES: Final = (
SERVICE_CLEAR_CACHE,
SERVICE_COPY_SCHEDULE,
SERVICE_COPY_SCHEDULE_PROFILE,
SERVICE_CREATE_CENTRAL_LINKS,
SERVICE_DISABLE_AWAY_MODE,
SERVICE_ENABLE_AWAY_MODE_BY_CALENDAR,
SERVICE_ENABLE_AWAY_MODE_BY_DURATION,
SERVICE_EXPORT_DEVICE_DEFINITION,
SERVICE_FETCH_SYSTEM_VARIABLES,
SERVICE_FORCE_DEVICE_AVAILABILITY,
SERVICE_GET_DEVICE_VALUE,
SERVICE_GET_LINK_PARAMSET,
SERVICE_GET_LINK_PEERS,
SERVICE_GET_PARAMSET,
SERVICE_GET_SCHEDULE_PROFILE,
SERVICE_GET_SCHEDULE_PROFILE_WEEKDAY,
SERVICE_LIGHT_SET_ON_TIME,
SERVICE_PUT_LINK_PARAMSET,
SERVICE_PUT_PARAMSET,
SERVICE_REMOVE_CENTRAL_LINKS,
SERVICE_SET_COVER_COMBINED_POSITION,
SERVICE_SET_DEVICE_VALUE,
SERVICE_SET_INSTALL_MODE,
SERVICE_SET_SCHEDULE_PROFILE,
SERVICE_SET_SCHEDULE_PROFILE_WEEKDAY,
SERVICE_SET_SCHEDULE_SIMPLE_PROFILE,
SERVICE_SET_SCHEDULE_SIMPLE_PROFILE_WEEKDAY,
SERVICE_SET_VARIABLE_VALUE,
SERVICE_SWITCH_SET_ON_TIME,
SERVICE_TURN_ON_SIREN,
SERVICE_UPDATE_DEVICE_FIRMWARE_DATA,
)

class HmipLocalServices(StrEnum):
"""Enum with services."""

CLEAR_CACHE = "clear_cache"
COPY_SCHEDULE = "copy_schedule"
COPY_SCHEDULE_PROFILE = "copy_schedule_profile"
CREATE_CENTRAL_LINKS = "create_central_links"
DISABLE_AWAY_MODE = "disable_away_mode"
ENABLE_AWAY_MODE_BY_CALENDAR = "enable_away_mode_by_calendar"
ENABLE_AWAY_MODE_BY_DURATION = "enable_away_mode_by_duration"
EXPORT_DEVICE_DEFINITION = "export_device_definition"
FETCH_SYSTEM_VARIABLES = "fetch_system_variables"
FORCE_DEVICE_AVAILABILITY = "force_device_availability"
GET_DEVICE_VALUE = "get_device_value"
GET_LINK_PARAMSET = "get_link_paramset"
GET_LINK_PEERS = "get_link_peers"
GET_PARAMSET = "get_paramset"
GET_SCHEDULE_PROFILE = "get_schedule_profile"
GET_SCHEDULE_PROFILE_WEEKDAY = "get_schedule_profile_weekday"
LIGHT_SET_ON_TIME = "light_set_on_time"
PUT_LINK_PARAMSET = "put_link_paramset"
PUT_PARAMSET = "put_paramset"
REMOVE_CENTRAL_LINKS = "remove_central_links"
SET_COVER_COMBINED_POSITION = "set_cover_combined_position"
SET_DEVICE_VALUE = "set_device_value"
SET_INSTALL_MODE = "set_install_mode"
SET_SCHEDULE_PROFILE = "set_schedule_profile"
SET_SCHEDULE_PROFILE_WEEKDAY = "set_schedule_profile_weekday"
SET_SCHEDULE_SIMPLE_PROFILE = "set_schedule_simple_profile"
SET_SCHEDULE_SIMPLE_PROFILE_WEEKDAY = "set_schedule_simple_profile_weekday"
SET_VARIABLE_VALUE = "set_variable_value"
SWITCH_SET_ON_TIME = "switch_set_on_time"
TURN_ON_SIREN = "turn_on_siren"
UPDATE_DEVICE_FIRMWARE_DATA = "update_device_firmware_data"


TOTAL_SYSVAR: Final[tuple[str, ...]] = (
"svEnergyCounter_",
Expand Down
Loading

0 comments on commit ecc1d6d

Please sign in to comment.