async def _async_service_get_variable_value(hass: HomeAssistant, service: ServiceCall) -> ServiceResponse:
    """Service to call read value from Homematic(IP) Local system variable."""
    entry_id = service.data[CONF_ENTRY_ID]
    name = service.data[CONF_NAME]

    if control := _async_get_control_unit(hass=hass, entry_id=entry_id):
        try:
            if (value := await control.central.get_system_variable(legacy_name=name)) is not None:
                return {"result": value}
        except BaseHomematicException as ex:
            raise HomeAssistantError(ex) from ex
    return None
Service to call read value from Homematic(IP) Local system variable.
custom_components/homematicip_local/services.py